:root {
  --bg: #faf7ff;
  --surface: #ffffff;
  --ink: #1b1335;
  --ink-sub: #574e73;
  --accent-text: #6a48e6;
  --line: #ece6fb;
  --accent: #7c5cff;
  --accent2: #ff5fa2;
  --accent3: #ffb443;
  --accent-ink: #ffffff;
  --accent-soft: #f1ecff;
  --grad: linear-gradient(135deg, #ff5fa2 0%, #7c5cff 55%, #5b8def 100%);
  --grad-warm: linear-gradient(135deg, #ffb443, #ff5fa2);
  --ok: #12b886;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 2px 6px rgba(80,40,160,.06), 0 14px 34px rgba(80,40,160,.10);
  --shadow-pop: 0 8px 0 rgba(124,92,255,.18);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* キーボード操作時のフォーカスリング（マウス操作では出ない） */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
}
/* 背景の装飾ブロブ */
body::before, body::after {
  content: ""; position: fixed; z-index: 0; border-radius: 50%;
  filter: blur(70px); opacity: .5; pointer-events: none;
}
body::before { width: 460px; height: 460px; top: -160px; right: -120px;
  background: radial-gradient(circle, #ff5fa2, transparent 70%); }
body::after { width: 520px; height: 520px; bottom: -220px; left: -160px;
  background: radial-gradient(circle, #7c5cff, transparent 70%); }
body > * { position: relative; z-index: 1; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 26px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 13px; }
.logo {
  width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--grad); color: #fff; border-radius: 14px; font-size: 24px;
  box-shadow: 0 6px 16px rgba(124,92,255,.4); transform: rotate(-4deg);
}
.brand h1 {
  margin: 0; font-size: 24px; font-weight: 900; letter-spacing: .3px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { margin: 0; font-size: 12px; color: var(--ink-sub); font-weight: 600; }
.privacy-badge {
  font-size: 13px; font-weight: 800; color: #0a7a5a;
  background: #e4fbf2; border: 2px solid #b6f0db;
  padding: 8px 15px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(18,184,134,.16);
}

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 8px; padding: 18px 26px 0;
  max-width: 1500px; margin: 0 auto; width: 100%;
}
.tab {
  border: 2px solid transparent; background: rgba(255,255,255,.6); cursor: pointer;
  font: inherit; font-weight: 800; font-size: 14px; color: var(--ink-sub);
  padding: 11px 20px; border-radius: 999px; transition: .15s;
}
.tab:hover { color: var(--accent); }
.tab.active { color: #fff; background: var(--grad); box-shadow: 0 6px 16px rgba(124,92,255,.34); }

/* ---------- layout ---------- */
.tab-panel { display: none; }
.tab-panel.active { display: grid; }
#panel-resize {
  grid-template-columns: 326px minmax(0,1fr) 308px;
  gap: 20px; padding: 20px 26px 48px;
  max-width: 1500px; margin: 0 auto; width: 100%;
  align-items: start;              /* stickyを効かせる必須指定（各列がstretchしない） */
}
.col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* 中央プレビューを画面に固定 → 左の操作をどれだけスクロールしても見え続ける */
.col-preview { position: sticky; top: 84px; max-height: calc(100vh - 100px); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card-title { margin: 0 0 13px; font-size: 15px; font-weight: 900; }
.card-title.center { text-align: center; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.card-title-row .card-title { margin: 0; }
.hint { font-size: 12px; color: var(--ink-sub); margin: 9px 0 0; line-height: 1.6; }

/* ---------- dropzone ---------- */
.dropzone {
  border: 2.5px dashed #cbbdf5; border-radius: var(--radius-sm); cursor: pointer;
  padding: 30px 16px; text-align: center; transition: .18s;
  background: linear-gradient(180deg, #fdfbff, #f5f0ff);
}
.dropzone.small { padding: 20px; margin-top: 14px; }
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(124,92,255,.16);
}
.dz-inner p { margin: 5px 0; font-size: 14px; }
.dz-inner strong { color: var(--accent-text); }
.dz-sub { color: var(--ink-sub); font-size: 12px !important; }
.dz-icon { font-size: 30px; }
.dz-icon.big { font-size: 44px; }

/* ---------- presets ---------- */
.preset-list { display: flex; flex-direction: column; gap: 5px; }
.preset-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; font-weight: 600; transition: .12s;
}
.preset-item:hover { background: var(--accent-soft); }
.preset-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.preset-item .dim { color: var(--ink-sub); font-size: 12px; margin-left: auto; font-weight: 500; }

/* ---------- segmented ---------- */
.seg { display: flex; gap: 5px; background: #f1ecfb; padding: 5px; border-radius: 14px; }
.seg button {
  flex: 1; border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 800; color: var(--ink-sub);
  padding: 9px 6px; border-radius: 10px; transition: .12s;
}
.seg button.active { background: #fff; color: var(--accent); box-shadow: var(--shadow); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; font-size: 13px; font-weight: 600; }
.row.tight { margin: 0; }
.row input[type=color] { width: 46px; height: 32px; border: 2px solid var(--line); border-radius: 9px; background: none; cursor: pointer; }
select {
  font: inherit; font-size: 13px; font-weight: 600; padding: 9px 12px;
  border: 2px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; color: var(--ink);
}
select:focus { border-color: var(--accent); }

/* ---------- buttons ---------- */
.btn-primary, .btn-ghost, .btn-add {
  font: inherit; cursor: pointer; border-radius: 999px; font-weight: 800; border: 2px solid transparent; transition: .15s;
}
.btn-primary {
  background: var(--grad); color: var(--accent-ink); padding: 10px 18px; font-size: 13px;
  box-shadow: 0 6px 16px rgba(124,92,255,.34);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(124,92,255,.42); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: #e7e1f7; color: #8579b8; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-sub); padding: 9px 14px; font-size: 12.5px; margin-top: 11px; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-add { background: var(--accent-soft); color: var(--accent); padding: 7px 14px; font-size: 12.5px; }
.btn-add:hover { background: #e6def9; transform: translateY(-1px); }

/* ---------- text layers ---------- */
.layer-list { display: flex; flex-direction: column; gap: 7px; }
.layer-chip {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 600; transition: .12s;
}
.layer-chip:hover { border-color: #d3c7f7; }
.layer-chip.active { border-color: var(--accent); background: var(--accent-soft); }
.layer-chip .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-chip .del { color: var(--accent2); background: none; border: none; cursor: pointer; font-size: 17px; padding: 0 4px; line-height: 1; }

.layer-editor { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 11px; }
.layer-editor textarea {
  font: inherit; font-size: 13px; width: 100%; min-height: 56px; resize: vertical;
  border: 2px solid var(--line); border-radius: 11px; padding: 9px;
}
.layer-editor textarea:focus { border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11.5px; color: var(--ink-sub); font-weight: 800; }
.field-row { display: flex; gap: 9px; }
.field-row .field { flex: 1; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; }
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ---------- preview stage ---------- */
.col-preview { gap: 11px; }
.preview-toolbar { display: flex; justify-content: flex-end; }
.preview-toolbar .row span { font-size: 12px; color: var(--ink-sub); font-weight: 700; }
.stage {
  background:
    linear-gradient(45deg, #ece6fa 25%, transparent 25%),
    linear-gradient(-45deg, #ece6fa 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ece6fa 75%),
    linear-gradient(-45deg, transparent 75%, #ece6fa 75%);
  background-size: 22px 22px; background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  background-color: #f8f4ff;
  border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 330px; display: grid; place-items: center; padding: 20px; overflow: hidden;
}
#previewCanvas {
  max-width: 100%; max-height: 62vh; border-radius: 8px;
  box-shadow: 0 10px 30px rgba(80,40,160,.22); touch-action: none; cursor: grab; display: none;
}
#previewCanvas.dragging { cursor: grabbing; }
.stage-empty { text-align: center; color: var(--ink-sub); }
.stage-empty p { font-size: 13px; font-weight: 600; }
.stage-hint { font-size: 12px; color: var(--ink-sub); text-align: center; margin: 0; font-weight: 600; }
.stage-hint.center { text-align: center; }

/* ---------- export ---------- */
.export-card { position: sticky; top: 84px; }

/* ---------- accordion (折りたたみ操作カード) ---------- */
details.acc { padding: 0; }
details.acc > .acc-sum {
  list-style: none; cursor: pointer; user-select: none;
  font-size: 14.5px; font-weight: 900; color: var(--ink);
  padding: 16px 18px; display: flex; align-items: center; justify-content: space-between;
}
details.acc > .acc-sum::-webkit-details-marker { display: none; }
details.acc > .acc-sum::after { content: "▾"; color: var(--ink-sub); font-size: 13px; transition: transform .2s; }
details.acc[open] > .acc-sum::after { transform: rotate(180deg); }
details.acc > .acc-sum:hover { color: var(--accent); }
.acc-body { padding: 0 18px 18px; }
.btn-add.full { width: 100%; margin-bottom: 10px; }

/* ---------- ブランドキット ---------- */
.bk-label { font-size: 11px; font-weight: 900; color: var(--ink-sub); letter-spacing: .06em; margin: 14px 0 6px; }
.bk-label:first-child { margin-top: 0; }
.brand-colors { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.swatch {
  position: relative; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 2px solid rgba(0,0,0,.08); padding: 0; transition: .12s;
}
.swatch:hover { transform: translateY(-2px) scale(1.06); }
.swatch .sw-x {
  position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; line-height: 14px; text-align: center;
  background: var(--ink); color: #fff; border-radius: 50%; font-size: 11px; opacity: 0; transition: .12s;
}
.swatch:hover .sw-x { opacity: 1; }
.swatch.add {
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  border: 2px dashed #c4b8ee; font-size: 16px; font-weight: 800;
}
.swatch.add .sw-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- フィルムストリップ（複数枚バッチ） ---------- */
.filmstrip { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.fs-item {
  position: relative; width: 56px; height: 56px; border-radius: 9px; overflow: hidden;
  border: 2px solid var(--line); cursor: pointer; transition: .12s; flex: 0 0 auto;
}
.fs-item.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.fs-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fs-item .fs-x {
  position: absolute; top: 1px; right: 1px; width: 17px; height: 17px; line-height: 15px;
  background: rgba(27,19,53,.72); color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 12px; padding: 0;
}
.fs-item .fs-n { position: absolute; bottom: 1px; left: 2px; font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.fs-add {
  width: 56px; height: 56px; border-radius: 9px; border: 2px dashed #c4b8ee; background: var(--accent-soft);
  color: var(--accent); font-size: 22px; font-weight: 800; cursor: pointer; flex: 0 0 auto;
}
.fs-add:hover { background: #e6def9; }

/* ---------- カラー＆トーン補正 ---------- */
.adj-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.adj-chip {
  font: inherit; font-size: 11.5px; font-weight: 800; cursor: pointer;
  color: var(--accent-text); background: var(--accent-soft); border: 1px solid transparent;
  padding: 6px 11px; border-radius: 999px; transition: .12s;
}
.adj-chip:hover { background: var(--grad); color: #fff; transform: translateY(-1px); }
.adj-group {
  font-size: 11px; font-weight: 900; color: var(--ink-sub); letter-spacing: .06em;
  margin: 14px 0 4px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.adj-actions { display: flex; gap: 8px; }
.adj-chip.custom { background: #eaf7f1; color: #0c8f6a; display: inline-flex; align-items: center; gap: 6px; }
.adj-chip.custom:hover { background: var(--ok); color: #fff; }
.adj-chip.custom .x { font-weight: 900; opacity: .7; }
.adj-chip.custom .x:hover { opacity: 1; }

/* 書き出しサムネ：クリックで編集サイズ切替 */
.export-item .thumb { cursor: pointer; }
.export-item.editing { outline: 2px solid var(--accent); outline-offset: 1px; }
.editing-tag { font-size: 10px; font-weight: 800; color: #fff; background: var(--accent); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.export-grid { display: flex; flex-direction: column; gap: 13px; max-height: 70vh; overflow: auto; }
.export-item {
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; transition: .15s;
}
.export-item:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(80,40,160,.12); }
.export-item .thumb { width: 100%; display: block; background: #f3eefc; }
.export-item .meta { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; font-size: 12px; }
.export-item .meta .name { font-weight: 800; }
.export-item .meta .size { color: var(--ink-sub); font-weight: 600; }
.export-item .dl {
  text-decoration: none; font-size: 12px; font-weight: 800; color: #fff;
  background: var(--grad); padding: 6px 13px; border-radius: 999px;
}
.export-item .dl:hover { filter: brightness(1.06); }
.export-empty { font-size: 12.5px; color: var(--ink-sub); text-align: center; padding: 22px 0; font-weight: 600; }

/* ---------- X grid tab ---------- */
#panel-xgrid { grid-template-columns: 372px minmax(0,1fr); gap: 20px; padding: 20px 26px 48px; max-width: 1300px; margin: 0 auto; width: 100%; }
.x-thumbs { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-top: 14px; }
.x-thumbs .xt { position: relative; border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; }
.x-thumbs .xt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-thumbs .xt button { position: absolute; top: 5px; right: 5px; background: rgba(27,19,53,.7); color: #fff; border: none; border-radius: 8px; width: 24px; height: 24px; cursor: pointer; font-weight: 800; }
.xgrid-preview { display: flex; flex-direction: column; gap: 14px; }
.x-stage { display: grid; place-items: center; min-height: 350px; background: #f8f4ff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
#xCanvasWrap { width: 100%; max-width: 540px; }
#xCanvas { border-radius: 10px; box-shadow: 0 10px 30px rgba(80,40,160,.2); }
.x-export { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 11px; }
.x-export a {
  text-decoration: none; font-size: 12px; font-weight: 800; text-align: center; color: var(--accent-text);
  border: 2px solid var(--accent-soft); background: #fff; padding: 10px; border-radius: var(--radius-sm); transition: .14s;
}
.x-export a:hover { background: var(--grad); color: #fff; border-color: transparent; transform: translateY(-2px); }

/* ---------- buttons (variants) ---------- */
.btn-ghost.full { width: 100%; margin-top: 10px; }
.btn-ghost.mini { margin: 0; padding: 5px 10px; font-size: 11.5px; }

/* ---------- style presets ---------- */
.style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.style-chip {
  display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 700; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 4px; transition: .14s; text-align: center; line-height: 1.2;
}
.style-chip:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 18px rgba(124,92,255,.16); }
.style-chip .se { font-size: 20px; }

/* ---------- undo group / icon buttons ---------- */
.preview-toolbar { justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.safe-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-sub); cursor: pointer; white-space: nowrap; }
.safe-toggle input { width: 16px; height: 16px; accent-color: var(--accent2); }
.undo-group { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  font-size: 18px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; transition: .12s;
}
.icon-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- output format ---------- */
.out-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.seg.small { padding: 3px; gap: 3px; }
.seg.small button { padding: 6px 10px; font-size: 12px; }
.qwrap { flex: 1; min-width: 120px; }
.qwrap label { font-size: 11px; color: var(--ink-sub); font-weight: 700; display: block; margin-bottom: 2px; }

/* ---------- empty state onboarding ---------- */
.empty-lead { font-size: 15px; font-weight: 800; color: var(--ink); margin: 6px 0 14px; }
.steps { display: flex; flex-direction: column; gap: 8px; margin: 0 auto 14px; width: max-content; }
.steps span { font-size: 13px; font-weight: 600; color: var(--ink-sub); display: flex; align-items: center; gap: 9px; }
.steps b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 12px; }
.empty-sub { font-size: 12px; color: var(--ink-sub); }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(20,10,40,.3);
  opacity: 0; transform: translateY(12px); transition: .28s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.loading { display: flex; align-items: center; gap: 9px; }
.ld-spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .ld-spin { animation: none; } }

/* ---------- kbd ---------- */
kbd {
  font-family: inherit; font-size: 11px; font-weight: 700; color: var(--accent-text);
  background: var(--accent-soft); border: 1px solid #ddd3fa; border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 6px;
}

/* ---------- background removal ---------- */
.bg-remove { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.btn-magic {
  width: 100%; font: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer;
  color: #fff; background: var(--grad-warm); border: none; border-radius: 999px; padding: 11px 16px;
  box-shadow: 0 6px 16px rgba(255,95,162,.34); transition: .15s;
}
.btn-magic:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255,95,162,.42); }
.btn-magic:disabled { opacity: .6; cursor: progress; transform: none; }
.progress { height: 7px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress .bar { height: 100%; width: 0; background: var(--grad-warm); border-radius: 999px; transition: width .25s; }

/* ---------- affiliate next-step ---------- */
.next-step { border: 1px solid #ffe0ec; background: linear-gradient(180deg,#fffafc,#fff5f9); }
.ns-head { display: flex; align-items: center; justify-content: space-between; }
.ns-head .card-title { margin: 0; }
.pr-tag { font-size: 12px; font-weight: 800; color: var(--ink-sub); border: 1px solid var(--line); background: #fff; padding: 2px 9px; border-radius: 999px; letter-spacing: .04em; }
.ns-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ns-item {
  display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; transition: .14s;
}
.ns-item:hover { transform: translateY(-2px); border-color: var(--accent2); box-shadow: 0 8px 18px rgba(255,95,162,.14); }
.ns-emoji { font-size: 20px; width: 26px; text-align: center; }
.ns-text { display: flex; flex-direction: column; line-height: 1.3; }
.ns-text strong { font-size: 13.5px; font-weight: 800; }
.ns-text small { font-size: 11.5px; color: var(--ink-sub); }

/* ---------- SEO content ---------- */
.seo-content { background: rgba(255,255,255,.7); border-top: 1px solid var(--line); padding: 44px 26px; }
.seo-inner { max-width: 860px; margin: 0 auto; }
.seo-inner h2 {
  font-size: 19px; font-weight: 900; margin: 32px 0 12px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block;
}
.seo-inner h2:first-child { margin-top: 0; }
.seo-inner p { font-size: 14px; color: var(--ink); line-height: 1.85; margin: 0 0 8px; }
.seo-inner strong { color: var(--accent-text); }
.seo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.seo-list li {
  font-size: 13.5px; line-height: 1.7; padding: 11px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.seo-list li strong { color: var(--accent-text); }
.faq { margin: 0; }
.faq dt { font-size: 14px; font-weight: 800; margin: 16px 0 5px; }
.faq dt::before { content: "Q. "; color: var(--accent2); }
.faq dd { font-size: 13.5px; color: var(--ink-sub); margin: 0; line-height: 1.75; }
.faq dd::before { content: "A. "; color: var(--accent); font-weight: 800; }

/* ---------- footer ---------- */
.site-footer { text-align: center; padding: 26px; color: var(--ink-sub); font-size: 12px; font-weight: 600; border-top: 1px solid var(--line); background: rgba(255,255,255,.6); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  #panel-resize { grid-template-columns: 300px minmax(0,1fr); }
  .col-export { grid-column: 1 / -1; }
  .export-card { position: static; }
  .export-grid { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .export-item { width: 188px; }
}
@media (max-width: 760px) {
  #panel-resize, #panel-xgrid { grid-template-columns: 1fr; }
  .site-header { position: static; flex-direction: column; align-items: flex-start; gap: 10px; }
  .privacy-badge { font-size: 12px; }
  /* スマホ：プレビューを画面上部に固定し、下に操作を縦スクロール */
  .col-preview {
    position: sticky; top: 0; z-index: 8; order: -1;
    background: var(--bg); max-height: 50vh; padding: 8px 0;
    box-shadow: 0 8px 14px -8px rgba(20,10,40,.3);
  }
  #previewCanvas { max-height: 34vh; }
  .stage { min-height: 0; padding: 10px; }
  .col-preview .preview-toolbar { padding: 0 2px; }
  .col-preview .preview-toolbar .row span { display: none; } /* 「編集中のサイズ」ラベルを省略して縦を詰める */
  .col-preview .preview-toolbar .row select { min-width: 200px; }
  /* タップ領域を確保 */
  .icon-btn { width: 44px; height: 44px; }
  .layer-chip .del { padding: 6px 10px; }
}

/* タッチ端末：hoverで出る削除ボタンを常時表示＆当たり判定を確保 */
@media (hover: none) {
  .swatch .sw-x, .fs-item .fs-x { opacity: 1; }
  .swatch .sw-x { width: 18px; height: 18px; line-height: 16px; }
  .fs-item .fs-x { width: 20px; height: 20px; line-height: 18px; }
}

/* ---------- 仕上げ：押し心地・モーション ---------- */
/* 全ボタンに「押すと沈む」手応え */
.btn-primary:active, .btn-ghost:active, .btn-add:active, .btn-magic:active,
.style-chip:active, .adj-chip:active, .tab:active, .icon-btn:active:not(:disabled),
.export-item:active, .ns-item:active, .swatch:active, .preset-item:active {
  transform: translateY(0) scale(.975); transition-duration: .05s;
}
/* 書き出し中スピナー */
.btn-primary.is-busy { pointer-events: none; }
.btn-primary.is-busy::after {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-left: 8px; vertical-align: -2px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* アコーディオンを開いた瞬間に中身をふわっと */
details.acc[open] > .acc-body { animation: accIn .2s ease; }
@keyframes accIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* 空状態アイコンの浮遊 */
.stage-empty .dz-icon.big { animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-6px); } }
/* ドラッグ受け入れ中は点線→実線で「掴んだ」感 */
.dropzone.drag { border-style: solid; transform: scale(1.01); }
@media (prefers-reduced-motion: reduce) {
  .stage-empty .dz-icon.big, details.acc[open] > .acc-body, .btn-primary.is-busy::after { animation: none; }
  .dropzone.drag { transform: none; }
  .btn-primary:hover, .btn-add:hover, .style-chip:hover, .ns-item:hover, .export-item:hover, .swatch:hover, .fs-item:hover { transform: none; }
  * { transition-duration: .01ms !important; }
}
/* 削除取り消しトーストのアクション */
.toast-action { margin-left: 12px; background: none; border: none; color: #c9b6ff; font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
.toast-action:hover { color: #fff; text-decoration: underline; }

/* モバイル：主CTA（ダウンロード）を画面下に固定して常に押せるように */
.mobile-cta { display: none; }
@media (max-width: 760px) {
  .mobile-cta {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .mobile-cta button { width: 100%; padding: 13px; font-size: 14px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); } /* 固定バーに隠れない */
}
