@font-face {
  font-family: "Pretendard";
  font-weight: 100 900;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/woff2/PretendardVariable.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #66696f;
  --line: #d7dbe2;
  --surface: #ffffff;
  --wash: #f5f6f8;
  --accent: #285aeb;
  --accent-dark: #1740ad;
  --ok: #0d7f52;
  --warn: #b15d00;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(420px, 1fr);
  gap: 24px;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
}

.panel,
.preview-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-panel {
  padding: 28px;
  align-self: start;
}

.panel-header,
.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.panel-header p,
.preview-header p {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 24px;
}

form {
  display: grid;
  gap: 18px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #25272b;
  font-size: 14px;
  font-weight: 700;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  margin-bottom: 8px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 90, 235, 0.12);
}

.field-row,
.id-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.member-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #34373d;
  font-weight: 800;
}

.choice input:checked + span {
  border-color: var(--accent);
  background: #eef3ff;
  color: var(--accent-dark);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #22252a;
  cursor: pointer;
  font-weight: 800;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

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

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.preview-panel {
  min-width: 0;
  padding: 24px;
}

#config-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

#config-pill.ready {
  border-color: rgba(13, 127, 82, 0.28);
  background: rgba(13, 127, 82, 0.08);
  color: var(--ok);
}

.canvas-wrap {
  display: grid;
  place-items: start center;
  overflow: auto;
  max-height: calc(100vh - 134px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eceff3;
}

canvas {
  width: min(100%, 720px);
  height: auto;
  background: #fff;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(720px, calc(100% - 28px));
    padding: 18px 0;
  }

  .canvas-wrap {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .form-panel,
  .preview-panel {
    padding: 18px;
  }

  .field-row,
  .id-grid,
  .actions,
  .member-options {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 25px;
  }
}
