:root {
  --bg: #14161a;
  --panel: #1d2027;
  --line: #2c313b;
  --text: #e8eaee;
  --muted: #8b93a3;
  --accent: #4f8cff;
}

* { box-sizing: border-box; }

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

header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

h1 { margin: 0; font-size: 19px; letter-spacing: 0.02em; }

.tagline { margin: 0; color: var(--muted); }

header .actions { margin-left: auto; display: flex; gap: 8px; }

button {
  font: inherit;
  color: var(--text);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

button:hover { filter: brightness(1.1); }

button.primary { background: #2f9e6f; }

.progress {
  padding: 6px 20px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.progress.on { color: var(--accent); }

main {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.preview, .previews { display: grid; gap: 16px; }

.previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.wide { grid-column: 1 / -1; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.drop {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.drop.over { border-color: var(--accent); background: #212634; }

.controls { position: sticky; top: 16px; display: grid; gap: 12px; }

.ctl { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }

.ctl span { color: var(--text); float: right; }

.ctl input[type="range"] { width: 100%; }

.ctl.check { display: flex; align-items: center; gap: 8px; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }

.swatch { display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); }

.swatch input[type="color"] {
  width: 100%;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
}

.canvasHost canvas, #srcPreview {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

#srcPreview[hidden] { display: none; }

.svgPreview {
  background: #ffffff;
  border-radius: 6px;
  overflow: auto;
  max-height: 78vh;
  resize: vertical;
}

.svgPreview svg { width: 100%; height: auto; display: block; }
