:root {
  color-scheme: dark;
  --bg: #030303;
  --fg: #e6edf3;
  --muted: #8b949e;
  --line: #d8dee9;
  --blue: #58a6ff;
  --green: #00d17d;
  --yellow: #f2cc60;
  --red: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.18;
}

body.light {
  --bg: #f7f7f2;
  --fg: #111820;
  --muted: #5f6975;
  --line: #111820;
  color-scheme: light;
}

.terminal-header,
.shell,
.shell-footer {
  width: min(1920px, calc(100% - 40px));
  margin: 0 auto;
}

.terminal-header {
  padding: 14px 0 4px;
}

pre,
.node-card {
  margin: 0;
  white-space: pre;
  tab-size: 2;
}

.ascii-header {
  color: var(--fg);
}

.shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px 0 32px;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 22px 20px;
  align-items: start;
}

.node-card,
.ascii-block {
  color: var(--fg);
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
  font-family: inherit;
  font-size: inherit;
}

.node-grid.details { display: block; }
.node-grid > * { min-width: 0; }
.terminal-header nav { display: flex; gap: 24px; margin: 14px 0 6px; }
.terminal-header nav { flex-wrap: wrap; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; }
.filters:has(label:not([hidden])) { padding: 6px 0; }
.filters:not(:has(label:not([hidden]))) { display: none; }
select, button { font: inherit; color: var(--blue); background: var(--bg); border: 1px solid var(--muted); border-radius: 3px; padding: 5px 8px; }
button { cursor: pointer; }
.notice { border-left: 2px solid var(--yellow); padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
[data-connection] { color: var(--muted); font-size: 12px; }
[hidden] { display: none !important; }
.terminal-box { display: block; }
.terminal-bottom { display: flex; }
.terminal-row { display: grid; grid-template-columns: 2ch minmax(0, 1fr) 2ch; }
.terminal-content { overflow: hidden; }
.terminal-top { display: flex; }
.terminal-title { flex-shrink: 1; overflow: hidden; }
.terminal-fill { flex: 1; min-width: 0; overflow: hidden; }
.terminal-gap { display: block; height: 1.18em; }
.status-headline { display: block; white-space: normal; line-height: 1.4; margin-bottom: 6px; }
[data-status] > .terminal-box { max-width: 100%; }
.ascii-header { overflow-x: auto; }
.event-block { white-space: pre; }

.node-card {
  cursor: pointer;
  display: block;
  container-type: inline-size;
  font-size: 12px;
}
.node-card > .terminal-box { width: 100% !important; }
@supports (font-size: 1cqi) {
  .node-card > .terminal-box { font-size: clamp(10px, 3.5cqi, 14px); }
}

.node-card:focus-visible {
  outline: 1px solid var(--blue);
  outline-offset: 5px;
}

.ok {
  color: var(--green);
}

.warn {
  color: var(--yellow);
}

.bad {
  color: var(--red);
}

.linkish,
a {
  color: var(--blue);
  text-decoration: none;
}

.muted,
.shell-footer {
  color: var(--muted);
}

.shell-footer {
  padding: 18px 0 32px;
}

@media (max-width: 720px) {
  html,
  body {
    font-size: 12px;
  }

  .terminal-header,
  .shell,
  .shell-footer {
    width: calc(100vw - 18px);
  }

  .node-grid {
    grid-template-columns: 1fr;
  }
}
