:root { --blue: #0a6fba; --bg: #eef4fb; --ink: #1b2733; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif; }
header { background: var(--blue); color: #fff; padding: 14px 20px; }
header h1 { margin: 0; font-size: 20px; }
header .note { margin: 4px 0 0; font-size: 12px; opacity: .85; }
main { display: flex; gap: 24px; padding: 20px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.preview { flex: 0 1 480px; width: 100%; text-align: center; }
/* 2 カラムになる幅のときだけ、プレビューをスクロールに追従させる */
@media (min-width: 960px) {
  .preview { position: sticky; top: 12px; }
}
@media (max-width: 600px) {
  main { padding: 12px; gap: 16px; }
}
canvas { width: 100%; max-width: 480px; height: auto; aspect-ratio: 3/4; background: #fff;
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.25); touch-action: none; }
.panel { flex: 1 1 380px; max-width: 560px; }
fieldset { background: #fff; border: 1px solid #c5d6e8; border-radius: 8px; margin: 0 0 14px; padding: 10px 14px 12px; }
legend { font-weight: bold; color: var(--blue); padding: 0 6px; }
label.f { display: grid; grid-template-columns: 8.5em 1fr; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
input[type=text], textarea, select { width: 100%; padding: 6px 8px; font: inherit; border: 1px solid #9db4cc; border-radius: 4px; }
textarea { resize: vertical; }
.ctl { margin: 6px 0; font-size: 14px; }
.ctl label { display: flex; justify-content: space-between; }
.ctl input { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; justify-content: center; }
.panel .row { justify-content: flex-start; }
label.inline { font-size: 14px; }
button { padding: 7px 14px; font: inherit; border: 1px solid var(--blue); background: #fff; color: var(--blue); border-radius: 6px; cursor: pointer; }
button:hover { background: #e3f0fb; }
button.primary { background: var(--blue); color: #fff; font-weight: bold; padding: 10px 28px; font-size: 16px; }
button.primary:hover { background: #085a98; }
.hint { font-size: 12px; color: #5a6b7c; margin: 6px 0 0; }
.hint.first { margin: 0 0 8px; }
.status { margin: 8px 0; font-size: 13px; font-weight: bold; color: #5a6b7c; word-break: break-all; }
.status.ok { color: #1d7a3a; }
.status.ng { color: #c0392b; }
code { background: #eef4fb; padding: 1px 4px; border-radius: 3px; }
canvas.drop { outline: 4px dashed var(--blue); outline-offset: -4px; }
button:disabled { opacity: .45; cursor: not-allowed; }
footer { text-align: center; font-size: 12px; color: #5a6b7c; padding: 10px 20px 24px; }
