.product-wizard { padding:24px; z-index:1600; }
.product-wizard[hidden] { display:none; }
.wizard-shell { width:min(920px,100%); max-height:calc(100dvh - 48px); display:flex; flex-direction:column; background:var(--bg-surface); color:var(--text-primary); border:1px solid var(--border-default); border-radius:var(--radius-lg,16px); box-shadow:var(--shadow-lg); overflow:hidden; }
.wizard-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:24px 32px 16px; border-bottom:1px solid var(--border-subtle); }
.wizard-header h2 { font-size:24px; line-height:1.4; margin:4px 0; }
.wizard-eyebrow { font-size:12px; color:var(--text-secondary); margin:0; }
.wizard-steps { display:flex; gap:12px; list-style:none; padding:16px 32px; margin:0; background:var(--bg-subtle); }
.wizard-steps[hidden] { display:none; }
.wizard-steps li { flex:1; font-size:12px; color:var(--text-secondary); display:flex; gap:8px; align-items:center; }
.wizard-steps b { border:1px solid var(--border-default); width:28px; height:28px; display:grid; place-content:center; border-radius:50%; }
.wizard-steps [aria-current] { color:var(--text-primary); font-weight:700; }
.wizard-steps [aria-current] b { background:var(--accent-soft); border:2px solid var(--accent); }
#wizardLive:empty { display:none; }
#wizardLive { margin:0; padding:8px 32px; color:var(--text-secondary); font-size:13px; }
.wizard-body { overflow:auto; padding:24px 32px 32px; min-height:300px; overscroll-behavior:contain; animation:wizard-enter .2s ease-out; }
.wizard-body h3 { font-size:24px; line-height:1.45; margin:0 0 16px; }
.wizard-body p { color:var(--text-secondary); line-height:1.65; }
.wizard-field { display:grid; gap:8px; margin:20px 0; font-weight:600; }
.product-wizard input:not([type=file]), .product-wizard textarea, .product-wizard select { width:100%; min-width:0; min-height:44px; padding:10px 12px; border:1px solid var(--border-default); border-radius:var(--radius-sm,8px); background:var(--bg-surface); color:var(--text-primary); font:inherit; box-sizing:border-box; }
.product-wizard textarea { resize:vertical; }
.product-wizard button, .product-wizard summary { min-height:42px; min-width:42px; cursor:pointer; }
.product-wizard :focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.wizard-choices { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.wizard-choice { padding:12px 16px; border:1px solid var(--border-default); background:var(--bg-surface); color:var(--text-primary); border-radius:var(--radius-md,12px); font:inherit; text-align:left; }
.wizard-choice:hover { background:var(--bg-subtle); }
.wizard-choice[aria-pressed=true] { border:2px solid var(--accent); padding:11px 15px; background:var(--accent-soft); font-weight:700; }
.wizard-upload { display:grid; gap:16px; padding:32px 24px; border:2px dashed var(--border-default); border-radius:12px; background:var(--bg-subtle); }
.wizard-upload input { max-width:100%; min-height:44px; }
.wizard-images { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:12px; margin:16px 0; }
.wizard-images figure { margin:0; border:1px solid var(--border-default); border-radius:12px; padding:8px; }
.wizard-images img { width:100%; height:110px; object-fit:contain; }
.wizard-images button { font-size:12px; margin-top:4px; }
.wizard-presets { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.wizard-presets strong,.wizard-presets small { display:block; line-height:1.7; }
.wizard-presets small { font-weight:400; margin-top:12px; }
.wizard-estimate { margin:24px 0; padding:20px; background:var(--bg-subtle); border-radius:12px; display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.wizard-footer { padding:16px 32px; display:flex; justify-content:flex-end; gap:12px; flex-wrap:wrap; border-top:1px solid var(--border-default); }
.wizard-mosaic { position:relative; aspect-ratio:4/3; max-width:540px; margin:24px auto; background:var(--bg-subtle); border-radius:12px; overflow:hidden; }
.wizard-mosaic canvas,.wizard-mosaic img { position:absolute; width:100%; height:100%; object-fit:contain; inset:0; transition:opacity .22s ease; }
.wizard-mosaic canvas { opacity:0; }
.wizard-hero { display:block; max-width:100%; height:260px; object-fit:contain; margin:auto; }
.wizard-preview { margin-top:24px; border:1px solid var(--border-default); border-radius:12px; padding:24px; }
.wizard-preview section { padding:24px 8px; border-bottom:1px solid var(--border-subtle); }
.wizard-preview h4 { font-size:21px; line-height:1.5; overflow-wrap:anywhere; margin:12px 0; }
.wizard-preview--magazine h4 { font-size:28px; }
.wizard-preview--cards { display:grid; gap:16px; background:var(--bg-subtle); }
.wizard-preview--cards section { border:1px solid var(--border-default); background:var(--bg-surface); border-radius:12px; padding:20px; }
.wizard-block-label { font-size:12px; font-weight:600; color:var(--text-secondary); }
.product-wizard .wizard-error { color:var(--status-danger); }
@keyframes wizard-enter { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@media(max-width:600px) { .product-wizard { padding:8px; } .wizard-shell { max-height:calc(100dvh - 16px); } .wizard-header,.wizard-body { padding:20px 16px; } .wizard-header h2 { font-size:20px; } .wizard-steps { padding:12px 16px; gap:4px; } .wizard-steps li { flex-direction:column; font-size:10px; } .wizard-steps span { max-width:60px; text-align:center; } .wizard-presets { grid-template-columns:1fr; } .wizard-footer { padding:16px; } .wizard-footer .btn { flex:1; } .wizard-preview { padding:12px; } }
@media(prefers-reduced-motion:reduce) { .wizard-body { animation:none; } .wizard-mosaic canvas { transition:none; } }
/* 기존 범용 .btn의 전체 너비를 모달 도구/푸터에서는 사용하지 않는다. */
.product-wizard .btn { width:auto; margin-top:0; }
.wizard-header > div { flex:1; min-width:0; }
.wizard-header > button { flex:0 0 auto; }
.wizard-footer > button { flex:0 1 auto; }
@media(max-width:600px) { .wizard-footer > button { flex:1 1 110px; } }
/* 기획과 최종 편집 데이터의 좌표를 공유하는 실제 구성 미리보기. */
.wizard-plan { border:1px solid var(--border-default); border-radius:12px; padding:18px 22px; margin:20px 0; }
.wizard-plan summary { font-weight:700; }
.wizard-plan h4 { font-size:19px; line-height:1.6; margin:12px 0; }
.wizard-plan ol { display:grid; gap:14px; padding-left:24px; }
.wizard-plan li strong,.wizard-plan li span { display:block; }
.wizard-plan li span { font-size:13px; color:var(--text-secondary); margin-top:5px; }
.wizard-asset-actions { display:flex; flex-wrap:wrap; gap:8px; }
.wizard-asset-actions button { font-size:12px; }
.wizard-designed-preview { overflow:hidden; border:1px solid var(--border-default); border-radius:4px; margin:24px 0; background:var(--bg-surface); }
.wizard-designed-preview svg { display:block; max-width:100%; }

/* 업로드와 분석 전체 대기 구간을 명확하게 표시한다. */
.wizard-vision-progress { display:grid; grid-template-columns:24px 1fr; gap:8px 12px; padding:18px; margin-bottom:20px; border:1px solid var(--border-default); border-radius:12px; background:var(--bg-subtle); color:var(--text-primary); }
.wizard-vision-progress p,.wizard-vision-elapsed { grid-column:2; margin:0; color:var(--text-secondary); }
.wizard-vision-spinner { width:20px; height:20px; border:3px solid var(--border-default); border-top-color:var(--text-primary); border-radius:50%; animation:wizard-spin 1s linear infinite; }
@keyframes wizard-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .wizard-vision-spinner { animation:none; } }

.section-wizard-row{display:grid;grid-template-columns:auto 1fr auto;gap:12px;padding:18px;border-bottom:1px solid var(--border-default)}
.section-wizard-row small{grid-column:2/4}.section-wizard-card{padding:24px;margin-bottom:24px;border:1px solid var(--border-default);border-radius:16px}
.section-wizard-card pre{white-space:pre-wrap;max-height:240px;overflow:auto}.section-wizard-card textarea{display:block;width:100%;min-height:72px;margin:12px 0}
.section-wizard-thumbs{display:flex;gap:12px;flex-wrap:wrap}.section-wizard-thumbs img,.section-analysis-thumb{width:120px;height:120px;object-fit:contain}
.section-wizard-preview{max-width:540px;margin:auto}.section-wizard-status{min-height:32px}.section-wizard-status[aria-busy="true"]::before{content:"";width:20px;height:20px;border:3px solid var(--border-default);border-top-color:var(--accent);border-radius:50%;animation:section-spin 1s linear infinite;display:inline-block;margin-right:10px}@keyframes section-spin{to{transform:rotate(360deg)}}

.product-wizard .section-wizard-row input[type=checkbox]{width:20px;min-height:20px;height:20px;padding:0}.section-wizard-status{white-space:pre-line;padding:8px 32px}.section-wizard-row small{color:var(--text-secondary)}
@media(prefers-reduced-motion:reduce){.section-wizard-status[aria-busy="true"]::before{animation:none}}
