:root {
  --bg: #0b0d10;
  --panel: #14181f;
  --line: #2b3340;
  --text: #ecf2f8;
  --muted: #8b96a6;
  --accent: #32e0b0;
  --danger: #ff6b6b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
.hidden { display: none !important; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.left, .top-actions, .editbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.brand { font-weight: 800; }
.brand span { color: var(--accent); }
.who { color: var(--muted); font-size: 14px; }
.wrap { width: min(1000px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0; }
.center {
  min-height: calc(100dvh - 70px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.box {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  display: grid;
  gap: 10px;
}
h1 { margin-bottom: 4px; }
.sub { color: var(--muted); margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.card p { color: var(--muted); font-size: 14px; margin: 8px 0 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn, button {
  border: 0;
  cursor: pointer;
  font: inherit;
  background: var(--accent);
  color: #06281f;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 10px;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
input, textarea {
  font: inherit;
  color: var(--text);
  background: #10141a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
.editbar { padding: 12px; border-bottom: 1px solid var(--line); }
.editbar input { width: auto; min-width: 220px; flex: 1; }
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  min-height: calc(100dvh - 150px);
}
.code {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: none;
}
.preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.preview iframe { width: 100%; height: 100%; min-height: 420px; border: 0; }
.status { padding: 8px 12px; color: var(--muted); }
.err { color: var(--danger); min-height: 18px; }
@media (max-width: 860px) {
  .editor-layout { grid-template-columns: 1fr; }
}
