:root {
  --bg: #12141a;
  --panel: #171a21;
  --line: #262a34;
  --text: #e6e9f0;
  --muted: #98a0b4;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 340px;
  background: var(--bg);
  color: var(--text);
  font:
    13px / 1.5 ui-sans-serif,
    system-ui,
    sans-serif;
}

#graph {
  height: 100vh;
  min-width: 0;
}

#graph .empty {
  padding: 3rem;
  color: var(--muted);
  max-width: 40ch;
}

aside {
  border-left: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
  overflow-y: auto;
}

h1 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

h2 {
  margin: 20px 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

h3 {
  margin: 0 0 2px;
  font-size: 14px;
}

h4 {
  margin: 12px 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

p {
  margin: 0 0 8px;
}

.hint,
.status {
  color: var(--muted);
  font-size: 12px;
}

.status.working::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: #d1a13c;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

.error {
  color: #cf5b7e;
  font-size: 12px;
}

#detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  min-height: 120px;
}

#detail .kind {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}

/* Class selectors first: the id-qualified rules below are more specific, and
   listing them the other way round makes the cascade order misleading. */
.issues,
.detail-list {
  margin: 0;
  padding-left: 16px;
}

.issues li,
.detail-list li {
  margin-bottom: 3px;
  color: var(--muted);
}

.detail-list strong {
  color: var(--text);
  font-weight: 500;
}

code {
  font:
    11px ui-monospace,
    monospace;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* External-link icon: trails the hostname it belongs to, never wraps alone. */
.ext {
  margin-left: 4px;
  vertical-align: -1px;
  opacity: 0.7;
}

/* Matches the node border colour a crash loop paints on the canvas. */
.detail-list li.live-fail,
.detail-list li.live-fail code {
  color: #e5534b;
}

.legend {
  display: grid;
  gap: 4px;
}

label.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: 60vh 1fr;
    height: auto;
  }

  #graph {
    height: 60vh;
  }

  aside {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}
