* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #2c3140;
  --muted: #7d8598;
  --accent: #3bb4a6;
  --border: #e5e8f0;
  --radius: 16px;
}

body {
  margin: 0;
  font-family: "Pretendard", "Malgun Gothic", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, #f7f5ff 100%);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.app-header h1 {
  font-size: 28px;
  margin: 0 0 6px;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(20, 30, 60, 0.06);
  padding: 24px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.req {
  font-weight: 400;
  color: var(--accent);
  font-size: 12px;
}

.opt {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

input[type="text"],
input[type="file"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fafbfe;
}

input[type="text"]:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hint {
  margin: 6px 2px 0;
  font-size: 12px;
  color: var(--muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
}

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

input[type="color"] {
  width: 48px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}

.presets {
  display: flex;
  gap: 6px;
}

.preset-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}

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

.status-field {
  min-height: 20px;
}

.status {
  margin: 0;
  font-size: 13px;
  color: var(--accent);
  min-height: 18px;
}

.primary-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#finalCanvas {
  max-width: 100%;
  max-height: 60vh;
  display: none;
}

.placeholder {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.app-footer {
  margin-top: 28px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.app-footer code {
  background: #eef0f7;
  padding: 1px 6px;
  border-radius: 6px;
}
