:root {
  color-scheme: light;
  --ink: #111111;
  --paper: #f7f7f2;
  --panel: #ffffff;
  --line: #d7d7cc;
  --muted: #666b70;
  --accent: #2f6f73;
  --accent-dark: #1f5255;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.workspace {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(320px, 1fr);
  gap: 28px;
  align-items: center;
}

.controls {
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus-visible,
.download:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 36%, transparent);
  outline-offset: 2px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

button,
.download {
  min-height: 46px;
  border-radius: 8px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

button {
  background: var(--accent);
  color: white;
  flex: 1;
}

button:hover {
  background: var(--accent-dark);
}

.download {
  width: 72px;
  background: var(--ink);
  color: white;
}

.download[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.42;
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.status.error {
  color: #9f1f1f;
}

.preview {
  display: grid;
  place-items: center;
  min-width: 0;
}

canvas {
  width: min(100%, 738px);
  height: auto;
  aspect-ratio: 1;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 20px 44px rgb(0 0 0 / 10%);
}

@media (max-width: 800px) {
  .shell {
    padding: 18px;
    place-items: start center;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .preview {
    order: -1;
  }
}
