.page {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 16px 48px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: #0f172a;
}

.header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.sub {
  margin: 8px 0 0;
  color: #475569;
}

.card {
  margin-top: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 1px 1px rgba(2, 6, 23, 0.04);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 120px 120px 1fr auto;
  gap: 12px;
  align-items: end;
}

.field span {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.field input[type="file"] {
  width: 100%;
}

.field input[type="number"] {
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

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

.fieldInline {
  display: grid;
  gap: 8px;
  align-content: start;
}

.fieldInline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0f172a;
}

.miniValue {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #0f172a;
  background: #e2e8f0;
  vertical-align: middle;
}

.buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

button {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
}

button#renderBtn {
  background: #0f172a;
}

button#downloadBtn {
  background: #2563eb;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.panelHeader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.panelHeader h2 {
  margin: 0;
  font-size: 14px;
  color: #0f172a;
}

.meta {
  font-size: 12px;
  color: #64748b;
  margin-left: 12px;
}

.previewFrame {
  padding: 12px;
  background: #f1f5f9;
  min-height: 320px;
  display: grid;
  place-items: center;
}

canvas {
  max-width: 100%;
  height: auto;
  background: transparent;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 10px;
}

#svgPreview svg {
  max-width: 100%;
  height: auto;
  background: transparent;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 10px;
}

.hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 900px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }
  .buttons {
    justify-content: flex-start;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .previewFrame {
    min-height: 240px;
  }
}

