:root {
  --bg: #05050f;
  --panel: rgba(12, 14, 30, 0.92);
  --border: #2a2f55;
  --text: #e6e8f5;
  --muted: #9aa0c3;
  --accent: #6aa8ff;
  --error: #ff7b7b;
  --ok: #7ee2a8;
  color-scheme: dark;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, sans-serif;
}

#openfusion-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#setup {
  position: fixed;
  top: 16px;
  left: 16px;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-sizing: border-box;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

#setup h1 {
  margin: 0 0 6px;
  font-size: 20px;
}

.lede,
.muted {
  color: var(--muted);
  margin: 0 0 12px;
}

code {
  font-size: 0.92em;
}

.picker {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #05050f;
  font-weight: 600;
  cursor: pointer;
}

.picker:has(input:disabled) {
  opacity: 0.5;
  cursor: progress;
}

.picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.picker:focus-within {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

#status {
  margin: 10px 0;
  min-height: 1.4em;
}

#status.error {
  color: var(--error);
}

#status.ok {
  color: var(--ok);
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
  margin: 0 0 8px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

.search {
  display: block;
  margin: 8px 0;
}

.search span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.search input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0b0d20;
  color: var(--text);
}

.tree {
  font: 13px/1.5 ui-monospace, Consolas, monospace;
}

.tree details > summary {
  cursor: pointer;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 16px;
}

.tree button.file {
  all: unset;
  cursor: pointer;
  color: var(--text);
}

.tree button.file:hover,
.tree button.file:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.details {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0b0d20;
  font: 12px/1.5 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.tree .size {
  color: var(--muted);
  float: right;
}
