:root {
  --brand: #6257A8;
  --brand-d: #4B4190;
  --brand-l: #EEEBFA;
  --brand-ll: #F7F5FD;
  --ink: #221E33;
  --ink-2: #5A5570;
  --ink-3: #6F6A85; /* 흰 배경 대비 약 5:1 (웹 접근성 AA) */
  --line: #E4E1EE;
  --bg: #F6F5FA;
  --card: #FFFFFF;
  --pink: #F4D9E6;
  --yellow: #FFC94D;
  --lock: #FFF7E0;
  --lock-line: #F2D27A;
  --danger: #D9534F;
  --r: 14px;
  --shadow: 0 1px 2px rgba(34, 30, 51, .04), 0 6px 20px rgba(34, 30, 51, .06);
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* ---------- 상단 ---------- */
/* 로고 바 + 단계 메뉴를 함께 상단에 고정. --head-h 는 app.js가 실제 높이로 갱신 */
:root { --head-h: 140px; }
html { scroll-padding-top: calc(var(--head-h) + 12px); }
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: #f6f5fa;
  border-bottom: 1px solid var(--line);
}
.site-head.scrolled { box-shadow: 0 6px 18px rgba(34, 30, 51, .08); }
.head-row1 {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.topbar { display: contents; }
.brand { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.brand .logo { height: 40px; width: auto; display: block; }
.brand .tag { color: #8f79df; font-size: 12px; font-weight: 800; letter-spacing: .15em; white-space: nowrap; }
.menu-toggle { display: none; }
.top-actions { display: contents; }
.top-actions hr { display: none; }
.site-footer { text-align: center; padding: 36px 16px 44px; border-top: 1px solid var(--line); }
.site-footer img { max-width: 150px; width: 100%; height: auto; }
.site-footer p { margin: 12px 0 0; font-size: 12px; color: var(--ink-3); }
.site-footer a { color: var(--ink-3); }
.site-footer .legal-links { font-size: 13px; }
.site-footer .legal-links a { color: var(--ink-2); margin: 0 2px; }
.biz-info { margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.biz-info summary { cursor: pointer; display: inline-block; }
.biz-info p { margin: 8px 0 0; line-height: 1.7; }

/* ---------- 버튼 ---------- */
.btn {
  border: 1px solid var(--line); background: #fff;
  padding: 10px 18px; border-radius: 999px; font-weight: 600;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); color: #fff; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.top-actions .btn.ghost { white-space: nowrap; }
@media (max-width: 380px) {
  .brand .logo { height: 26px; }
  .top-actions .btn.ghost { padding: 6px 5px; font-size: 12.5px; }
}
.btn.ghost { border-color: transparent; background: transparent; padding: 8px 12px; font-size: 14px; color: var(--ink-2); }
.btn.ghost:hover { background: var(--brand-l); color: var(--brand); }
.btn.ghost.menu-danger { color: #c43d3d; }
.btn.ghost.menu-danger:hover { background: #fdeaea; color: #a32d2d; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn { border: 0; background: transparent; color: var(--ink-3); padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: #f1eff6; color: var(--danger); }
.link { border: 0; background: none; color: var(--brand); font-weight: 600; padding: 0; text-decoration: underline; }

/* ---------- 스테퍼 ---------- */
.stepper {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 10px 24px; max-width: 1240px; margin: 0 auto;
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.stepper button {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: flex-start;
  border: 0; background: transparent; padding: 8px 12px 10px; border-radius: 10px;
  border-bottom: 3px solid var(--line); text-align: left; min-width: 96px;
}
.stepper b { font-size: 11px; color: var(--ink-3); letter-spacing: .08em; }
.stepper span { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.stepper button:hover { background: #fff; }
.stepper .done { border-bottom-color: #B7B0E2; }
.stepper .cur { border-bottom-color: var(--brand); background: #fff; }
.stepper .cur b, .stepper .cur span { color: var(--brand); }

/* ---------- 레이아웃 ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px;
  max-width: 1240px; margin: 0 auto; padding: 0 24px 64px;
}
aside { position: sticky; top: calc(var(--head-h) + 16px); align-self: start; }
.layout { padding-top: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* ---------- 단계 ---------- */
.step { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px 36px; }
.step-head .no { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--brand); background: var(--brand-l); padding: 4px 10px; border-radius: 999px; }
.step-head h1 { font-size: 28px; margin: 12px 0 2px; letter-spacing: -.01em; }
.step-head .q { font-size: 17px; color: var(--ink-2); margin: 0; }
.step-head .desc { color: var(--ink-3); margin: 6px 0 0; }
.step.is-lock .step-head .no { background: var(--lock); color: #9A6B00; }

.tip { margin-top: 20px; padding: 12px 16px; background: var(--brand-ll); border: 1px dashed #CFC9EE; border-radius: 12px; color: var(--ink-2); font-size: 14px; }
.tip b { color: var(--brand); margin-right: 4px; }

.fields { margin-top: 24px; display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field.compact { gap: 6px; }
.label { font-weight: 700; font-size: 15px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.label small { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.label.sub { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.section-title { display: flex; align-items: baseline; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); margin-bottom: -6px; }
.section-title h3 { margin: 0; font-size: 13px; letter-spacing: .1em; color: var(--brand); }
.section-title span { color: var(--ink-3); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.field-text { display: flex; flex-direction: column; gap: 6px; }
.field-text .label { font-size: 14px; }

input[type=text], textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input[type=text]:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
::placeholder { color: #B5B1C4; }

/* ---------- 칩 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: all .12s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.custom { border-style: dashed; color: var(--ink-2); }
.chip.custom.on { background: var(--brand-l); color: var(--brand); border-color: var(--brand); border-style: solid; }
.chip.big { padding: 14px 20px; font-size: 15px; border-radius: 14px; }
.chip.big .ico { font-size: 20px; }
.chip.mini { padding: 4px 10px; font-size: 12px; background: var(--brand-ll); }
.rec {
  font-style: normal; font-size: 10px; font-weight: 700; line-height: 1;
  padding: 3px 6px; border-radius: 6px; background: #FFE9A8; color: #8A6100;
}
.chip.on .rec { background: rgba(255, 255, 255, .25); color: #fff; }
.custom-input { max-width: 640px; }
.field-desc { margin: -4px 0 2px; font-size: 13px; color: var(--ink-3); }
.scope-note { padding: 12px 16px; border-radius: 12px; background: #F4F7FF; border: 1px solid #D6E0F7; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.scope-note b { color: var(--ink); }
.app-head .t small.gets { color: var(--brand); font-weight: 600; margin-top: 2px; }
.gets-line { margin: -6px 0 10px; }
.pb-bridge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: #FFF8EC; border: 1px dashed #F2C94C; font-size: 13px; color: var(--ink-2); }
.pb-bridge span { flex: 1 1 260px; }
.pb-bridge .btn { flex: none; }
.brief-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--brand-ll); border: 1px solid #DDD5F7; }
.brief-head .ico { font-size: 26px; }
.brief-head div { flex: 1; display: flex; flex-direction: column; }
.brief-head b { font-size: 15px; color: var(--brand); }
.brief-head span:not(.ico) { font-size: 13px; color: var(--ink-2); }
.brief-head.none { background: #FFFBEF; border-color: var(--lock-line); }
.brief-head.none b { color: #9A6B00; }

/* ---------- 실루엣 (형태 언어) ---------- */
.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.shape-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 10px 12px; text-align: center; transition: all .12s;
}
.shape-card .shape-icon { font-size: 40px; line-height: 1; color: var(--brand); }
.shape-card b { font-size: 14px; }
.shape-card small { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.shape-card:hover { border-color: var(--brand); }
.shape-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); background: var(--brand-ll); }
.shape-card.ai-pick:not(.on)::after { content: '✨'; position: absolute; top: 8px; right: 10px; font-size: 12px; }
.shape-card.custom .shape-icon { color: var(--ink-3); }

/* ---------- 컬러 추천 · 배색 ---------- */
.color-advice { background: var(--brand-ll); border: 1px solid #DDD5F7; border-radius: 16px; padding: 18px 20px; }
.advice-list, .harmony { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.advice, .harm { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px; text-align: left; transition: all .12s; }
.advice:hover, .harm:hover { border-color: var(--brand); transform: translateY(-1px); }
.advice i { width: 38px; height: 38px; border-radius: 10px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.advice span { display: flex; flex-direction: column; line-height: 1.35; }
.advice small { color: var(--ink-2); font-size: 12px; }
.advice em { font-style: normal; color: var(--brand); font-size: 11px; font-weight: 700; }
.harm { flex-direction: column; align-items: flex-start; gap: 4px; }
.harm .sw { display: flex; width: 100%; height: 26px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.harm .sw i { flex: 1; }
.harm .sw i:first-child { flex: 1.6; }
.harm small { color: var(--ink-3); font-size: 12px; }

/* ---------- 디자인 기획서 ---------- */
.rationale { border-color: #D9D3F3; background: linear-gradient(160deg, #FBFAFF, #fff 60%); }
.rationale dl, .bb-box.why dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rationale dl div, .bb-box.why dl div { display: grid; grid-template-columns: 88px 1fr; gap: 12px; }
.rationale dt { font-weight: 700; color: var(--brand); font-size: 13px; padding-top: 2px; }
.rationale dd { margin: 0; font-size: 14px; line-height: 1.6; }
.bb-box ul.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3mm 6mm; }
.bb-msg { font-size: 20px; font-weight: 700; line-height: 1.45; padding: 5mm 6mm; border-radius: 4mm; background: var(--ink); color: #fff; }
.bb-msg small { display: block; font-size: 10px; letter-spacing: .2em; color: #B9B2E8; margin-bottom: 1.5mm; }
.bb-box.why { background: var(--brand-ll); border-color: #DDD5F7; }
.bb-box.why dl { gap: 3mm; }
.bb-box.why dl div { grid-template-columns: 18mm 1fr; gap: 3mm; }
.bb-box.why dt { font-weight: 700; color: var(--brand); font-size: 11px; }
.bb-box.why dd { margin: 0; font-size: 12.5px; line-height: 1.6; }

/* ---------- AI 추천 ---------- */
.ai-all {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-radius: 16px;
  background: linear-gradient(120deg, #F3F0FF, #FDEFF6);
  border: 1px solid #DDD5F7;
}
.ai-all b { font-size: 15px; }
.ai-all p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.ai-all em { font-style: normal; font-weight: 700; color: var(--brand); }
.ai-all-btn { flex: none; background: linear-gradient(120deg, var(--brand), #B05FC0); border: 0; color: #fff; }
.ai-all-btn:hover { color: #fff; filter: brightness(1.08); }
.ai-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
  font-size: 13px; padding: 7px 10px; border-radius: 10px;
  background: #F6F3FF; border: 1px dashed #D6CEF5;
}
.ai-line.none { background: transparent; color: var(--ink-3); }
.ai-tag { font-size: 11px; font-weight: 800; color: #8a5cc7; white-space: nowrap; }
.ai-line b { color: var(--ink); }
.ai-line .why { color: var(--ink-3); flex: 1 1 160px; }
.ai-btn { border: 0; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.ai-btn:hover { background: var(--brand-d); }
.ai-done { font-size: 12px; font-weight: 700; color: #3c9a6b; white-space: nowrap; }
.chip.ai-pick:not(.on) { border-color: #C9BDF1; background: #FBFAFF; }
.chip.ai-pick:not(.on)::after { content: '✨'; font-size: 11px; }
.grid .field-text .ai-line { font-size: 12px; }

/* ---------- 스타일 카드 ---------- */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.style-card {
  position: relative; border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 8px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; transition: all .12s;
}
.style-card .thumb { width: 100%; aspect-ratio: 1; border-radius: 10px; background: var(--brand-ll); overflow: hidden; display: grid; place-items: center; }
.style-card .thumb svg { width: 100%; height: 100%; display: block; }
.style-card .thumb.plus { font-size: 30px; color: var(--ink-3); border: 1px dashed var(--line); background: #fff; }
.style-card:hover { border-color: var(--brand); }
.style-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); color: var(--brand); }
.style-card.ai-pick:not(.on)::after { content: '✨'; position: absolute; top: 10px; right: 12px; font-size: 13px; }

/* ---------- 컬러 ---------- */
.colors { display: flex; flex-direction: column; gap: 8px; }
.color-row { display: grid; grid-template-columns: 90px 44px 110px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.color-row .label { font-size: 14px; font-weight: 600; }
.color-row input[type=color] { width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.color-row .hex { font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; }
.preset { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 12px; font-weight: 600; }
.preset i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; margin-right: -6px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.preset span { margin-left: 10px; }
.preset:hover { border-color: var(--brand); }

/* ---------- 고정 특징 ---------- */
.lock-box, .id-box { background: var(--lock); border: 1px solid var(--lock-line); border-radius: 16px; padding: 20px; }
.id-box { background: var(--brand-ll); border-color: #D9D3F3; }
.lock-input { display: flex; gap: 8px; }
.lock-input input { flex: 1; }
.locks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.locks li { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--lock-line); border-radius: 10px; padding: 8px 8px 8px 14px; font-weight: 500; }
.locks.auto li { gap: 10px; justify-content: flex-start; padding: 6px 6px 6px 12px; transition: all .12s; }
.locks .grp { flex: none; font-size: 11px; font-weight: 700; color: #9A6B00; background: var(--lock); border-radius: 6px; padding: 2px 7px; }
.locks .txt { flex: 1; }
.lock-toggle { flex: none; border: 1px solid var(--lock-line); background: var(--lock); color: #7a5600; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.lock-toggle:hover { filter: brightness(.97); }
.locks.auto li.off { background: #FAFAFC; border-color: var(--line); border-style: dashed; color: var(--ink-3); }
.locks.auto li.off .grp { background: #EFEFF4; color: var(--ink-3); }
.locks.auto li.off .lock-toggle { background: #fff; border-color: var(--line); color: var(--ink-3); }
.fields > .lock-box + .lock-box { margin-top: -8px; }
.empty { color: var(--ink-3); font-size: 14px; margin: 4px 0; }
.suggest { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.id-auto p { margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; font-size: 16px; font-weight: 600; }
.id-auto b { font-size: 11px; color: var(--brand); background: #fff; border: 1px solid #D9D3F3; border-radius: 6px; padding: 1px 6px; flex: none; }

/* ---------- 활용 방향 ---------- */
.apps { display: flex; flex-direction: column; gap: 10px; }
.app-card { border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.app-card.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.app-head { width: 100%; display: flex; align-items: center; gap: 14px; border: 0; background: transparent; padding: 14px 18px; text-align: left; }
.app-head .ico { font-size: 26px; }
.app-head .t { flex: 1; display: flex; flex-direction: column; }
.app-head .t b { display: flex; align-items: center; gap: 8px; }
.app-head .t small { color: var(--ink-3); }
.app-head .check { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-3); font-weight: 700; }
.app-card.on .check { background: var(--brand); border-color: var(--brand); color: #fff; }
.app-card.on .app-head { background: var(--brand-ll); }
.app-body { padding: 18px; display: flex; flex-direction: column; gap: 18px; border-top: 1px solid var(--line); }

/* ---------- 단계 이동 ---------- */
.step-nav { display: flex; justify-content: space-between; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.step-nav .btn { min-width: 120px; }

/* ---------- 사이드 카드 ---------- */
.char-card { padding: 20px; text-align: center; }
.char-thumb { position: relative; width: 140px; height: 140px; margin: 0 auto; border-radius: 50%; background: var(--brand-ll); overflow: hidden; }
.thumb-cap { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--ink-2); background: rgba(255,255,255,.85); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.char-thumb svg { width: 100%; height: 100%; display: block; }
.char-thumb.big { width: 160px; height: 160px; flex: none; border-radius: 20px; }
.char-card h2 { margin: 12px 0 0; font-size: 20px; }
.char-card .type { margin: 0; color: var(--ink-3); font-size: 13px; }
.badge { display: inline-block; margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-l); border-radius: 999px; padding: 3px 10px; }
.char-card blockquote { margin: 14px 0 0; padding: 12px; background: var(--bg); border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: left; }
.swatches { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.swatches i { width: 28px; height: 28px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.side-locks { text-align: left; margin-top: 14px; font-size: 13px; background: var(--lock); border-radius: 12px; padding: 10px 12px; }
.side-locks ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.progress { height: 6px; background: var(--bg); border-radius: 999px; margin-top: 16px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s; }
.char-card .progress + p { margin: 6px 0 0; }

/* ---------- 결과 ---------- */
.result { display: flex; flex-direction: column; gap: 18px; }
.result .step-head { margin-bottom: 4px; }
.lang-toggle { display: inline-flex; margin-top: 16px; background: var(--bg); border-radius: 999px; padding: 4px; }
.lang-toggle button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.lang-toggle button small { font-size: 11px; color: var(--brand); }
.lang-toggle .on { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.char-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tool-pick { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.tool-pick .chip { padding: 6px 12px; font-size: 13px; }
.tool-pick p { margin: 0; }
.warn { color: #B4561B; }

/* 번역 확인 */
.tr-panel { padding: 16px 20px; box-shadow: none; border-color: #D9D3F3; background: var(--brand-ll); }
.tr-panel summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.tr-panel summary em { font-style: normal; font-size: 12px; font-weight: 700; color: #B4561B; background: #FFF1E3; border-radius: 999px; padding: 2px 10px; margin-left: 6px; }
.tr-panel summary .ok { font-size: 12px; color: #3c9a6b; margin-left: 6px; }
.tr-panel > p { margin: 10px 0; }
.tr-list { display: flex; flex-direction: column; gap: 8px; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 100px; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.tr-ko { font-size: 14px; font-weight: 600; }
.tr-row input { padding: 8px 10px; }
.tr-badge { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 8px; text-align: center; }
.tr-badge.ok { background: #E3F5EA; color: #2F7F55; }
.tr-badge.auto { background: var(--brand-l); color: var(--brand); }
.tr-badge.warn { background: #FFF1E3; color: #B4561B; }

/* 기준 이미지 */
.ref-card { border-color: #D9D3F3; }
.ref-wrap { display: flex; gap: 20px; align-items: flex-start; }
.ref-img { flex: none; width: 200px; }
.ref-img img { width: 100%; border-radius: 14px; display: block; border: 1px solid var(--line); }
.ref-btns { display: flex; gap: 6px; margin-top: 8px; }
.ref-drop { width: 100%; aspect-ratio: 3 / 4; border: 2px dashed #CFC9EE; background: var(--brand-ll); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-2); }
.ref-drop b { font-size: 30px; color: var(--brand); }
.ref-drop span { font-weight: 700; }
.ref-drop small { color: var(--ink-3); text-align: center; }
.ref-drop:hover { border-color: var(--brand); }
.ref-guide { flex: 1; font-size: 14px; display: flex; flex-direction: column; gap: 10px; }
.ref-guide ol { margin: 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.ref-guide p { margin: 0; }

.out { padding: 20px 22px; box-shadow: none; }
/* ① 프로필 접기 */
details.profile > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; }
details.profile > summary::-webkit-details-marker { display: none; }
details.profile > summary h2 { margin: 0; font-size: 15px; letter-spacing: .04em; color: var(--brand); }
details.profile > summary h2::before { content: '▸ '; }
details.profile[open] > summary h2::before { content: '▾ '; }
details.profile > summary p { margin: 0; color: var(--ink-3); font-size: 13px; grid-column: 1 / -1; grid-row: 2; }
details.profile[open] > summary { margin-bottom: 12px; }
/* ★ 핵심 특징 */
.core-box { background: #FFF4D6; border: 1px solid #F2C94C; border-radius: 16px; padding: 18px 20px; }
.core-chip small { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.core-chip.on { background: #F2A900; border-color: #F2A900; color: #2b2000; }
.core-chip.on small { color: #5a4300; }
/* 카드 제목: [제목 · 버튼] 윗줄, [설명] 아랫줄 — 좁은 화면에서도 글자가 세로로 깨지지 않게 */
.out > header, .sub-out > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; margin-bottom: 12px; }
.out > header h2 { margin: 0; font-size: 15px; letter-spacing: .04em; color: var(--brand); }
.out > header p { margin: 0; color: var(--ink-3); font-size: 13px; grid-column: 1 / -1; grid-row: 2; }
.out > header .btn, details.profile > summary .btn { grid-column: 2; grid-row: 1; justify-self: end; white-space: nowrap; }
.out pre, .sub-out pre {
  margin: 0; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere;
  font-family: ui-monospace, 'D2Coding', Consolas, monospace; font-size: 13px; line-height: 1.65;
  background: var(--bg); border-radius: 12px; padding: 16px; max-height: 420px; overflow: auto;
}
.identity { background: var(--lock); border-color: var(--lock-line); }
.identity pre { background: #fff; }
.profile-wrap { display: flex; gap: 20px; align-items: flex-start; }
.profile table { border-collapse: collapse; width: 100%; font-size: 14px; }
.profile th { text-align: left; color: var(--ink-3); font-weight: 600; width: 120px; padding: 7px 10px 7px 0; vertical-align: top; white-space: nowrap; }
.profile td { padding: 7px 0; border-bottom: 1px solid var(--bg); }
.app-group + .app-group { margin-top: 22px; }
.app-group h3 { margin: 0 0 10px; font-size: 16px; }
.sub-out + .sub-out { margin-top: 14px; }
.sub-out header b { font-size: 14px; }
.sub-out header .btn { grid-column: 2; grid-row: 1; justify-self: end; white-space: nowrap; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.result-actions .danger { margin-left: auto; }
.save-box > header h2 { color: var(--ink); letter-spacing: 0; font-size: 17px; }
.save-box > p { margin: 0; }
/* 갤러리 자랑하기 — 제품 디자인 메이커와 같은 강조 상자 */
.gallery-cta { margin-top: 16px; padding: 20px; border-radius: 16px; text-align: center; background: linear-gradient(135deg, #F3F0FF, #FDEFF6); border: 1px solid #DDD5F7; }
.gallery-cta p { margin: 0 0 12px; font-weight: 600; }
.gallery-cta .btn.big { display: inline-flex; padding: 13px 28px; font-size: 16px; color: #fff; }

/* ---------- 캐릭터 바이블 ---------- */
body.bible-open { overflow: hidden; }
#bible {
  position: fixed; inset: 0; z-index: 40; overflow: auto;
  background: rgba(34, 30, 51, .55); backdrop-filter: blur(3px);
  padding: 0 16px 40px;
}
.bible-toolbar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 210mm; margin: 0 auto 20px; padding: 14px 18px; background: #fff; border-radius: 0 0 16px 16px; box-shadow: var(--shadow);
}
.bible-toolbar b { margin-right: auto; }
.bible-toolbar .muted { flex-basis: 100%; order: 3; margin-top: -6px; }
.bible-sheet {
  width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto 20px;
  background: #fff; color: var(--ink); padding: 13mm 14mm 10mm;
  display: flex; flex-direction: column; gap: 5mm;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.bb-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 3mm; }
.bb-head img { height: 30px; }
.bb-head div { text-align: right; display: flex; flex-direction: column; }
.bb-head span { font-weight: 800; letter-spacing: .18em; font-size: 13px; color: var(--brand); }
.bb-head small { color: var(--ink-3); font-size: 11px; }
.bb-hero { display: flex; gap: 7mm; align-items: flex-start; }
.bb-img { flex: none; width: 62mm; aspect-ratio: 3 / 4; border-radius: 6mm; overflow: hidden; background: var(--brand-ll); display: grid; place-items: center; }
.bb-img img { width: 100%; height: 100%; object-fit: cover; }
.bb-img svg { width: 90%; }
.bb-title { flex: 1; min-width: 0; }
.bb-title h1 { margin: 0; font-size: 34px; line-height: 1.15; letter-spacing: -.01em; }
.bb-title h1 small { display: block; font-size: 14px; font-weight: 600; color: var(--ink-3); letter-spacing: .08em; margin-top: 2px; }
.bb-id { margin: 4mm 0; padding: 3.5mm 4mm; background: var(--brand-ll); border-left: 4px solid var(--brand); border-radius: 0 3mm 3mm 0; font-size: 15px; font-weight: 600; line-height: 1.5; }
.bb-prof { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bb-prof th { text-align: left; color: var(--ink-3); font-weight: 600; width: 22mm; padding: 1.4mm 0; vertical-align: top; white-space: nowrap; }
.bb-prof td { padding: 1.4mm 0; border-bottom: 1px solid #eee; }
.bb-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.bb-sw { display: flex; align-items: center; gap: 3mm; border: 1px solid var(--line); border-radius: 3mm; padding: 2.5mm; }
.bb-sw i { width: 14mm; height: 14mm; border-radius: 2.5mm; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.bb-sw span { display: flex; flex-direction: column; font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 700; }
.bb-sw b { font-family: 'Pretendard', sans-serif; font-size: 10px; letter-spacing: .12em; color: var(--ink-3); }
.bb-sw small { font-family: 'Pretendard', sans-serif; font-weight: 500; font-size: 11px; color: var(--ink-2); }
.bb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.bb-col { display: flex; flex-direction: column; gap: 4mm; }
.bb-box { border-radius: 3mm; padding: 3.5mm 4mm; border: 1px solid var(--line); }
.bb-box h2 { margin: 0 0 2mm; font-size: 13px; }
.bb-box ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1.3mm; font-size: 12px; }
.bb-box li b { display: inline-block; min-width: 15mm; color: var(--ink-3); font-weight: 600; font-size: 11px; margin-right: 2mm; }
.bb-box.lock { background: var(--lock); border-color: var(--lock-line); }
.bb-box.lock li b { color: #9A6B00; }
.bb-box.do ul, .bb-box.dont ul { list-style: disc; padding-left: 4.5mm; }
.bb-box.do { background: #F1FAF4; border-color: #CDEBD8; }
.bb-box.dont { background: #FFF4F2; border-color: #F6D3CC; }
.bb-tags { display: flex; flex-direction: column; gap: 2mm; font-size: 12px; }
.bb-tags div { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5mm; }
.bb-tags b { min-width: 20mm; color: var(--ink-3); font-weight: 600; }
.bb-tags span { background: var(--bg); border-radius: 999px; padding: .8mm 3mm; }
.bb-foot { margin-top: auto; padding-top: 3mm; border-top: 1px solid var(--line); text-align: center; font-size: 10px; letter-spacing: .14em; color: var(--ink-3); }
.bb-prompt h2 { margin: 0 0 2mm; font-size: 12px; letter-spacing: .1em; color: var(--brand); }
.bb-prompt pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 9.5px; line-height: 1.5; background: var(--bg); border-radius: 3mm; padding: 3mm 3.5mm; }
.bb-note { margin: 0; font-size: 11.5px; color: var(--ink-2); background: var(--brand-ll); border-radius: 3mm; padding: 3mm 4mm; }

@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  body.bible-open > *:not(#bible) { display: none !important; }
  #bible { position: static; inset: auto; overflow: visible; background: none; backdrop-filter: none; padding: 0; }
  .bible-toolbar { display: none; }
  /* 내용이 길면 잘리지 않고 다음 장으로 이어짐 */
  .bible-sheet { width: 210mm; max-width: none; min-height: 296mm; margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .bb-box, .bb-prompt, .bb-colors, .bb-hero { break-inside: avoid; }
  .bible-sheet:last-child { break-after: auto; page-break-after: auto; }
}
@media (max-width: 640px) {
  .bible-sheet { padding: 18px 16px; min-height: 0; }
  .bb-hero { flex-direction: column; }
  .bb-img { width: 60%; }
  .bb-grid, .bb-colors { grid-template-columns: 1fr; }
}

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 반응형 ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  aside { position: static; order: -1; }
  .char-card { display: grid; grid-template-columns: 90px 1fr; gap: 0 16px; text-align: left; align-items: center; }
  .char-card .char-thumb { width: 90px; height: 90px; grid-row: span 3; }
  .char-card h2 { margin: 0; }
  .char-card blockquote, .char-card .swatches, .char-card .side-locks, .char-card .progress, .char-card .progress + p { grid-column: 1 / -1; }
  .char-card .swatches { justify-content: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .head-row1 { padding: 10px 16px; }
  .brand .logo { height: 32px; }
  .brand .tag { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); border: 0; cursor: pointer; padding: 0; }
  .menu-toggle:hover { background: var(--brand-d); }
  .top-actions { display: none; flex-direction: column; position: absolute; top: 100%; right: 16px; margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(34,30,51,.14); padding: 8px; min-width: 190px; z-index: 50; }
  .top-actions.open { display: flex; }
  .top-actions .btn.ghost { padding: 10px 12px; font-size: 13.5px; white-space: nowrap; text-align: left; border-radius: 9px; }
  .top-actions hr { display: block; border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
  .stepper { padding: 10px 16px; }
  .layout { padding: 12px 16px 48px; gap: 16px; }
  .stepper { padding: 8px 16px; }
  .stepper button { min-width: 84px; padding: 6px 10px 8px; }
  .step { padding: 22px 18px; border-radius: 16px; }
  .step-head h1 { font-size: 23px; }
  .color-row { grid-template-columns: 70px 40px 1fr auto; }
  .color-row input[data-act=color-name] { grid-column: 2 / -1; }
  .profile-wrap { flex-direction: column; }
  .ai-all { flex-direction: column; align-items: stretch; }
  .rationale dl div { grid-template-columns: 1fr; gap: 2px; }
  .shape-grid { grid-template-columns: repeat(2, 1fr); }
  .ref-wrap { flex-direction: column; }
  .ref-img { width: 100%; max-width: 240px; }
  .tr-row { grid-template-columns: 1fr auto; }
  .tr-row input { grid-column: 1 / -1; grid-row: 2; }
  .char-card { padding: 14px; grid-template-columns: 64px 1fr; }
  .char-card .char-thumb { width: 64px; height: 64px; }
  .char-card h2 { font-size: 17px; }
  .char-card blockquote { margin-top: 10px; padding: 8px 10px; font-size: 13px; }
  .char-card .side-locks, .char-card .swatches { display: none; }
  .result-actions .btn { flex: 1 1 45%; word-break: keep-all; }
  .result-actions .danger { margin-left: 0; }
}

/* ---------- 결과: 빈 항목 안내 · 바로가기 ---------- */
.missing-box { margin: 0 0 16px; padding: 14px 16px; border-radius: 12px; background: #FFF8EC; border: 1px solid #F2D27A; }
.missing-box b { color: #7a5600; }
.missing-box p { margin: 4px 0 10px; font-size: 14px; color: var(--ink-2); }
.miss-links { display: flex; flex-wrap: wrap; gap: 8px; }
.result-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.result-toc a { padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.result-toc a:hover { border-color: var(--brand); color: var(--brand); }

/* 휴대폰: 작은 버튼도 손가락으로 누르기 쉬운 크기로 */
@media (max-width: 640px) {
  .lock-toggle, .icon-btn { min-height: 40px; min-width: 40px; }
  .lock-toggle { padding: 8px 14px; }
  .result-toc { position: sticky; top: calc(var(--head-h) + 6px); z-index: 5; flex-wrap: nowrap; overflow-x: auto; padding: 6px 0; background: var(--bg); scrollbar-width: none; }
  .result-toc a { flex: none; }
  .result .card[id] { scroll-margin-top: 60px; } /* html의 scroll-padding(머리말 높이)에 바로가기 줄 높이만 더함 */
  .preset { min-height: 36px; }
}

/* ---------- 결과: 영상 사용 안내 ---------- */
.video-guide { margin: 0 0 12px; padding: 14px 16px; border-radius: 12px; background: var(--brand-ll); border: 1px solid #DCD3F7; font-size: 14px; color: var(--ink-2); line-height: 1.65; }
.video-guide > b { color: var(--ink); }
.video-guide ul, .video-guide ol { margin: 8px 0 0; padding-left: 20px; }
.video-guide li { margin: 4px 0; }
.video-guide li b { color: var(--ink); }
.video-guide ol { border-top: 1px dashed #DCD3F7; padding-top: 8px; }
.video-guide small { color: var(--ink-3); font-size: 13px; }
.sub-out .where { display: inline-block; margin-left: 8px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-l); border-radius: 999px; padding: 2px 9px; vertical-align: 1px; }

/* ---------- 결과: 작품 제목 추천 ---------- */
.title-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.title-card { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; transition: border-color .15s, background .15s; }
.title-card:hover { border-color: var(--brand); }
.title-card small { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.title-card b { font-size: 15px; line-height: 1.45; word-break: keep-all; }
.title-card.on { border-color: var(--brand); background: var(--brand-ll); box-shadow: 0 0 0 3px var(--brand-l); }
.title-card.on b { color: var(--brand-d); }
.title-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 6px; }
.title-edit { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; }
.title-edit span { flex: none; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.title-edit input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
@media (max-width: 640px) {
  .title-cards { grid-template-columns: 1fr; }
}
