:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d3dbe8;
  --text: #16233b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
}

.app {
  display: grid;
  grid-template-columns: minmax(330px, 430px) 1fr;
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

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

h1,
h2 {
  margin: 0 0 10px;
}

.hint {
  margin: 0 0 14px;
  color: #42526e;
  line-height: 1.4;
}

.template-row,
.download-row,
.color-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid #95a8c9;
  background: #edf3ff;
  color: #17315c;
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
}

button:hover {
  background: #dfe9ff;
}

.field-grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
}

input[type="text"],
select {
  width: 100%;
  border: 1px solid #becbe3;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

fieldset {
  border: 1px solid #ccd8ec;
  border-radius: 9px;
  margin: 10px 0 14px;
}

.preview-area {
  display: flex;
  flex-direction: column;
}

.preview {
  margin-top: 8px;
  flex: 1;
  border: 1px dashed #9eb2d5;
  border-radius: 12px;
  background: #fff;
  min-height: 520px;
  overflow: auto;
  padding: 12px;
}

.preview svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

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

  .preview {
    min-height: 320px;
  }
}
