:root {
  --bg: #1e1e1e;
  --bg-soft: #252526;
  --bg-soft2: #2d2d30;
  --fg: #d4d4d4;
  --fg-dim: #969696;
  --accent: #4ec9b0;
  --accent-hover: #6fdcc4;
  --border: #3e3e42;
  --error: #f48771;
  --success: #4ec9b0;
  --header-bg: #007acc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
               sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  font-size: 14px;
}

header {
  padding: 16px 24px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
header h1 {
  margin: 0 0 4px 0;
  font-size: 20px;
  color: var(--accent);
}
header p { margin: 0; color: var(--fg-dim); font-size: 13px; }
header a { color: var(--accent); text-decoration: none; }
header a:hover { text-decoration: underline; }

#status {
  padding: 16px 24px;
  color: var(--fg-dim);
  font-style: italic;
}
#status.error { color: var(--error); font-style: normal; }

#editor-section { padding: 12px 24px 0; }

#editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

#run-btn {
  background: var(--accent);
  color: #1e1e1e;
  border: 0;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 13px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
#run-btn:hover { background: var(--accent-hover); }
#run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#examples {
  background: var(--bg-soft2);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 5px 8px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 13px;
}

#run-info { color: var(--fg-dim); font-size: 12px; }
#run-info.error { color: var(--error); }
#run-info.success { color: var(--success); }

.CodeMirror {
  height: 180px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

#results-section {
  padding: 16px 24px;
  overflow-x: auto;
}

table.results {
  border-collapse: collapse;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  width: max-content;
  max-width: 100%;
}
table.results thead th {
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  text-align: left;
  padding: 6px 12px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
table.results td {
  padding: 4px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  max-width: 600px;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.results td.null {
  color: var(--fg-dim);
  font-style: italic;
}
table.results tr:hover td { background: var(--bg-soft); }

#schema-section { padding: 0 24px 24px; }
#schema-section summary {
  cursor: pointer;
  color: var(--fg-dim);
  font-size: 13px;
  padding: 6px 0;
}
#schema-section summary:hover { color: var(--fg); }
#schema-list {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.schema-table {
  background: var(--bg-soft);
  padding: 10px 14px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.schema-table .name { color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.schema-table .col { color: var(--fg); padding-left: 12px; }
.schema-table .col .type { color: var(--fg-dim); margin-left: 6px; }
