:root {
  color-scheme: light;
  font-family: "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  background: #f5f3f7;
  color: #221a26;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(170, 75, 192, 0.12), transparent 34rem),
    #f5f3f7;
}

button, input { font: inherit; }

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(540px, 1.22fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e7dfe9;
  border-radius: 20px;
  box-shadow: 0 16px 44px rgba(43, 25, 48, 0.08);
}

.form-panel { padding: 28px; position: sticky; top: 20px; }
.preview-panel { padding: 24px; }

.heading-row, .preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #8a4b9b;
}

h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: clamp(24px, 3vw, 34px); }
h2 { font-size: 22px; }

.status-pill {
  white-space: nowrap;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f2ebf4;
  color: #70417a;
  font-size: 12px;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field { display: grid; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field > span { font-size: 13px; font-weight: 800; }
.field strong { color: #a1233d; font-size: 11px; }
.field em { color: #777; font-size: 11px; font-style: normal; }
.field small { color: #756f77; font-size: 11px; }

input[type="text"], input[type="file"] {
  width: 100%;
  border: 1px solid #d9cedd;
  border-radius: 10px;
  background: #fff;
  color: #221a26;
}

input[type="text"] {
  height: 44px;
  padding: 0 12px;
}

input[type="text"]:focus, input[type="file"]:focus {
  outline: 3px solid rgba(145, 65, 168, 0.15);
  border-color: #9552a8;
}

input[type="file"] { padding: 9px; }
input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  margin-right: 10px;
  background: #eee6f0;
  color: #63336f;
  font-weight: 700;
  cursor: pointer;
}

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

.date-grid label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.date-grid small { color: #4c454e; font-weight: 700; }
.upload-field { padding-top: 2px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  border: 0;
  border-radius: 10px;
  padding: 11px 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary {
  margin-left: auto;
  min-width: 150px;
  color: white;
  background: linear-gradient(135deg, #8b2bad, #6d1e87);
  box-shadow: 0 8px 18px rgba(110, 31, 136, 0.22);
}
.button.secondary { background: #eee8f0; color: #513458; }
.button.ghost { background: transparent; color: #70417a; border: 1px solid #ddcfdf; }

.message {
  min-height: 1.4em;
  margin: 14px 0 0;
  font-size: 13px;
  color: #706a72;
}
.message.error { color: #a1233d; }
.message.success { color: #247344; }

.canvas-frame {
  width: 100%;
  background: #ece8ee;
  border-radius: 14px;
  padding: 14px;
  overflow: auto;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  box-shadow: 0 10px 28px rgba(26, 18, 29, 0.18);
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .form-panel { position: static; }
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 20px, 1480px); margin: 10px auto 18px; gap: 12px; }
  .panel { border-radius: 14px; }
  .form-panel, .preview-panel { padding: 18px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .button.primary { width: 100%; margin-left: 0; }
}
