.wp {
  max-width: 1080px; margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start;
}
@media (max-width: 760px) {
  .wp { grid-template-columns: 1fr; gap: 16px; }
}

/* プレビュー */
.wp-stage { display: flex; flex-direction: column; align-items: center; }
.device {
  --w: 300px;              /* JSで機種に合わせて上書き */
  --b: 12px;               /* 外枠の太さ（JSで上書き） */
  position: relative;
  margin: calc(var(--b) + 12px) 0 calc(var(--b) + 8px);
}
.phone {
  position: relative;
  width: var(--w);
  aspect-ratio: var(--ar, 0.46);
  overflow: hidden;
  background: #0d0d0f;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.phone:active { cursor: grabbing; }
.phone canvas, .phone .ovl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ovl { pointer-events: none; }
.frame {
  position: absolute; pointer-events: none;
  left: calc(-1 * var(--b)); top: calc(-1 * var(--b));
  width: calc(100% + 2 * var(--b)); height: calc(100% + 2 * var(--b));
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.25));
  overflow: visible;
}
.ovl text { font-family: -apple-system, "SF Pro Display", "Helvetica Neue", "Hiragino Sans", system-ui, sans-serif; }

.drop {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: #e8e8ea; cursor: pointer; text-align: center;
  background: radial-gradient(circle at 50% 35%, #2a2a2e, #0d0d0f 70%);
}
.drop.hidden { display: none; }
.drop.over { background: radial-gradient(circle at 50% 35%, #2c3e66, #0d0d0f 70%); }
.drop-icon { font-size: 34px; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.drop-title { font-weight: 600; font-size: 16px; }
.drop-sub { font-size: 12px; color: #a0a0a6; line-height: 1.5; }

.note { color: var(--muted); font-size: 12px; text-align: center; min-height: 1.5em; margin: 0 0 10px; max-width: 360px; }
.ov-switch { width: 100%; max-width: 360px; margin-bottom: 12px; }
.actions { display: flex; gap: 10px; width: 100%; max-width: 360px; }
.actions .btn {
  flex: 1; min-height: 52px; font-size: 16px; font-weight: 600; padding: 8px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.actions[hidden], .ov-switch[hidden] { display: none; }
.actions .btn small { font-size: 11px; font-weight: 500; opacity: .8; line-height: 1.3; }
#pickLabel { flex: 0 0 36%; font-size: 15px; white-space: nowrap; background: var(--surface); }

/* 細かい設定 */
.wp-side { display: flex; flex-direction: column; gap: 16px; }
.wp-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px;
}
.wp-panel h2 { font-size: 15px; margin: 0 0 14px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
select {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.hint { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 6px 0 0; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button {
  flex: 1; font: inherit; font-size: 14px; border: 0; background: transparent; color: var(--text);
  min-height: 40px; padding: 8px 4px; border-radius: 8px; cursor: pointer;
}
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.row { display: flex; gap: 8px; }
.btn {
  flex: 1; font: inherit; font-size: 14px; min-height: 44px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.btn.primary { border: 0; background: var(--accent); color: var(--accent-text); }
.btn:disabled { opacity: .4; cursor: default; }
.swatches { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.swatches[hidden] { display: none; }
.swatches button, .swatches .custom {
  width: 36px; height: 36px; border-radius: 50%; padding: 0; cursor: pointer; position: relative;
  background: var(--c); border: 1px solid rgba(0,0,0,.15); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.swatches .custom { background: conic-gradient(#f44, #fd4, #4d6, #4bf, #84f, #f4a, #f44); overflow: hidden; }
.swatches .custom input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.swatches .on { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 広告の予定地（?ads=preview のときだけ見える） */
.ad-slot {
  min-height: 250px; border: 1px dashed var(--line); border-radius: 12px;
  display: grid; place-items: center; color: var(--muted); font-size: 13px;
  background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(127,127,127,.06) 10px 20px);
}
.ad-slot[hidden] { display: none; }
.wp-article .ad-slot { margin: 24px 0; }

/* 説明文 */
.wp-article { max-width: 720px; margin: 40px auto 0; padding: 0 16px; }
.wp-article h2 { font-size: 18px; margin: 28px 0 8px; }
.wp-article p, .wp-article li { color: var(--text); font-size: 15px; }
.table-wrap { overflow-x: auto; }
.sizes { width: 100%; border-collapse: collapse; font-size: 14px; }
.sizes th, .sizes td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.sizes th { color: var(--muted); font-weight: 600; font-size: 13px; }
.sizes td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

.drop[hidden] { display: none; }

.privacy {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.5; color: var(--muted);
}
.privacy svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

#pickLabel[hidden] { display: none; }
.btn.primary:disabled { background: var(--line); color: var(--muted); opacity: 1; }
.drop-flow {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px; margin-top: 22px;
  font-size: 12px; color: #c8c8cc; white-space: nowrap;
}
.drop-flow > span { display: flex; align-items: center; gap: 8px; }
.drop-flow b {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,.14); font-size: 10.5px; font-weight: 700;
}

.msg { min-height: 0; margin: 10px 0 0; max-width: 360px; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }
.msg:empty { display: none; }
.phone:focus-visible, .drop:focus-visible, #pickLabel:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
