/* Trove dashboard — dark observability UI with restrained status accents.
   Palette/type/components match the Trove logo system.
   Fonts are self-hosted (latin-subset, variable) so the dashboard stays fully
   offline — it never calls out to a font CDN. */

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

:root {
  color-scheme: dark;
  --ink: #0c0b12;
  --bg: #14121c;
  --elevated: #1d1a27;
  --panel: #262230;
  --panel-soft: #302b3c;
  --border: #41394f;
  --border-strong: #645875;
  --text: #f6f0e5;
  --muted: #bbb2c5;
  /* Normal-sized secondary copy comfortably exceeds AA contrast on --panel. */
  --subtle: #aaa0b4;
  --purple: #8b70ff;
  --green: #72d987;
  --amber: #f0ad69;
  --red: #ff7183;
  --blue: #74baff;
  --code-bg: #100e17;

  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 14% 4%, rgba(139, 112, 255, 0.13), transparent 26rem),
    radial-gradient(circle at 88% 8%, rgba(114, 217, 135, 0.07), transparent 22rem),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--green); }
::selection { background: rgba(139, 112, 255, 0.3); }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.mono { font-family: var(--font-mono); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  background: var(--elevated);
  border: 1px solid var(--purple);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 24px 64px;
}

/* ---- header ---- */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand .mark { display: block; width: 32px; height: 32px; }
.brand .wordmark { display: block; width: 104px; height: auto; }
header h1 {
  margin: 0;
  line-height: 0;
}
.tagline { color: var(--subtle); font-size: 12.5px; font-family: var(--font-mono); }
.status-line {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--subtle);
}
.user-chip .user-email {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip .sign-out {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.user-chip .sign-out:hover {
  color: var(--text);
  border-color: var(--muted);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(114, 217, 135, 0.14);
  animation: pulse-blink 2.4s ease-in-out infinite;
}
.pulse.stale { background: var(--subtle); box-shadow: none; animation: none; }
.pulse.error { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 113, 131, 0.16); animation: none; }
@keyframes pulse-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---- dashboard hierarchy ---- */
.dashboard-section { margin-top: 30px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}
.section-heading.compact { margin-bottom: 12px; }
.eyebrow {
  color: var(--purple);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.section-heading h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.02em;
}
.section-heading p {
  max-width: 540px;
  margin: 0;
  color: var(--subtle);
  font-size: 12.5px;
  text-align: right;
}

/* ---- needs attention ---- */
.attention {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.attention-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 82px;
  padding: 13px 15px;
  color: var(--text);
  font: inherit;
  text-align: left;
  background: linear-gradient(180deg, rgba(36, 34, 56, 0.9), rgba(26, 24, 40, 0.9));
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.attention-card:hover { transform: translateY(-1px); border-color: var(--border-strong); background: var(--panel-soft); }
.attention-count {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
}
.attention-copy { min-width: 0; display: grid; gap: 2px; }
.attention-copy strong { color: var(--text); font-family: var(--font-display); font-size: 14px; }
.attention-copy span { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.attention-action { color: var(--subtle); font-family: var(--font-mono); font-size: 10.5px; white-space: nowrap; }
.attention-critical { border-color: rgba(255, 113, 131, 0.42); }
.attention-critical .attention-count { color: var(--red); background: rgba(255, 113, 131, 0.12); }
.attention-warning { border-color: rgba(240, 173, 105, 0.35); }
.attention-warning .attention-count { color: var(--amber); background: rgba(240, 173, 105, 0.12); }
.attention-info .attention-count { color: var(--blue); background: rgba(116, 186, 255, 0.1); }
.attention-healthy {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid rgba(114, 217, 135, 0.24);
  border-radius: 16px;
  background: rgba(114, 217, 135, 0.055);
}
.attention-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--green);
  background: rgba(114, 217, 135, 0.12);
  font-weight: 800;
}
.attention-healthy div { display: grid; gap: 2px; }
.attention-healthy strong { color: var(--green); font-family: var(--font-display); }
.attention-healthy span { color: var(--muted); font-size: 12px; }

/* ---- summary strip ---- */
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 22px 0 16px;
}
/* health verdict — the at-a-glance answer */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}
.verdict .vdot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.verdict .vbreak { font-family: var(--font-mono); font-weight: 500; font-size: 12px; opacity: 0.85; }
.verdict-ok   { color: var(--green); background: rgba(114, 217, 135, 0.08); border-color: rgba(114, 217, 135, 0.3); }
.verdict-warn { color: var(--amber); background: rgba(240, 173, 105, 0.08); border-color: rgba(240, 173, 105, 0.32); }
.verdict-crit { color: var(--red);   background: rgba(255, 113, 131, 0.08); border-color: rgba(255, 113, 131, 0.34); }
.overview { color: var(--subtle); font-family: var(--font-mono); font-size: 12.5px; }

/* ---- filter bar ---- */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
}
.filterbar input {
  flex: 1 1 280px;
  min-width: 220px;
  height: 42px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 0 14px;
}
.filterbar input::placeholder { color: var(--subtle); }
.filterbar input:focus { outline: none; border-color: var(--purple); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  background: rgba(36, 34, 56, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.chip .n { color: var(--text); font-size: 11px; font-weight: 700; }
.chip:hover { border-color: var(--border-strong); }
.chip.active { color: var(--text); border-color: var(--border-strong); background: rgba(36, 34, 56, 0.95); }
.chip.active.c-green  { color: var(--green);  border-color: var(--green); }
.chip.active.c-red    { color: var(--red);    border-color: var(--red); }
.chip.active.c-yellow { color: var(--amber);  border-color: var(--amber); }
.chip.active.c-peach  { color: var(--amber);  border-color: var(--amber); }
.chip.active.c-gray   { color: var(--muted); }
.chip-clear { color: var(--subtle); border-style: dashed; }
.chip-clear:hover { color: var(--text); border-color: var(--border-strong); }

/* ---- section titles ---- */
.section-title {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--subtle);
  margin: 26px 0 12px;
}

/* ---- agent strip ---- */
.agents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.agent-card {
  display: block;
  width: 100%;
  position: relative;
  overflow: hidden;
  color: inherit;
  font: inherit;
  text-align: left;
  background: linear-gradient(180deg, rgba(36, 34, 56, 0.92), rgba(26, 24, 40, 0.92));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 15px 16px 15px 18px;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.agent-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(48, 43, 60, 0.98), rgba(29, 26, 39, 0.98));
}
.agent-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-strong);
}
.agent-card.ok::before { background: var(--green); }
.agent-card.stale::before { background: var(--amber); }
.agent-card.offline::before { background: var(--red); }
.agent-card.unknown::before { background: var(--subtle); }
.agent-card .name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text); }
.agent-card .meta { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; margin-top: 6px; }
.agent-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.agent-identity { display: inline-flex; align-items: center; min-width: 0; gap: 9px; }
.agent-foot { display: grid; gap: 3px; margin-top: 6px; }
.agent-foot .meta { margin-top: 0; }
.agent-action { color: var(--purple); font-family: var(--font-mono); font-size: 10px; font-weight: 700; white-space: nowrap; }

.platform-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--muted);
  border: 1px solid currentColor;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}
.platform-mark svg { display: block; width: 15px; height: 15px; fill: currentColor; }
.platform-docker { color: #5eb6f2; background: rgba(36, 150, 237, 0.1); }
.platform-proxmox { color: #f28b37; background: rgba(229, 112, 0, 0.1); }
.platform-kubernetes { color: #75a0f4; background: rgba(50, 108, 229, 0.11); }
.platform-linux { color: var(--green); background: rgba(114, 217, 135, 0.08); }

/* ---- host sections ---- */
.host {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(36, 34, 56, 0.55), rgba(26, 24, 40, 0.55));
}
.host-head {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  background: rgba(15, 14, 25, 0.5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}
.host.collapsed .host-head { border-bottom: none; }
.host.collapsed .host-body { display: none; }
.host-toggle {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--subtle);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.host-toggle:hover { color: var(--purple); background: rgba(139, 112, 255, 0.1); }
.host-toggle .chev { font-size: 10px; }
.host-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: -4px;
  padding: 3px 5px;
  color: inherit;
  font: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.host-name:hover { background: rgba(139, 112, 255, 0.09); }
.host-name:hover .hostname { color: var(--purple); }
.host-name .platform-mark { width: 20px; height: 20px; flex-basis: 20px; border-radius: 6px; }
.host-name .platform-mark svg { width: 13px; height: 13px; }
.host-name .hostname { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text); }
.host-head .sub { color: var(--subtle); font-family: var(--font-mono); font-size: 11.5px; }
.host-head .rollup { display: inline-flex; gap: 6px; }
.host-metrics {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.host-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(116, 186, 255, 0.22);
  border-radius: 7px;
  background: rgba(116, 186, 255, 0.06);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}
.host-metric .metric-label { color: var(--blue); }
.host-head .count { margin-left: auto; color: var(--subtle); font-family: var(--font-mono); font-size: 11.5px; }
.host-details {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(139, 112, 255, 0.48);
  border-radius: 9px;
  background: rgba(139, 112, 255, 0.11);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.host-details:hover {
  border-color: var(--purple);
  background: rgba(139, 112, 255, 0.2);
}
.host-body { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 1154px; }
thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 14, 25, 0.35);
}
th.w-service { width: 22%; }
th.w-image   { width: 280px; }
th.w-state   { width: 116px; }
th.w-health  { width: 112px; }
th.w-fresh   { width: 124px; }
th.w-ports   { width: 15%; }
th.w-seen    { width: 108px; }
/* image column takes the remainder */

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(59, 54, 85, 0.5);
  vertical-align: middle;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr[data-ext] { cursor: pointer; transition: background 0.12s ease; }
tbody tr:hover td { background: rgba(45, 42, 67, 0.45); }
tbody tr.cursor td { background: rgba(45, 42, 67, 0.7); }
tbody tr.open td { background: rgba(124, 92, 255, 0.1); }
tbody tr.open td:first-child { box-shadow: inset 3px 0 0 var(--purple); }
tbody tr.removed { opacity: 0.5; }
tbody tr.removed .svc-name { text-decoration: line-through; }

td.svc { overflow-wrap: anywhere; }
.service-details {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 6px;
  margin: -4px -6px;
  color: inherit;
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.service-details:hover { background: rgba(139, 112, 255, 0.1); }
.service-action {
  margin-left: 8px;
  color: var(--border-strong);
  font-weight: 800;
}
.service-details:hover .service-action { color: var(--text); }
/* Badge-only cells (state/health/freshness): tighter padding so the column
   width goes to the badge, not wasted margin. */
tbody td.badgecell { padding-left: 8px; padding-right: 8px; }
.svc-name { min-width: 0; color: var(--text); font-family: var(--font-display); font-weight: 700; }
.tree { color: var(--border-strong); }
.kind {
  flex: none;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}
tbody tr.child .svc-name { color: var(--muted); font-family: var(--font-body); font-weight: 500; }

/* Image references are operational identifiers: wrap them rather than silently
   hiding registry, name, or tag information behind an ellipsis. */
.img-wrap { color: var(--muted); font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.img-prefix {
  color: var(--subtle);
}
.img-name {
  overflow-wrap: anywhere;
}
.img-name .tag { color: var(--blue); }

.ports { color: var(--subtle); font-family: var(--font-mono); font-size: 11.5px; overflow-wrap: anywhere; }
.ports .more { color: var(--muted); }
.muted { color: var(--subtle); }
.nowrap { white-space: nowrap; }
td.seen { text-align: right; color: var(--subtle); font-family: var(--font-mono); font-size: 11.5px; }
/* Persistent, subtle "open me" cue so clickable rows are discoverable without
   having to hover first; brightens on hover. */
tbody tr[data-ext] td.seen::after { content: "›"; margin-left: 9px; color: var(--border-strong); font-weight: 700; }
tbody tr[data-ext]:hover td.seen::after { color: var(--text); }

/* ---- badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  flex: none;
}
.badge.mini { padding: 1px 7px; font-size: 10px; }
.badge.mini::before { width: 6px; height: 6px; margin-right: 5px; }
.b-green  { color: var(--green);  background: rgba(114, 217, 135, 0.1); border-color: rgba(114, 217, 135, 0.28); }
.b-red    { color: var(--red);    background: rgba(255, 113, 131, 0.1); border-color: rgba(255, 113, 131, 0.3); }
.b-yellow { color: var(--amber);  background: rgba(240, 173, 105, 0.1);  border-color: rgba(240, 173, 105, 0.3); }
.b-peach  { color: var(--amber);  background: rgba(240, 173, 105, 0.1);  border-color: rgba(240, 173, 105, 0.3); }
.b-blue   { color: var(--blue);   background: rgba(116, 186, 255, 0.1); border-color: rgba(116, 186, 255, 0.28); }
.b-gray   { color: var(--subtle); background: rgba(126, 120, 155, 0.12); border-color: rgba(126, 120, 155, 0.28); }

/* ---- events ---- */
.events {
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(36, 34, 56, 0.5), rgba(26, 24, 40, 0.5));
}
.event-row {
  display: flex;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(59, 54, 85, 0.45);
  font-size: 13px;
  align-items: baseline;
}
.event-row:last-child { border-bottom: none; }
.event-row.event-critical { box-shadow: inset 3px 0 0 var(--red); background: rgba(255, 113, 131, 0.045); }
.event-row.event-warning { box-shadow: inset 3px 0 0 var(--amber); }
.event-row.event-healthy { box-shadow: inset 3px 0 0 var(--green); }
.event-row.event-info { box-shadow: inset 3px 0 0 var(--blue); }
.event-row .when { color: var(--subtle); font-family: var(--font-mono); font-size: 11.5px; min-width: 84px; }
.event-row .what { color: var(--muted); }
.event-row .what strong { color: var(--text); font-weight: 600; }
.event-row .arrow { color: var(--border-strong); }
.st-green  { color: var(--green); }
.st-red    { color: var(--red); }
.st-yellow { color: var(--amber); }
.st-gray   { color: var(--subtle); }

/* ---- drawer ---- */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 92vw;
  background: var(--elevated);
  border-left: 1px solid var(--border);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
  padding: 22px 22px 40px;
  overflow-y: auto;
  z-index: 50;
}
.d-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.d-head .d-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.d-head h2.d-name { margin: 0; line-height: 1.25; }
.d-close {
  margin-left: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  width: 32px;
  height: 32px;
}
.d-close:hover { color: var(--text); border-color: var(--border-strong); }
.d-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.d-detail {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(116, 186, 255, 0.07);
  border: 1px solid rgba(116, 186, 255, 0.24);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.d-detail.bad {
  background: rgba(255, 113, 131, 0.08);
  border-color: rgba(255, 113, 131, 0.3);
}
.d-detail-label {
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  margin-right: 6px;
}
.d-detail.bad .d-detail-label { color: var(--red); }
.d-sec {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10.5px;
  color: var(--subtle);
  margin: 18px 0 8px;
}
.d-mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.7; }
.d-mono .lbl { color: var(--subtle); }
.kv {
  display: grid;
  grid-template-columns: minmax(90px, 40%) 1fr;
  gap: 6px 14px;
  font-size: 12px;
}
.kv .k { color: var(--subtle); font-family: var(--font-mono); overflow-wrap: anywhere; }
.kv .v { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; overflow-wrap: anywhere; }
.kv.metrics .v { color: var(--text); }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
}
.d-events .event-row { padding: 6px 0 6px 12px; border-bottom: 1px solid rgba(59, 54, 85, 0.45); }
.d-kids .krow { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 12.5px; color: var(--muted); }
.d-empty {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
}
.d-empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12.5px;
}
.d-empty span { display: block; }
.d-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 2px solid var(--blue);
  background: rgba(116, 186, 255, 0.05);
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
}

/* ---- misc ---- */
.empty { color: var(--subtle); padding: 30px 14px; text-align: center; font-style: italic; }
.empty code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-style: normal;
}
.error-banner {
  display: none;
  background: rgba(255, 113, 131, 0.1);
  border: 1px solid rgba(255, 113, 131, 0.4);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.error-banner.show { display: block; }
footer { margin-top: 32px; color: var(--subtle); font-family: var(--font-mono); font-size: 11px; text-align: center; }
footer kbd {
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--muted);
  background: var(--panel);
}

body.drawer-open { overflow: hidden; }

@media (max-width: 680px) {
  .wrap { padding: 18px 14px 44px; }
  .section-heading { align-items: start; flex-direction: column; gap: 5px; }
  .section-heading p { text-align: left; }
  .attention-card { grid-template-columns: auto minmax(0, 1fr); }
  .attention-action { grid-column: 2; }
  .host-head .count { margin-left: 0; }
  .host-details { margin-left: auto; }
  .host-body { overflow-x: visible; }
  table { min-width: 0; table-layout: auto; }
  thead { display: none; }
  tbody { display: block; }
  tbody tr[data-ext] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "service service service"
      "state health fresh"
      "image image image"
      "ports ports seen";
    gap: 8px 10px;
    padding: 12px 13px;
    border-bottom: 1px solid rgba(59, 54, 85, 0.65);
  }
  tbody tr[data-ext]:last-child { border-bottom: 0; }
  tbody tr[data-ext] td {
    padding: 0;
    border: 0;
    background: transparent;
    min-width: 0;
  }
  tbody tr[data-ext] td.svc { grid-area: service; }
  tbody tr[data-ext] td.image { grid-area: image; }
  tbody tr[data-ext] td.state-cell { grid-area: state; }
  tbody tr[data-ext] td.health-cell { grid-area: health; }
  tbody tr[data-ext] td.fresh-cell { grid-area: fresh; }
  tbody tr[data-ext] td.ports { grid-area: ports; align-self: center; }
  tbody tr[data-ext] td.seen { grid-area: seen; align-self: center; }
  tbody tr[data-ext] td.image,
  tbody tr[data-ext] td.ports,
  tbody tr[data-ext] td.seen { display: flex; gap: 8px; align-items: baseline; text-align: left; }
  tbody tr[data-ext] td.image::before,
  tbody tr[data-ext] td.ports::before,
  tbody tr[data-ext] td.seen::before {
    content: attr(data-label);
    flex: none;
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  tbody tr[data-ext] td.seen::after { content: none; }
  tbody tr.child { padding-left: 24px; }
  .service-details { width: 100%; }
  .service-action { margin-left: auto; }
  .badge { padding: 2px 7px; font-size: 10px; }
  .drawer { width: 100%; max-width: 100vw; }
}
