:root {
  --bg: #101418;
  --panel: #f4f1e8;
  --ink: #1d2328;
  --muted: #5b6670;
  --accent: #2f6d3a;
  --accent-ink: #ffffff;
  --danger: #a3261b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, sans-serif; }
#stage { position: fixed; inset: 0 0 40px 0; display: flex; align-items: center; justify-content: center; }
#canvas { width: 100%; height: 100%; display: block; outline: none; cursor: default; image-rendering: pixelated; }
.panel {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--panel); border-radius: 10px; padding: 24px; box-shadow: 0 12px 40px rgb(0 0 0 / 0.5);
}
.panel h1 { margin: 0 0 8px; font-size: 22px; }
.panel p { margin: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
button, .button {
  display: inline-block; border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit;
}
button.small, .button.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: 0.5; cursor: default; }
.status { color: var(--muted); min-height: 1.4em; }
#error .status, #error-text { color: var(--danger); white-space: pre-wrap; }
progress { width: 100%; }
#toolbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 40px; padding: 0 12px;
  display: flex; align-items: center; gap: 8px; background: #1b2229; color: #c9d1d9; font-size: 13px;
}
#toolbar select { max-width: 280px; }
#toolbar .hint { margin-left: auto; opacity: 0.6; }
#debug {
  position: fixed; top: 8px; left: 8px; margin: 0; padding: 6px 8px; border-radius: 4px;
  background: rgb(0 0 0 / 0.7); color: #9fef9f; font: 12px/1.3 ui-monospace, monospace; pointer-events: none;
}
code { font-size: 13px; }
