:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #23252b;
  --ink-sub: #6b7280;
  --line: #e4e6ea;
  --accent: #e6447c;
  --accent-ink: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 720px; margin: 0 auto; padding: 0 12px 96px; }

.site-header {
  text-align: center;
  padding: 28px 16px 12px;
}
.site-header h1 { margin: 0; font-size: 1.7rem; font-weight: 800; letter-spacing: .02em; }
.brand-bang { color: var(--accent); }
.tagline { margin: 4px 0 0; color: var(--ink-sub); font-size: .88rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-top: 14px;
}
.card h2 { margin: 0 0 12px; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: .82rem; flex: none;
}
.badge-optional {
  font-size: .7rem; font-weight: normal; color: var(--ink-sub);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}

/* dropzone */
.dropzone {
  border: 2px dashed #c9cdd4;
  border-radius: var(--radius);
  padding: 26px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--accent); background: #fdf2f7; }
.dz-main { margin: 0; font-weight: 600; }
.dz-sub { margin: 2px 0 0; color: var(--ink-sub); font-size: .84rem; }
.dz-count { margin: 6px 0 0; color: var(--accent); font-size: .9rem; font-weight: 600; }

.thumbs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumbs:empty { margin: 0; }
.thumbs li { position: relative; }
.thumbs img, .thumbs .thumb-ph {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); display: block; background: #eceef1;
}
.thumb-ph { display: flex; align-items: center; justify-content: center; color: var(--ink-sub); font-size: .68rem; text-align: center; padding: 4px; }
.thumb-del {
  position: absolute; top: -6px; right: -6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 2px solid #fff;
  font-size: .8rem; line-height: 1; cursor: pointer;
}

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 9px 16px; font-size: .92rem;
  cursor: pointer; user-select: none;
}
.chip.on { border-color: var(--accent); background: #fdf2f7; color: var(--accent); font-weight: 600; }
.chip small { display: block; font-size: .68rem; color: var(--ink-sub); font-weight: normal; }

/* form */
.field { margin-top: 14px; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
.row > * { min-width: 0; }
input[type="text"], select {
  width: 100%; padding: 11px 12px; font-size: 16px; /* 16px以上でiOSのズームを防ぐ */
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
.pos-select { flex: 0 0 34%; }
.field input[type="text"] { margin-top: 8px; }
.field .row input[type="text"] { margin-top: 0; }
.hint { color: var(--ink-sub); font-size: .8rem; margin: 10px 0 0; }

/* action bar */
.action-bar {
  position: sticky; bottom: 0; z-index: 10;
  margin-top: 14px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
.btn-primary {
  display: block; width: 100%;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 12px;
  padding: 15px; font-size: 1.02rem; font-weight: 700; cursor: pointer;
}
.btn-primary:disabled { background: #d3d6db; cursor: default; }
.btn-ghost {
  background: none; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: .84rem; color: var(--ink); cursor: pointer;
  flex: none; white-space: nowrap;
}

.progress-wrap { margin-top: 10px; }
.progress-track { height: 8px; border-radius: 999px; background: #e2e4e8; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width .2s; }
.progress-bar.indeterminate { width: 40% !important; animation: slide 1.1s ease-in-out infinite alternate; }
@keyframes slide { from { margin-left: -10%; } to { margin-left: 70%; } }
.progress-text { text-align: center; font-size: .84rem; color: var(--ink-sub); margin: 6px 0 0; }

/* results */
.results-toolbar { margin: 10px 0; }
.results { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.result-item { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px; }
.result-item.excluded { opacity: .45; }
.result-item.failed { border-color: #f3c1c1; background: #fdf6f6; }
.result-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.result-head input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.result-name { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-error { color: var(--err); font-size: .8rem; margin: 0; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ba figure { margin: 0; }
.ba img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; display: block; }
.ba figcaption { text-align: center; font-size: .72rem; color: var(--ink-sub); margin-top: 2px; }

.error-box {
  background: #fdf0f0; border: 1.5px solid #f3c1c1; color: var(--err);
  border-radius: 10px; padding: 12px; font-size: .9rem;
}

/* range / checkbox */
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .92rem; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* logo */
.logo-preview-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.logo-thumb {
  width: 56px; height: 56px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 10px;
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}

/* LPコンテンツ */
.lp h2 { font-size: 1.02rem; }
.lp-list { margin: 0; padding-left: 1.3em; }
.lp-list li { margin-bottom: 8px; font-size: .92rem; }
.faq { margin: 0; }
.faq dt { font-weight: 700; font-size: .92rem; margin-top: 12px; }
.faq dt::before { content: "Q. "; color: var(--accent); }
.faq dd { margin: 4px 0 0; font-size: .88rem; color: #3c4048; }

.site-footer { text-align: center; color: var(--ink-sub); font-size: .78rem; padding: 20px 16px 40px; }
.site-footer .fine { font-size: .7rem; }

@media (min-width: 640px) {
  .site-header h1 { font-size: 1.7rem; }
  .results { grid-template-columns: 1fr 1fr; }
}
