:root {
  color-scheme: dark light;
  --bg: #0f1115;
  --surface: #151821;
  --text: #e6e8ee;
  --muted: #8b91a1;
  --accent: #9bb4ff;
  --border: #232735;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

header, footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

footer {
  border-top: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
  font-size: 12px;
}

header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

header a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

header a:hover { text-decoration: underline; }

.version {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.spacer { flex: 1; }

main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  min-height: 0;
}

@media (max-width: 800px) {
  main { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}

.editor-pane, .output-pane {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pane-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.pane-header label { color: var(--muted); }

select, button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

button {
  background: var(--accent);
  color: #0a0d14;
  border-color: var(--accent);
  font-weight: 600;
}

button:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

#status {
  font-family: var(--mono);
  font-size: 11px;
}

#status.error { color: #ff7a7a; }
#status.ok { color: #7eda9b; }

textarea, pre {
  flex: 1;
  margin: 0;
  padding: 14px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  border: 0;
  outline: 0;
  resize: none;
  overflow: auto;
  white-space: pre;
}

pre { white-space: pre-wrap; word-break: break-word; }
pre .err { color: #ff9b9b; }
