:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0284c7;
  --accent-text: #ffffff;
  --radius: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #e0f2fe, var(--bg));
  color: var(--text);
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 960px;
  padding: 2rem 1.25rem 3rem;
}

.app__header { text-align: center; margin-bottom: 2rem; }
.app__header h1 { margin: 0 0 .35rem; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.app__tagline { margin: 0; color: var(--muted); font-size: .95rem; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: var(--surface);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-2);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
}

.field { display: flex; flex-direction: column; gap: .4rem; font-size: .85rem; }
.field--full { grid-column: 1 / -1; }
.field > span { color: var(--muted); font-weight: 500; }
.field--check { flex-direction: row; align-items: center; grid-column: 1 / -1; }
.field--check span { color: var(--text); }

textarea, select, input[type="number"] {
  background: var(--bg);
  border: 1px solid var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: .6rem .7rem;
  font: inherit;
  width: 100%;
}
textarea { resize: vertical; }
input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  background: var(--surface);
  padding: 4px;
  cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.preview {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-2);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.preview__frame {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview__frame svg { width: 100%; height: 100%; display: block; }
.preview__meta { margin: 0; color: var(--muted); font-size: .8rem; min-height: 1em; }

.preview__actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
button {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 8px;
  padding: .6rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .05s ease, opacity .15s ease;
}
button:hover { opacity: .9; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--surface-2); }

.preview__status { margin: 0; min-height: 1.2em; font-size: .8rem; color: var(--accent); }

.app__footer { text-align: center; margin-top: 2rem; color: var(--muted); font-size: .8rem; }
