/* ==========================================================================
   Veilway C2 console stylesheet.

   Shares its token layer (colour, type, space, radius, elevation, motion)
   with the desktop client's gui/src/styles.css so the two read as one
   product. Layout: fonts -> tokens -> base -> shell (header, page head)
   -> primitives (buttons, inputs, badges, alerts, cards, tables) -> data
   widgets (stats, charts, regions) -> screens (login, public status).

   Class names used by templates and inline scripts (.bulk-check,
   .row-edit-toggle, .edit-row, .badge-drained, .status-pill-*, region-*,
   dot-*, status-*) are part of the template contract; keep them.
   ========================================================================== */

/* ---- Fonts (bundled OFL, latin subset) --------------------------------- */

@font-face {
  font-family: "Inter Var";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk Var";
  src: url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Var";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens (keep in step with the desktop client) --------------------- */

:root {
  --bg: #05070c;
  --bg-raised: #0a0e16;
  --surface-1: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.075);
  --surface-4: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.065);
  --line-2: rgba(255, 255, 255, 0.11);
  --line-3: rgba(255, 255, 255, 0.18);

  --text: #eaeff7;
  --text-2: #a1aabb;
  --text-3: #687185;

  --accent: #2ee8d6;
  --accent-2: #4f8dff;
  --accent-ink: #021417;
  --accent-grad: linear-gradient(135deg, #3ef2dc 0%, #2bc6f2 55%, #4f8dff 100%);
  --accent-soft: rgba(46, 232, 214, 0.1);
  --accent-line: rgba(46, 232, 214, 0.34);
  --accent-glow: 0 10px 28px -10px rgba(46, 210, 230, 0.6);

  --ok: #3ee0a1;
  --ok-soft: rgba(62, 224, 161, 0.1);
  --ok-line: rgba(62, 224, 161, 0.3);
  --warn: #f7bd4f;
  --warn-soft: rgba(247, 189, 79, 0.1);
  --warn-line: rgba(247, 189, 79, 0.32);
  --bad: #ff6b72;
  --bad-soft: rgba(255, 107, 114, 0.1);
  --bad-line: rgba(255, 107, 114, 0.34);
  --info: #86a8ff;
  --info-soft: rgba(134, 168, 255, 0.1);
  --info-line: rgba(134, 168, 255, 0.3);
  --idle: #7d8699;

  --font-ui: "Inter Var", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk Var", "Inter Var", system-ui, sans-serif;
  --font-mono: "JetBrains Mono Var", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-micro: 10.5px;
  --fs-caption: 11.5px;
  --fs-sm: 12.5px;
  --fs-body: 13.5px;
  --fs-title: 15px;
  --fs-h1: 26px;
  --fs-stat: 28px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  --hl-top: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-1: var(--hl-top), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: var(--hl-top), 0 12px 32px -14px rgba(0, 0, 0, 0.75);
  --ring: 0 0 0 3px rgba(46, 232, 214, 0.22);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 120ms;
  --t-med: 220ms;
  --t-slow: 520ms;

  --page-w: 1240px;
  --glow: rgba(46, 200, 230, 0.12);
}

/* ---- Base ------------------------------------------------------------- */

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  background: var(--bg);
  color-scheme: dark;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  position: relative;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Ambient glow + a faint dot grid that fades out down the page. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background:
    radial-gradient(70% 45% at 50% -10%, var(--glow), transparent 70%),
    radial-gradient(45% 35% at 100% 100%, rgba(79, 141, 255, 0.07), transparent 70%),
    radial-gradient(35% 30% at 0% 60%, rgba(46, 232, 214, 0.035), transparent 70%),
    linear-gradient(180deg, var(--bg-raised), var(--bg) 55%);
}
body::after {
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1.2px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 40%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 40%);
  opacity: 0.6;
}
/* Page-level mood only tints the ambient glow; the tone-* utilities below
   set text colour, so they must not be used on <body>. */
body.mood-bad {
  --glow: rgba(255, 90, 100, 0.1);
}
body.mood-warn {
  --glow: rgba(247, 170, 79, 0.1);
}

::selection {
  background: rgba(46, 232, 214, 0.3);
  color: #fff;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
  background-clip: padding-box;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
strong {
  font-weight: 600;
}
em {
  color: var(--text);
  font-style: normal;
  font-weight: 600;
}
code,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
code {
  background: var(--surface-3);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--text);
}
pre {
  margin: var(--sp-2) 0 0;
  padding: var(--sp-3) var(--sp-4);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 {
  font-size: var(--fs-h1);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}
h2 {
  font-size: var(--fs-title);
  font-weight: 600;
  margin: var(--sp-8) 0 var(--sp-3);
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.card > h2:first-child,
h2.flush {
  margin-top: 0;
}
p {
  margin: 0 0 var(--sp-2);
}
ol,
ul {
  color: var(--text-2);
  padding-left: 20px;
}
li {
  margin: 4px 0;
}
.muted {
  color: var(--text-2);
}
.subtle {
  color: var(--text-3);
}
.small {
  font-size: var(--fs-caption);
}
.num {
  font-variant-numeric: tabular-nums;
}
.right {
  text-align: right;
}
.break {
  word-break: break-all;
}
/* Prose that may contain long identifiers: wrap at word boundaries first,
   only split a word when it cannot fit on its own line. */
.wrap-any {
  overflow-wrap: anywhere;
}
.spacer {
  flex: 1;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tone-ok {
  color: var(--ok);
}
.tone-warn {
  color: var(--warn);
}
.tone-bad {
  color: var(--bad);
}
.tone-idle {
  color: var(--idle);
}

/* ---- Shell: header ----------------------------------------------------- */

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: 12px max(var(--sp-6), calc((100vw - var(--page-w)) / 2 + var(--sp-6)));
  background: linear-gradient(180deg, rgba(6, 8, 13, 0.9), rgba(6, 8, 13, 0.78));
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
header.top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(46, 232, 214, 0.35), rgba(79, 141, 255, 0.3), transparent);
  opacity: 0.6;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex: none;
}
.brand:hover {
  text-decoration: none;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.brand-chip {
  padding: 1px 7px;
  border-radius: var(--r-xs);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.logo {
  width: 30px;
  height: 30px;
  flex: none;
  filter: drop-shadow(0 4px 12px rgba(46, 210, 230, 0.35));
}
.logo svg {
  display: block;
  width: 100%;
  height: 100%;
}
.logo.lg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 10px 30px rgba(46, 210, 230, 0.45));
}

nav.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  overflow-x: auto;
  scrollbar-width: none;
}
nav.nav::-webkit-scrollbar {
  display: none;
}
nav.nav a {
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t-med) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-med) var(--ease);
}
nav.nav a:hover {
  color: var(--text);
  text-decoration: none;
}
nav.nav a[aria-current="page"] {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-color: var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px -2px rgba(0, 0, 0, 0.6);
}

.top-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-left: auto;
  flex: none;
}
.tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-caption);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tenant-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* ---- Shell: page ------------------------------------------------------- */

main {
  position: relative;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6) 64px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.page-head h1 {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.page-head .lede {
  margin: 6px 0 0;
  max-width: 760px;
  color: var(--text-2);
}
.eyebrow {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--sp-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.grid {
  display: grid;
  gap: var(--sp-4);
}
.grid-2 {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.section-gap {
  margin-top: var(--sp-4);
}

/* ---- Cards ------------------------------------------------------------- */

.card {
  position: relative;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
}
.card.flush {
  padding: 0;
  overflow: hidden;
}
.card.flush > .card-head {
  padding: var(--sp-4) var(--sp-5) 0;
}
.card.flush > .card-foot {
  margin-top: 0;
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--surface-1);
}
.card.muted {
  color: var(--text-2);
}
.card.empty {
  padding: var(--sp-6);
  text-align: center;
  color: var(--text-3);
  border-style: dashed;
  background: var(--surface-1);
  box-shadow: none;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.card-head h3 {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: 600;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  flex-wrap: wrap;
}
.card-foot .muted,
.note {
  font-size: var(--fs-caption);
  color: var(--text-3);
}
.note {
  margin-top: var(--sp-3);
  line-height: 1.55;
}

details.card > summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--text);
}
details.card > summary::-webkit-details-marker {
  display: none;
}
details.card > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-weight: 700;
  transition: transform var(--t-med) var(--ease);
}
details.card[open] > summary::before {
  transform: rotate(45deg);
}
details.card[open] > summary {
  margin-bottom: var(--sp-4);
}

/* ---- Buttons ----------------------------------------------------------- */

button,
.btn {
  --btn-h: 36px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--btn-h);
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 650;
  letter-spacing: 0.005em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), var(--accent-glow);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease),
    transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
button:hover,
.btn:hover {
  filter: brightness(1.08) saturate(1.05);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 12px 32px -10px rgba(46, 210, 230, 0.75);
}
button:active,
.btn:active {
  transform: translateY(1px) scale(0.99);
}
button:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
button:disabled,
button:disabled:hover {
  opacity: 0.4;
  cursor: default;
  transform: none;
  filter: none;
  box-shadow: none;
}

button.ghost,
.btn.ghost,
button.subtle,
.btn.subtle {
  background: var(--surface-2);
  border-color: var(--line-2);
  color: var(--text);
  box-shadow: var(--hl-top);
}
button.ghost:hover,
.btn.ghost:hover {
  filter: none;
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: var(--hl-top);
}
button.subtle:hover,
.btn.subtle:hover {
  filter: none;
  background: var(--surface-3);
  border-color: var(--line-3);
  box-shadow: var(--hl-top);
}
button.danger,
.btn.danger {
  background: var(--bad-soft);
  border-color: var(--bad-line);
  color: #ffb3b7;
  box-shadow: none;
}
button.danger:hover,
.btn.danger:hover {
  filter: none;
  background: rgba(255, 107, 114, 0.18);
  border-color: rgba(255, 107, 114, 0.55);
  color: #fff;
  box-shadow: 0 10px 28px -12px rgba(255, 90, 100, 0.6);
}
button.ok,
.btn.ok {
  background: var(--ok-soft);
  border-color: var(--ok-line);
  color: #a9f2d2;
  box-shadow: none;
}
button.ok:hover,
.btn.ok:hover {
  filter: none;
  background: rgba(62, 224, 161, 0.18);
  border-color: rgba(62, 224, 161, 0.55);
  color: #fff;
  box-shadow: 0 10px 28px -12px rgba(62, 224, 161, 0.5);
}
button.sm,
.btn.sm {
  --btn-h: 30px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-caption);
  border-radius: var(--r-sm);
}
button.icon,
.btn.icon {
  --btn-h: 30px;
  width: 30px;
  padding: 0;
  border-radius: var(--r-sm);
  font-size: 14px;
}
button.chip-x {
  --btn-h: 20px;
  width: 20px;
  padding: 0;
  margin-left: -2px;
  border-radius: var(--r-pill);
  font-size: 13px;
  line-height: 1;
}
button.block,
.btn.block {
  width: 100%;
  --btn-h: 42px;
  font-size: var(--fs-body);
}

/* ---- Form controls ----------------------------------------------------- */

label {
  display: block;
  margin-bottom: 5px;
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--text-2);
}
input,
select,
textarea {
  min-height: 36px;
  padding: 7px 11px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease),
    background var(--t-fast) var(--ease);
}
textarea {
  width: 100%;
  min-height: 96px;
  line-height: 1.55;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-3);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  background: rgba(0, 0, 0, 0.38);
  box-shadow: var(--ring);
}
input[type="color"] {
  width: 56px;
  padding: 4px;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--line-2);
  border-radius: 4px;
}
input[type="number"] {
  font-variant-numeric: tabular-nums;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75);
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px;
  cursor: pointer;
  background-image: url("icons/chevron-down.svg");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
}
select option {
  background-color: #121722;
  color: var(--text);
}
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--line-3);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  vertical-align: middle;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
input[type="checkbox"] {
  border-radius: 5px;
}
input[type="checkbox"]:checked {
  background: var(--accent) url("icons/check.svg") center / 12px 12px no-repeat;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(46, 232, 214, 0.35);
}
input[type="checkbox"]:hover {
  border-color: var(--accent-line);
}
input[type="checkbox"]:focus-visible {
  box-shadow: var(--ring);
}
.w-full {
  width: 100%;
}
.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.field > input,
.field > select,
.field > textarea {
  width: 100%;
}
.field > input[type="color"] {
  width: 56px;
}
.form-grid {
  display: grid;
  gap: var(--sp-3) var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}
.form-stack {
  display: grid;
  gap: var(--sp-4);
  max-width: 640px;
}
.form-stack > label > input,
.form-stack > label > select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
fieldset {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-1);
}
legend {
  padding: 0 6px;
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-2);
}
.check-grid {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text);
  cursor: pointer;
}

form.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
  margin: var(--sp-6) 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-1);
}
form.filters .field {
  min-width: 140px;
}
form.filters .field.grow {
  flex: 1 1 220px;
}
.card-foot > form.filters {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.row-actions,
.inline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.actions-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.actions-row .divider {
  width: 1px;
  height: 24px;
  background: var(--line-2);
}
.error {
  margin: 0 0 var(--sp-3);
  padding: 8px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--bad-line);
  background: var(--bad-soft);
  color: #ffb3b7;
  font-size: var(--fs-sm);
}

/* ---- Badges, pills, dots ------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 3px 2px 0;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-caption);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}
a.badge:hover {
  color: var(--text);
  border-color: var(--line-3);
  text-decoration: none;
}
.badge-ok {
  color: var(--ok);
  border-color: var(--ok-line);
  background: var(--ok-soft);
}
.badge-warn {
  color: var(--warn);
  border-color: var(--warn-line);
  background: var(--warn-soft);
}
.badge-bad,
.badge-drained {
  color: #ff9ea3;
  border-color: var(--bad-line);
  background: var(--bad-soft);
}
.badge-info {
  color: var(--info);
  border-color: var(--info-line);
  background: var(--info-soft);
}
.badge-accent {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.badge-drained,
.badge-stale,
.badge.caps {
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-stale {
  color: var(--warn);
  border-color: var(--warn-line);
  background: var(--warn-soft);
  margin-left: 6px;
}
/* Operator-chosen tag colour arrives as --tag on the element. */
.badge.tag {
  --tag: var(--info);
  color: var(--tag);
  border-color: color-mix(in srgb, var(--tag) 45%, transparent);
  background: color-mix(in srgb, var(--tag) 12%, transparent);
}
.badge.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tag);
  box-shadow: 0 0 6px var(--tag);
}
.badge.group {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.02em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  text-transform: capitalize;
}
.dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 2px;
  background: var(--idle);
}
.dot-online {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(62, 224, 161, 0.15), 0 0 10px rgba(62, 224, 161, 0.7);
  animation: pulse 2.6s var(--ease) infinite;
}
.dot-offline {
  background: #4b5263;
  box-shadow: 0 0 0 3px rgba(125, 134, 153, 0.12);
}
.dot-pending {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(247, 189, 79, 0.15), 0 0 10px rgba(247, 189, 79, 0.5);
}
.dot-drained {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(255, 107, 114, 0.15), 0 0 10px rgba(255, 107, 114, 0.6);
}
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(62, 224, 161, 0.15), 0 0 10px rgba(62, 224, 161, 0.7);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(62, 224, 161, 0.05), 0 0 14px rgba(62, 224, 161, 0.45);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dot-online {
    animation: none;
  }
}
.status-online {
  color: var(--ok);
}
.status-offline {
  color: var(--text-2);
}
.status-pending {
  color: var(--warn);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  font-size: var(--fs-caption);
  font-weight: 600;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.status-pill-green {
  color: var(--ok);
  border-color: var(--ok-line);
  background: var(--ok-soft);
}
.status-pill-yellow {
  color: var(--warn);
  border-color: var(--warn-line);
  background: var(--warn-soft);
}
.status-pill-red {
  color: var(--bad);
  border-color: var(--bad-line);
  background: var(--bad-soft);
}

/* ---- Alerts ------------------------------------------------------------ */

.alert,
.alert-drained {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  margin: 0 0 var(--sp-4);
  padding: 12px 16px 12px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.55;
  overflow: hidden;
}
.alert::before,
.alert-drained::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--tone, var(--info));
  box-shadow: 0 0 12px var(--tone, var(--info));
}
.alert strong,
.alert-drained strong {
  color: var(--tone-text, var(--text));
}
.alert-bad,
.alert-drained {
  --tone: var(--bad);
  --tone-text: #ffc4c7;
  border-color: var(--bad-line);
  background: linear-gradient(90deg, rgba(255, 107, 114, 0.14), rgba(255, 107, 114, 0.05));
  color: #f2c9cb;
}
.alert-warn {
  --tone: var(--warn);
  --tone-text: #ffe0a6;
  border-color: var(--warn-line);
  background: linear-gradient(90deg, rgba(247, 189, 79, 0.13), rgba(247, 189, 79, 0.04));
  color: #eedbb6;
}
.alert-ok {
  --tone: var(--ok);
  --tone-text: #b8f5d9;
  border-color: var(--ok-line);
  background: linear-gradient(90deg, rgba(62, 224, 161, 0.12), rgba(62, 224, 161, 0.04));
  color: #c2ead7;
}
.alert-accent {
  --tone: var(--accent);
  --tone-text: var(--text);
  border-color: var(--accent-line);
  background: linear-gradient(90deg, rgba(46, 232, 214, 0.12), rgba(79, 141, 255, 0.06));
}
.alert .alert-body {
  flex: 1;
  min-width: 0;
}
.alert .alert-body > strong {
  display: block;
  margin-bottom: 2px;
}
.alert pre,
.alert code.secret {
  display: block;
  margin-top: var(--sp-2);
  user-select: all;
}

/* ---- Tables ------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  position: sticky;
  top: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  background: rgba(10, 14, 22, 0.92);
  color: var(--text-3);
  font-size: var(--fs-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
tbody tr {
  transition: background var(--t-fast) var(--ease);
}
tbody tr:hover > td {
  background: rgba(255, 255, 255, 0.025);
}
tbody tr:last-child > td {
  border-bottom: 0;
}
td.right,
th.right {
  text-align: right;
}
td.empty-row {
  padding: 28px;
  text-align: center;
  color: var(--text-3);
}
.card:not(.flush) table th {
  background: transparent;
}
.card:not(.flush) table th:first-child,
.card:not(.flush) table td:first-child {
  padding-left: 0;
}
.card:not(.flush) table th:last-child,
.card:not(.flush) table td:last-child {
  padding-right: 0;
}
.row-name {
  color: var(--text);
  font-weight: 600;
}
a.row-name:hover {
  color: var(--accent);
  text-decoration: none;
}
.cell-primary {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cell-primary a {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.cell-primary a:hover {
  color: var(--accent);
}
.cell-primary .host {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--text-3);
}
.mono-cell {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
}
td.when,
.when {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text-3);
  white-space: nowrap;
}
tr.edit-row > td {
  background: rgba(46, 232, 214, 0.035);
  border-bottom-color: var(--accent-line);
}
tr.edit-row:hover > td {
  background: rgba(46, 232, 214, 0.035);
}
.inline-edit {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
  padding: 6px 0;
}
.inline-edit .edit-buttons {
  display: flex;
  gap: var(--sp-2);
  margin-left: auto;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}
.bulk-bar label.inline {
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.bulk-bar .bulk-count {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text-3);
}
.bulk-bar select,
.bulk-bar input {
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: var(--fs-caption);
}
.bulk-bar button {
  --btn-h: 30px;
  font-size: var(--fs-caption);
}

/* ---- Key/value ---------------------------------------------------------- */

.kv {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 0;
}
.kv > div {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.kv > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.kv div.k {
  color: var(--text-3);
  font-size: var(--fs-caption);
  font-weight: 500;
  display: flex;
  align-items: center;
}
.kv div.k label {
  margin: 0;
  color: inherit;
}
.kv div.v {
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.kv input,
.kv select {
  width: 100%;
}
.kv.form > div {
  padding: 5px 0;
  border-bottom: 0;
}

/* ---- Stats -------------------------------------------------------------- */

.stat-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.stat-grid.stat-col {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}
.stat-card {
  position: relative;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 120% at 0% 0%, var(--stat-tint, rgba(46, 232, 214, 0.06)), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--stat-line, var(--accent)), transparent);
  opacity: 0.5;
}
.stat-card.tone-ok {
  --stat-tint: rgba(62, 224, 161, 0.09);
  --stat-line: var(--ok);
}
.stat-card.tone-warn {
  --stat-tint: rgba(247, 189, 79, 0.09);
  --stat-line: var(--warn);
}
.stat-card.tone-bad {
  --stat-tint: rgba(255, 107, 114, 0.09);
  --stat-line: var(--bad);
}
.stat-card.tone-info {
  --stat-tint: rgba(79, 141, 255, 0.09);
  --stat-line: var(--accent-2);
}
.stat-label {
  font-size: var(--fs-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
.stat-value {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-value.sm {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-inline {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-inline > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.stat-inline .dot {
  width: 7px;
  height: 7px;
}
.stat-sub {
  margin-top: 6px;
  font-size: var(--fs-caption);
  color: var(--text-3);
}
.stat-value .gradient,
.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Charts ------------------------------------------------------------- */

.chart-card {
  padding: var(--sp-4) var(--sp-5) var(--sp-3);
}
.chart-card .card-head {
  margin-bottom: var(--sp-2);
}
.chart-peak {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text-3);
}
.chart-peak strong {
  color: var(--text);
  font-weight: 600;
}
.chart-box {
  --c: var(--accent);
  position: relative;
  height: 180px;
}
.chart-box.c-azure {
  --c: var(--accent-2);
  --area-top: 0.2;
}
svg.chart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart-marker {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent),
    0 0 14px var(--c);
}
svg.chart .grid-line {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
  stroke-dasharray: 2 6;
  vector-effect: non-scaling-stroke;
}
svg.chart .base-line {
  stroke: var(--line-2);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
svg.chart .line {
  fill: none;
  stroke: var(--c);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 60%, transparent));
}
svg.chart .area {
  stroke: none;
}
svg.chart .stop-top {
  stop-color: var(--c);
  stop-opacity: var(--area-top, 0.3);
}
svg.chart .stop-bottom {
  stop-color: var(--c);
  stop-opacity: 0;
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--text-3);
}

/* ---- Region load -------------------------------------------------------- */

.region-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.region-card {
  --rc: var(--ok);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background:
    radial-gradient(100% 120% at 100% 0%, color-mix(in srgb, var(--rc) 10%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid color-mix(in srgb, var(--rc) 28%, var(--line-2));
  box-shadow: var(--shadow-1);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.region-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--rc) 50%, var(--line-2));
}
.region-ok {
  --rc: var(--ok);
}
.region-warn {
  --rc: var(--warn);
}
.region-hot {
  --rc: var(--bad);
}
.region-unknown {
  --rc: var(--idle);
}
.region-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-2);
}
.region-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-title);
  text-transform: capitalize;
  color: var(--text);
}
.region-count {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--text-3);
}
.region-load-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.region-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.region-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 55%, transparent), var(--rc));
  box-shadow: 0 0 10px color-mix(in srgb, var(--rc) 70%, transparent);
  transition: width var(--t-slow) var(--ease);
}
.region-load-label {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---- Reject breakdown ---------------------------------------------------- */

.meter-list {
  display: grid;
  gap: 2px;
}
.meter-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.meter-row:last-child {
  border-bottom: 0;
}
.meter-row .num {
  font-family: var(--font-mono);
  color: var(--text);
}
.meter-row.zero .num {
  color: var(--text-3);
}

/* ---- Exit detail ---------------------------------------------------------- */

.exit-title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.exit-title .status {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
}
.metric-tiles {
  display: grid;
  gap: var(--sp-2);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.metric-tile {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
}
.metric-tile .k {
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.metric-tile .v {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin-bottom: var(--sp-4);
}
.chip-list .badge {
  margin: 0;
}
.chip-list form {
  display: inline-flex;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.secret-box {
  margin-top: var(--sp-2);
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--accent-line);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text);
  word-break: break-all;
  user-select: all;
}

/* ---- Login ----------------------------------------------------------------- */

body.login {
  --glow: rgba(46, 200, 230, 0.2);
  display: grid;
  place-items: center;
  padding: var(--sp-6);
}
.login-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 0;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.login-brand h1 {
  font-size: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-brand p {
  margin: 0;
  color: var(--text-2);
}
.login-card {
  padding: var(--sp-6);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(46, 232, 214, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2), 0 30px 80px -30px rgba(46, 200, 230, 0.25);
}
.login-card::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.login-card form {
  display: grid;
  gap: var(--sp-4);
}
.login-card input {
  width: 100%;
  min-height: 42px;
  font-size: var(--fs-body);
}
.login-foot {
  margin-top: var(--sp-5);
  text-align: center;
  font-size: var(--fs-caption);
  color: var(--text-3);
}

/* ---- Public status page ------------------------------------------------------- */

header.top.public {
  justify-content: space-between;
}
.status-hero {
  --tone: var(--ok);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-6);
  margin-bottom: var(--sp-4);
  border-radius: var(--r-xl);
  background:
    radial-gradient(90% 140% at 0% 0%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid color-mix(in srgb, var(--tone) 30%, var(--line-2));
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.status-hero.warn {
  --tone: var(--warn);
}
.status-hero.down {
  --tone: var(--bad);
}
.status-hero::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tone), transparent);
  opacity: 0.7;
}
.orb {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--tone) 22%, transparent), transparent 70%);
  border: 1px solid color-mix(in srgb, var(--tone) 40%, transparent);
  box-shadow: 0 0 40px -6px color-mix(in srgb, var(--tone) 60%, transparent);
}
.orb::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 18px var(--tone);
}
.status-hero h1 {
  font-size: 28px;
}
.status-hero p {
  margin: 4px 0 0;
  color: var(--text-2);
}
footer.site {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-6) var(--sp-8);
  display: flex;
  justify-content: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-size: var(--fs-caption);
}
footer.site a {
  color: var(--text-2);
}
footer.site a:hover {
  color: var(--accent);
}

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

@media (max-width: 1100px) {
  header.top {
    flex-wrap: wrap;
    row-gap: var(--sp-3);
  }
  nav.nav {
    order: 3;
    width: 100%;
  }
}
@media (max-width: 820px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  main {
    padding: var(--sp-5) var(--sp-4) 48px;
  }
  header.top {
    padding: 10px var(--sp-4);
  }
  .tenant-chip {
    display: none;
  }
  :root {
    --fs-h1: 22px;
    --fs-stat: 24px;
  }
  .kv {
    grid-template-columns: 110px 1fr;
  }
  .status-hero {
    padding: var(--sp-5);
  }
}
