/* =============================================================
 * Banner Design System — Tool theme
 * 主役は生成されたバナー。UI は無彩色に徹し、アクセントは朱1色だけ。
 * セリフ体はロゴ（--display）のみ。見出し含む全文が日本語サンセリフ。
 * ============================================================= */
:root {
  --paper: #f4f5f7;
  --panel: #ffffff;
  --ink: #101317;
  --ink-soft: #5a6472;
  --ink-faint: #8c96a4;
  --line: #e6e8ec;
  --line-strong: #c9cfd8;
  --accent: #e0301a;
  --accent-deep: #b8240f;
  --ok2: #2f7d4f;
  --err: #c1272d;
  --radius: 8px;
  --display: "Fraunces", "Times New Roman", Georgia, serif; /* ロゴ専用 */
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
          "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(16,19,23,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.btn:focus-visible, .step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

.topbar, .layout, .foot { position: relative; z-index: 1; }

/* ---------- Masthead ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 18px 44px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  max-width: none; margin: 0;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  font-family: var(--display); font-weight: 600; font-size: 28px;
  letter-spacing: .5px; color: var(--ink); line-height: 1;
}
.logo::after { content: "."; color: var(--accent); }
.brand-txt h1 {
  margin: 0; font-weight: 700;
  font-size: 15px; letter-spacing: .2px; color: var(--ink);
}
.brand-txt h1 em { font-style: normal; }
.brand-txt p { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); }
.eyebrow {
  display: inline-block; margin-right: 8px; padding-right: 8px;
  border-right: 1px solid var(--line-strong);
  font-size: 11px; font-weight: 700; color: var(--accent);
}
.topbar-actions { display: flex; gap: 8px; }

.credit-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 12px; background: var(--panel);
}
#auth-box { display: flex; align-items: center; gap: 10px; }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0;
  padding: 0 44px 60px;
  max-width: 1320px; margin: 0 auto;
  align-items: start;
}
.panel { background: transparent; }
.form { padding: 8px 44px 22px 0; border-right: 1px solid var(--line); }
.output { padding: 20px 0 22px 44px; position: sticky; top: 20px; }
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; padding: 0 24px 48px; }
  .form { padding: 8px 0 22px; border-right: none; border-bottom: 1px solid var(--line); }
  .output { padding: 22px 0; position: static; }
  .topbar { padding: 16px 24px; }
}
@media (max-width: 560px) {
  .brand { flex-wrap: wrap; gap: 10px 14px; }
  .brand-txt h1 { font-size: 14px; }
  .brand-txt p { font-size: 11.5px; }
  .eyebrow { border-right: none; margin-right: 0; padding-right: 0; display: block; margin-bottom: 2px; }
}

/* ---------- Groups / section headers ---------- */
.group { padding: 22px 0; border-bottom: 1px solid var(--line); }
.group:last-child { border-bottom: none; }
.group > h2 {
  font-weight: 700; font-size: 15px;
  margin: 0 0 4px; letter-spacing: .2px; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.hint { font-size: 12px; color: var(--ink-soft); margin: 6px 0 16px; line-height: 1.7; }
.hint b { color: var(--ink); font-weight: 700; }

.step-badge {
  display: inline-block; font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 2px 9px; vertical-align: middle; text-transform: uppercase;
}

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span {
  font-size: 11px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: .3px;
}
.sublabel {
  font-size: 11px; font-weight: 700; color: var(--ink-soft);
  display: block; margin: 12px 0 8px; letter-spacing: .3px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .row2, .row3 { grid-template-columns: 1fr; } }

input[type="text"], input[type="url"], input[type="password"], textarea, select {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 10px 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(16,19,23,.08);
}
select {
  appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
                    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 34px;
}
input[type="file"] {
  font-size: 12px; color: var(--ink-soft);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 11px 12px; width: 100%; background: var(--panel); cursor: pointer;
}
input[type="file"]::file-selector-button {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  border: 1px solid var(--ink); background: var(--panel); color: var(--ink);
  border-radius: 3px; padding: 5px 10px; margin-right: 10px; cursor: pointer;
}

/* ---------- Chips (checkbox groups) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chk {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; cursor: pointer; user-select: none;
  border: 1px solid var(--line-strong); background: var(--panel);
  padding: 7px 12px; border-radius: 999px;
  transition: border-color .15s, background .15s, color .15s;
}
.chk:hover { border-color: var(--ink); }
.chk input { accent-color: var(--accent); margin: 0; cursor: pointer; }
.chk:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.swatch { width: 13px; height: 13px; border-radius: 3px; border: 1px solid rgba(0,0,0,.12); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans); font-size: 12.5px; font-weight: 700;
  border-radius: var(--radius); padding: 9px 16px; cursor: pointer;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  transition: transform .06s, background .15s, color .15s, box-shadow .15s;
  letter-spacing: .3px;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn.ghost { border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.btn.primary {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
  padding: 12px 24px; font-size: 13.5px;
}
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary.flash { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { background: transparent; color: var(--ink); }

/* ---------- Import (STEP 1) ---------- */
.import-group {
  background: var(--panel);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 20px 20px 22px;
  margin: 14px 0 4px;
}
.lp-status { font-size: 12px; color: var(--ink-soft); }
.lp-status.busy { color: var(--accent); }
.lp-status.ok { color: var(--ok2); font-weight: 700; }
.lp-status.err { color: var(--err); font-weight: 700; }

/* ---------- Reference image upload ---------- */
.ref-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ref-thumb { position: relative; width: 66px; height: 66px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb button {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  border: none; border-radius: 50%; background: rgba(16,19,23,.72); color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}

/* ---------- Step badges / advanced prompt ---------- */
.prompt-advanced[hidden] { display: none; }
.prompt-advanced { margin: 6px 0 22px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: var(--panel); }
.prompt-advanced > summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.prompt-advanced > summary:hover { color: var(--ink); }
.prompt-advanced .charcount { font-weight: 400; color: var(--ink-faint); }

/* ---------- Samples（テイスト逆引き。STEP2の主導線） ---------- */
.samples {
  margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; background: var(--panel); box-shadow: var(--shadow);
}
.samples > h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.sample-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
@media (max-width: 560px) { .sample-grid { grid-template-columns: 1fr 1fr; } }
.sample-grid figure { margin: 0; }
.sample-grid img {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block;
  transition: border-color .15s, transform .15s;
}
.sample-grid figure:hover img { border-color: var(--ink); transform: translateY(-2px); }
.sample-grid figcaption { font-size: 11px; color: var(--ink-soft); margin-top: 6px; text-align: center; }
.sample-pick { width: 100%; margin-top: 7px; padding: 6px 8px; font-size: 11px; }
.style-ref { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper); }
.style-ref[hidden] { display: none; }
.style-ref img { width: 46px; height: 46px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line-strong); }
.style-ref span { flex: 1; font-size: 12px; font-weight: 700; color: var(--ink); }

/* ---------- Output / prompt ---------- */
.output-head { display: flex; align-items: baseline; justify-content: space-between; }
.output-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.charcount { font-size: 12px; color: var(--ink-faint); }
.output-opts { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 12px 0 10px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.field.inline > span { white-space: nowrap; }
.field.inline select { width: auto; }
.output-text {
  width: 100%; height: 34vh; min-height: 240px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.7; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 14px; resize: vertical; margin-top: 10px;
}
.output-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.tip { font-size: 11.5px; color: var(--ink-soft); margin: 0; line-height: 1.7; }

/* ---------- Generation block (STEP 3) ---------- */
.gen-block { margin-top: 6px; padding-top: 20px; border-top: 1.5px solid var(--ink); }
.gen-block > h2 { font-size: 17px; margin: 0 0 6px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.gen-block code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--paper); padding: 1px 6px; border-radius: 3px;
  font-size: 11.5px; border: 1px solid var(--line);
}

/* ---------- Card actions / gallery ---------- */
.gen-gallery { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.gen-card {
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  width: 200px; padding: 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--panel);
}
.gen-card .ratio { font-size: 11px; font-weight: 700; color: var(--ink-soft); letter-spacing: .3px; }
.gen-card img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 3px; border: 1px solid var(--line); background: var(--paper); }
.gen-card.pending {
  min-height: 150px; justify-content: center; align-items: center; text-align: center;
  color: var(--ink-faint); font-size: 12px; border-style: dashed;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.card-actions .btn { flex: 1; min-width: 52px; text-align: center; padding: 6px 8px; font-size: 11px; }

/* ---------- Resize panel ---------- */
.resize-panel { margin-top: 22px; padding: 18px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--panel); }
.resize-panel[hidden] { display: none; }
.resize-panel h2 { font-size: 15px; margin: 0 0 4px; font-weight: 700; }
.resize-base { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.resize-base img { width: 58px; height: 58px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line-strong); }
.resize-base span { font-size: 12px; font-weight: 700; color: var(--ink); }

/* ---------- Composite editor ---------- */
#comp-canvas {
  display: block; width: 100%; margin-top: 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--paper); cursor: move; touch-action: none;
}

/* ---------- Lightbox（拡大＋配信面プレビュー） ---------- */
body.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(16,19,23,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox-panel {
  background: var(--panel); border-radius: var(--radius);
  padding: 16px; width: min(900px, 100%); max-height: calc(100vh - 48px);
  overflow: auto; box-shadow: 0 18px 50px rgba(16,19,23,.3);
}
.lightbox-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.lb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-tab {
  font-family: var(--sans); font-size: 12px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-soft);
  border-radius: 999px; padding: 6px 12px; transition: all .15s;
}
.lb-tab:hover { border-color: var(--ink); color: var(--ink); }
.lb-tab.active { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.lightbox-body { display: flex; justify-content: center; padding: 4px 0 12px; }
.lb-raw img {
  max-width: 100%; max-height: 62vh; display: block;
  border: 1px solid var(--line); border-radius: 4px;
}
.zoomable { cursor: zoom-in; }

/* --- モック共通 --- */
.mock-phone {
  width: 320px; max-width: 100%;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--panel); overflow: hidden;
}
.mock-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--line-strong), var(--ink-faint));
}
.mock-avatar-sm { width: 22px; height: 22px; }
.mock-name { font-size: 12px; font-weight: 700; color: var(--ink); }
.mock-sponsored { font-size: 10.5px; color: var(--ink-faint); }
.mock-dots {
  margin-left: auto; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-faint);
  box-shadow: 0 -6px 0 var(--ink-faint), 0 6px 0 var(--ink-faint);
}
.mock-chevron {
  width: 6px; height: 6px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.mock-chevron-up { transform: rotate(-135deg); }
.mock-cta-label { font-size: 12px; font-weight: 700; }

/* --- Instagram フィード --- */
.mock-feed-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.mock-feed-who { display: flex; flex-direction: column; line-height: 1.3; }
.mock-feed-media { background: var(--paper); }
.mock-feed-media img { width: 100%; display: block; }
.mock-feed-cta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: #efefef; color: var(--ink);
}
.mock-feed-actions { display: flex; align-items: center; gap: 12px; padding: 10px 12px 4px; }
.mock-spacer { flex: 1; }
.mock-icon { width: 20px; height: 20px; flex: none; color: var(--ink); display: block; }
.mock-feed-caption { padding: 4px 12px 12px; display: flex; gap: 6px; }
.mock-caption-text { font-size: 12px; color: var(--ink-soft); }

/* --- ストーリーズ --- */
.mock-phone-story { width: 280px; border-radius: 18px; }
.mock-story { position: relative; aspect-ratio: 9 / 16; background: #000; overflow: hidden; }
.mock-story-media { position: absolute; inset: 0; }
.mock-story-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mock-story-bars { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; }
.mock-story-bar { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255,255,255,.4); }
.mock-story-bar.is-active { background: #fff; }
.mock-story-head {
  position: absolute; top: 18px; left: 10px; right: 10px;
  display: flex; align-items: center; gap: 7px;
}
.mock-story-head .mock-name { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.mock-story-head .mock-sponsored { color: rgba(255,255,255,.85); text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.mock-story-foot { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; }
.mock-story-pill {
  display: flex; align-items: center; gap: 6px; color: #fff;
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.6);
  border-radius: 999px; padding: 7px 16px;
}

/* --- ディスプレイ広告（記事面） --- */
.mock-page {
  width: min(620px, 100%); border: 1px solid var(--line-strong);
  border-radius: 8px; overflow: hidden; background: var(--panel);
}
.mock-page-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper);
}
.mock-page-logo { width: 44px; height: 10px; border-radius: 2px; background: var(--ink-faint); }
.mock-page-navitem { width: 30px; height: 6px; border-radius: 2px; background: var(--line-strong); }
.mock-page-cols { display: grid; grid-template-columns: 1fr 190px; gap: 16px; padding: 14px; }
@media (max-width: 560px) { .mock-page-cols { grid-template-columns: 1fr; } }
.mock-line { height: 7px; border-radius: 2px; background: var(--line); margin-bottom: 9px; }
.mock-line.short { width: 62%; }
.mock-line-title { height: 12px; background: var(--line-strong); margin-bottom: 12px; }
.mock-ad-slot {
  border: 1px solid var(--line-strong); border-radius: 4px;
  overflow: hidden; margin-bottom: 14px; background: var(--paper); position: relative;
}
.mock-ad-slot img { width: 100%; display: block; }
.mock-ad-label {
  position: absolute; top: 0; left: 0; z-index: 1;
  font-size: 9px; color: var(--ink-soft); background: rgba(255,255,255,.9);
  padding: 1px 5px; border-bottom-right-radius: 3px;
}

/* ---------- Footer ---------- */
.foot {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center;
  padding: 26px; font-size: 11.5px; color: var(--ink-faint);
  border-top: 1px solid var(--line); max-width: 1320px; margin: 0 auto;
}

/* ---------- Collapsible advanced blocks ---------- */
.adv-keys, .adv-detail {
  margin: 6px 0 4px; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; background: var(--panel);
}
.adv-detail { margin: 4px 0 26px; }
.adv-keys > summary, .adv-detail > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.adv-keys > summary:hover, .adv-detail > summary:hover { color: var(--ink); }
.adv-note { font-family: var(--sans); font-weight: 400; font-size: 11px; color: var(--ink-faint); }
.adv-detail[open] > summary { margin-bottom: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.adv-detail .group:first-of-type { padding-top: 16px; }
.adv-detail .group:last-of-type { border-bottom: none; padding-bottom: 4px; }

/* ---------- Mode tabs（商品バナー / セミナーアイキャッチ） ---------- */
.mode-tabs {
  display: flex; justify-content: center; gap: 0;
  max-width: 860px; margin: 20px auto 0; padding: 0 24px;
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 1;
}
.mode-tab {
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: .4px; color: var(--ink-faint);
  background: none; border: none; cursor: pointer;
  padding: 8px 18px 12px; position: relative;
  transition: color .15s;
}
.mode-tab:hover { color: var(--ink); }
.mode-tab.active { color: var(--ink); }
.mode-tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2.5px; background: var(--accent);
}

/* セミナーアイキャッチのギャラリーは横長のためカードをワイドに */
#sem-gallery .gen-card { width: min(620px, 100%); }
#sem-gallery .gen-card img { max-height: 320px; }

/* ---------- Wizard / stepper ---------- */
.stepper {
  display: flex; justify-content: center; gap: 0;
  max-width: 860px; margin: 22px auto 0; padding: 0 24px;
}
.stepper .step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer; padding: 6px 4px 14px;
  position: relative; color: var(--ink-faint); font-family: var(--sans);
  font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
}
.stepper .step i {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--line-strong); background: var(--panel); color: var(--ink-faint);
  transition: all .2s;
}
/* connector line */
.stepper .step::before {
  content: ""; position: absolute; top: 21px; left: -50%; width: 100%; height: 1.5px;
  background: var(--line-strong); z-index: 0;
}
.stepper .step:first-child::before { display: none; }
.stepper .step i { position: relative; z-index: 1; }
.stepper .step.done i { border-color: var(--accent); color: var(--accent); }
.stepper .step.done::before { background: var(--accent); }
.stepper .step.active i { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.stepper .step.active { color: var(--ink); }
@media (max-width: 560px) { .stepper .step span { font-size: 10.5px; } }

.wizard { max-width: 860px; margin: 0 auto; padding: 8px 24px 60px; position: relative; z-index: 1; }
.stage-lead {
  font-size: 13.5px; color: var(--ink); margin: 4px 0 18px; line-height: 1.7;
  padding: 12px 16px; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.stage-lead b { color: var(--accent-deep); }
.stage[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .stage:not([hidden]) { animation: stagein .45s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes stagein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
.stage .gen-block { border-top: none; padding-top: 0; margin-top: 0; }

.stage-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 26px; padding-top: 20px; border-top: 1.5px solid var(--ink);
}
.stage-nav .nav-right { display: flex; gap: 10px; }
@media (max-width: 560px) {
  .stage-nav { flex-direction: column-reverse; align-items: stretch; }
  .stage-nav .nav-right { flex-direction: column; }
  .stage-nav .btn { width: 100%; text-align: center; }
}

/* ---------- Load-in motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .topbar, .form > .group, .output > * {
    animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
  }
  .form > .group:nth-child(2) { animation-delay: .04s; }
  .form > .group:nth-child(3) { animation-delay: .08s; }
  .form > .group:nth-child(4) { animation-delay: .12s; }
  .form > .group:nth-child(5) { animation-delay: .16s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
