:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e4e6ea;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #2f855a;
  --accent-dark: #276749;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  padding: 20px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.form-panel {
  flex: 1 1 360px;
  min-width: 320px;
}

.preview-panel {
  flex: 1 1 360px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.dev-selectors {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input[type="text"],
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

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

.radio-group {
  display: flex;
  gap: 16px;
}

.radio-option {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hint {
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
}

.confirm-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 8px;
}

.confirm-btn:hover { background: var(--accent-dark); }
.confirm-btn:disabled { background: #a0aec0; cursor: default; }

.download-btn {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  margin-top: 8px;
}

.confirmed-banner {
  background: #e6fffa;
  border: 1px solid #81e6d9;
  color: #234e52;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.hidden { display: none; }

.contents-wrap { display: contents; }
.contents-wrap.hidden { display: none; }

.category-label {
  font-weight: 800;
  font-size: 15px;
  color: var(--accent-dark);
  background: #e6fffa;
  border: 1px solid #81e6d9;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  display: inline-block;
}

.preview-wrap {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 992 / 1341;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

#previewCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.preview-caption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
