:root {
  color-scheme: dark;
  --bg: #101820;
  --panel: rgba(16, 24, 32, 0.88);
  --line: #2b3a48;
  --text: #dbe5ee;
  --muted: #8ea2b4;
  --accent: #7fd1c7;
  --bad: #ff8b7a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

#stage { position: fixed; inset: 0; }
#view { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }

#panel {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 320px;
  padding: 12px 14px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

h1 { font-size: 16px; margin: 0 0 2px; }
h2 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
p { margin: 4px 0; }
.hint { color: var(--muted); font-size: 12px; }

.buttons { display: flex; gap: 8px; margin: 8px 0 4px; }
button {
  flex: 1;
  padding: 6px 10px;
  color: var(--text);
  background: #1b2733;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}
button[aria-pressed="true"] { background: #24464a; border-color: var(--accent); color: #fff; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

dl { display: grid; grid-template-columns: 8.5em 1fr; gap: 2px 8px; margin: 8px 0 0; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }

#nodes { margin: 0; padding-left: 1.6em; font-size: 12px; }
#nodes li { margin: 1px 0; }
#nodes .kind { color: var(--accent); margin-right: 4px; }

#problems {
  position: fixed;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 368px);
  padding: 10px 14px;
  background: rgba(60, 16, 12, 0.94);
  border: 1px solid var(--bad);
  border-radius: 8px;
  color: #ffd9d3;
  font-size: 13px;
  white-space: pre-wrap;
}
#problems.warn { background: rgba(58, 44, 10, 0.94); border-color: #e6c35c; color: #fff0c4; }

#update {
  position: fixed;
  left: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #24464a;
  border: 1px solid var(--accent);
  border-radius: 8px;
}
#update button { flex: none; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  #panel { top: auto; left: 12px; width: auto; height: 38%; }
  #problems { max-width: calc(100% - 24px); bottom: calc(38% + 24px); }
}

#problems .problems-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
#problems .problems-dismiss { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 1px solid currentColor; border-radius: .4rem; font: 1.5rem/1 system-ui,sans-serif; color: inherit; background: transparent; cursor: pointer; }
#problems .problems-dismiss:hover { background: rgba(255,255,255,.1); }
#problems .problems-dismiss:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Copy belongs to the message/dialog it is placed inside, including startup faults. */
.message-copy-control { display: flex; justify-content: flex-end; gap: .4rem; margin: .35rem 0 0; }
.message-copy-control .obs-copy-button { flex:0 0 auto; display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: .25rem; border: 1px solid currentColor; border-radius: .35rem; color: inherit; background: transparent; cursor: pointer; }
.message-copy-control .obs-copy-button:hover { background: rgba(128,128,128,.18); }
.message-copy-control .obs-copy-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
