/* 마법사 화면 스타일 — 시안(design/project/Main.dc.html) 기준, 시스템 폰트만 사용 */
:root {
  --accent: #1B64DA; --accent-dark: #124A9F; --accent-soft: #EEF4FE; --accent-light: #C9D7F2;
  --text: #16181D; --sub: #5B6270; --line: #E3E6EA; --soft: #F6F8FA; --disabled: #B9C9E8;
  --warn-bg: #FFF4E5; --warn: #8A4B00; --err-bg: #FDECEC; --err: #A12020;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--soft); color: var(--text); font-size: 16px; line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1:focus, h2:focus { outline: none; }  /* 화면이 바뀔 때 읽기 위치를 옮기려고 준 포커스라 테두리는 숨긴다 */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #fff; }
@media (min-width: 600px) { .app { box-shadow: 0 0 0 1px var(--line); } }

/* 상단 진행바 */
.top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 8px 8px; position: sticky; top: 0; background: #fff; z-index: 1; }
.back { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.back:hover { background: var(--soft); }
.bar { flex: 1; height: 6px; background: #EEF1F4; border-radius: 3px; overflow: hidden; }
#fill { height: 6px; background: var(--accent); border-radius: 3px; width: 0; transition: width .25s; }
.steplabel { font-size: 14px; color: var(--sub); min-width: 40px; text-align: right; }

main { flex: 1; padding: 8px 24px 32px; outline: none; }
.screen { display: flex; flex-direction: column; gap: 24px; padding-top: 12px; }
h1 { margin: 0; font-size: 28px; line-height: 1.4; font-weight: 800; }
h2 { margin: 0; font-size: 26px; line-height: 1.4; font-weight: 800; }
h3 { margin: 0; font-size: 16px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--sub); font-size: 15px; }
.small { font-size: 14px; color: var(--sub); }
.eyebrow { font-size: 15px; font-weight: 700; color: var(--accent); }

/* 홈 */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.box { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--soft); border-radius: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check svg { flex-shrink: 0; margin-top: 3px; }

/* 고르기 버튼 */
.list { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px;
  padding: 14px 18px; text-align: left; border-radius: 14px; border: 1.5px solid var(--line); background: #fff;
}
.choice:hover { border-color: var(--accent-light); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.choice .t { display: flex; flex-direction: column; gap: 4px; }
.choice .name { font-size: 17px; font-weight: 700; }
.choice .desc { font-size: 15px; color: var(--sub); line-height: 1.5; }
.choice .data { font-size: 14px; color: var(--sub); }
.choice .mark { flex-shrink: 0; visibility: hidden; }
.choice[aria-pressed="true"] .mark { visibility: visible; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.region { min-height: 52px; padding: 12px; border-radius: 12px; font-size: 16px; font-weight: 600; border: 1.5px solid var(--line); background: #fff; }
.region:hover { border-color: var(--accent-light); }
.region[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }

/* 분석 중 */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps li svg { flex-shrink: 0; }
.steps .st { display: flex; flex-direction: column; gap: 2px; }
.steps .st b { font-size: 16px; font-weight: 600; }
.steps .st span { font-size: 14px; color: var(--sub); word-break: keep-all; overflow-wrap: anywhere; }
.steps li.wait b { color: #8A919C; }
.spin { animation: spin 1s linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } #fill { transition: none; } }

/* 결과 */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); }
.card.soft { background: var(--soft); border-color: var(--soft); }
.summary { font-size: 17px; line-height: 1.7; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); }
.kpi span { font-size: 14px; color: var(--sub); line-height: 1.4; }
.kpi b { font-size: 20px; font-weight: 800; line-height: 1.3; word-break: keep-all; }
.chart text { font-size: 14px; fill: var(--sub); }
.chart text.val { fill: var(--text); font-weight: 700; }
.chart rect { fill: var(--accent-light); }
.chart rect.hi { fill: var(--accent); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks li > b { flex-shrink: 0; width: 24px; height: 24px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; }
.checks .ok { background: var(--accent); } .checks .warn { background: #C2410C; } .checks .info { background: #8A919C; }
.checks li > span { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.checks li > span > span { color: var(--sub); }
.bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.items li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.items li:first-child { border-top: 0; padding-top: 0; }
.items b { font-size: 15px; }
.items span { font-size: 14px; color: var(--sub); overflow-wrap: anywhere; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.basis { font-size: 15px; line-height: 1.5; padding: 12px 14px; border-radius: 12px; background: var(--soft); }
details.card { padding-top: 8px; padding-bottom: 8px; }
details summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.link-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; text-align: left; }
.link-row:hover { border-color: var(--accent-light); }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #D9DDE3; font-size: 16px; }
.ask-row input:focus { border-color: var(--accent); outline: none; }
.icon-btn { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; border: 0; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.sub-btn { min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 16px; font-weight: 600; }
.sub-btn:hover { border-color: var(--accent-light); }
.note { font-size: 15px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); }
.error { font-size: 15px; padding: 14px 16px; border-radius: 12px; background: var(--err-bg); color: var(--err); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* 하단 고정 버튼 */
.cta-bar { position: sticky; bottom: 0; padding: 12px 20px 24px; background: #fff; }
.cta { width: 100%; height: 56px; border: 0; border-radius: 14px; font-size: 17px; font-weight: 700; color: #fff; background: var(--accent); }
.cta:hover { background: var(--accent-dark); }
.cta:disabled { background: var(--disabled); cursor: not-allowed; }

@media print {
  body { background: #fff; font-size: 12pt; }
  .app { max-width: none; box-shadow: none; }
  .top, .cta-bar, .no-print { display: none !important; }
  main { padding: 0; }
  .card, .kpi, .basis { break-inside: avoid; }
  .chart rect { fill: #9DB6E4; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .chart rect.hi { fill: var(--accent); }
  a { color: inherit; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; }
}
