/* 우리 부모님 재무설계 — 공통 스타일 (OpenRouter Benchmarks 톤 참고) */
:root {
  --bg: #FCFCFE;
  --surface: #FFFFFF;
  --surface-2: #F7F7FA;
  --text: #03080A;
  --text-2: #4A4E52;
  --text-3: #6E7377;
  --line: #E7E7EC;
  --line-soft: #F1F1F5;
  --accent: #7624F4;
  --accent-hover: #6216D6;
  --accent-soft: #F4EEFE;
  --accent-line: #DCCBFC;
  --accent-text: #5B17C9;
  --warn: #D9480F;
  --warn-soft: #FFF4ED;
  --warn-line: #FFD8C2;
  --warn-text: #A33A0C;
  --ok: #15803D;
  --ok-soft: #EAF7EF;
  --invert-bg: #03080A;
  --invert-text: #FFFFFF;
  --invert-muted: #A6ABAF;
  --shadow: 0 1px 2px rgba(3, 8, 10, .04);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0D; --surface: #111116; --surface-2: #17171D;
    --text: #F3F3F6; --text-2: #B6B6C0; --text-3: #8B8B97;
    --line: #25252D; --line-soft: #1B1B22;
    --accent: #9466FF; --accent-hover: #A985FF; --accent-soft: #1E1631; --accent-line: #3B2B66; --accent-text: #C3A6FF;
    --warn: #FF8A4C; --warn-soft: #24160E; --warn-line: #55301A; --warn-text: #FFB089;
    --ok: #4ADE80; --ok-soft: #0F2418;
    --invert-bg: #1A1A22; --invert-text: #F3F3F6; --invert-muted: #9A9AA6;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0D; --surface: #111116; --surface-2: #17171D;
  --text: #F3F3F6; --text-2: #B6B6C0; --text-3: #8B8B97;
  --line: #25252D; --line-soft: #1B1B22;
  --accent: #9466FF; --accent-hover: #A985FF; --accent-soft: #1E1631; --accent-line: #3B2B66; --accent-text: #C3A6FF;
  --warn: #FF8A4C; --warn-soft: #24160E; --warn-line: #55301A; --warn-text: #FFB089;
  --ok: #4ADE80; --ok-soft: #0F2418;
  --invert-bg: #1A1A22; --invert-text: #F3F3F6; --invert-muted: #9A9AA6;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, p, dl, dd, ul { margin: 0; }
strong { font-weight: 600; }

.wrap { max-width: 1040px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* 상단 바 */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { max-width: 1240px; min-height: 56px; display: flex; align-items: center; gap: 24px; justify-content: space-between; }
.brand { flex: none; display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); text-decoration: none; }
.logo { width: 22px; height: 22px; border-radius: 7px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M5 15l4-4 3 3 5-6' stroke='white' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.steps { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.step-chip { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.step-chip:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.step-chip[aria-current] { color: var(--text); font-weight: 600; background: var(--surface-2); }
.chip-ico { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 7px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); transition: background .15s, color .15s; }
.chip-ico svg { width: 14px; height: 14px; }
.step-chip:hover .chip-ico { color: var(--accent-hover); }
.step-chip[aria-current] .chip-ico { color: #FFFFFF; background: linear-gradient(135deg, var(--accent), #A855F7); box-shadow: 0 2px 6px -2px var(--accent); }

/* 본문 */
main.wrap { padding-top: 40px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 28px; }
.context { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; margin-bottom: -8px; }
.context::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero { display: flex; flex-direction: column; gap: 10px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--accent-text); letter-spacing: 0.06em; text-transform: uppercase; }
.hero h1 { font-size: 28px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; }
.hero-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.family-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.family-pill { font-size: 12.5px; font-weight: 600; line-height: 1; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 6px 11px; white-space: nowrap; }
.hero p { font-size: 15px; line-height: 1.65; color: var(--text-2); max-width: 680px; }

.grid { display: grid; gap: 12px; }
.grid-280 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-300 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-320 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-240 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-190 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-160 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.card.lg { padding: 0; gap: 0; overflow: hidden; }
.card.lg > * { padding-left: 20px; padding-right: 20px; }
.card.lg > :first-child { padding-top: 18px; }
.card.lg > :last-child { padding-bottom: 20px; }
.card.lg > * + * { margin-top: 14px; }
.card.lg > .table-scroll { padding-left: 0; padding-right: 0; }
.card.lg > .table-scroll:last-child { padding-bottom: 0; }
.card h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card.lg > h2, .card-head h2 { font-size: 16px; }
.section-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.card p { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.card p strong { color: var(--text); }
.card-head { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.note { font-size: 12px; color: var(--text-3); }

/* 체크 리스트 */
.checks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.checks li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background-color: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M5 9.5l2.5 2.5L13 6.5' stroke='%237624F4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}

/* AI 활용 · 검증 */
.ai { background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.ai::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), #C084FC 60%, transparent); }
.ai h2 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ai h2::before { content: "AI"; font-size: 10.5px; font-weight: 700; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 6px; padding: 1px 6px; }
.ai .item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); }
.ai .label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.ai p { font-size: 14px; line-height: 1.6; }
.ai-run { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--line); padding-top: 14px; }
.ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ai-status { font-size: 13px; color: var(--text-3); }
.ai-status.error { color: var(--warn); }
.ai-output { font-size: 14px; line-height: 1.7; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 8px; padding: 16px 18px; }
.ai-output h3 { font-size: 14.5px; margin: 14px 0 4px; }
.ai-output h3:first-child { margin-top: 0; }
.ai-output p { margin: 6px 0; }
.ai-output ul { margin: 4px 0; padding-left: 20px; }
.ai-output .meta { margin-top: 10px; font-size: 12px; color: var(--text-3); }

/* 버튼 · 이전/다음 */
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 20px; }
.pager .btn-primary { margin-left: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 8px; font-family: inherit; font-weight: 600; font-size: 14px; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-hover); color: #FFFFFF; }
.btn-primary[disabled] { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-text { background: none; color: var(--warn); }
.btn-danger { margin-left: auto; background: var(--surface); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--warn) 8%, transparent); color: var(--warn); }
.pager .btn-primary::after { content: "→"; }
.pager .btn-ghost::before { content: "←"; color: var(--text-3); }

/* 2단계: 인적 사항 · 표 · 목표 */
.profile { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 14px; }
.profile dt { color: var(--text-3); }
.profile dd { color: var(--text); font-weight: 500; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
table.data td { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
table.data td:first-child { font-weight: 600; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.status.done { color: var(--ok); } .status.done::before { background: var(--ok); }
.status.doing { color: var(--accent-text); } .status.doing::before { background: var(--accent); }
.status.todo { color: var(--warn-text); } .status.todo::before { background: var(--warn); }

.horizon { display: flex; flex-direction: column; gap: 8px; }
.horizon-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.goal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.goal strong { font-size: 15px; }
.goal .meta { font-size: 13px; color: var(--text-3); }
.badge { align-self: flex-start; font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 1px 7px; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.badge.top { color: #FFFFFF; background: var(--accent); border-color: var(--accent); }

/* 3단계: 지표 · 재무상태표 · 현금흐름 · 부족액 막대 */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k { font-size: 12px; color: var(--text-3); }
.kpi .k:first-child { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi strong { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.balance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; font-size: 13.5px; }
.balance .col { display: flex; flex-direction: column; gap: 8px; }
.balance .col > strong { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.balance .row { display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); }
.balance .row span:last-child { font-variant-numeric: tabular-nums; color: var(--text); }
.balance .row.total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 600; color: var(--text); }
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.flow .box { border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); }
.flow .box span { color: var(--text-3); font-size: 12px; }
.flow .box strong { font-size: 16px; }
.flow .box.out { background: var(--accent); border-color: var(--accent); }
.flow .box.out span, .flow .box.out strong { color: #FFFFFF; }
.flow .op { font-size: 16px; color: var(--text-3); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; }
.sw.ready { background: var(--accent); }
.sw.gap { border: 2px dashed var(--warn); }
.gap-item { display: flex; flex-direction: column; gap: 8px; }
.gap-item .top { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; font-size: 14px; }
.gap-item .top > span { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.short { color: var(--warn); font-weight: 600; }
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line-soft); }
.bar .ready { background: var(--accent); }
.bar .gap { background: repeating-linear-gradient(135deg, var(--warn-soft) 0 4px, var(--warn-line) 4px 8px); }
.card h2.blue { color: var(--accent-text); }
.card h2.orange { color: var(--warn); }

/* 4단계: 가정 · 대안 · 선택 */
.assume { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.assume span { font-size: 12px; color: var(--text-3); }
.assume strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.option { gap: 10px; }
.option .tag { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.option h2 { font-size: 17px; }
.option .result { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.option .result strong:last-child { color: var(--accent-text); }
.option p.pc { font-size: 13px; }
.option p.pc strong { margin-right: 8px; }
.levers { display: flex; flex-wrap: wrap; gap: 6px; }
.lever { font-size: 12.5px; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 3px 10px; }
.lever .editable { margin: 0 2px; }
.lever-warn { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--warn-text); }
.lever-goal { font-size: 12.5px; color: var(--text-3); padding: 3px 2px; }
.choice-calc { display: block; margin-top: 8px; }
.gap-how { font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.gap-basis { margin: 4px 0 0; line-height: 1.6; }
.option.chosen { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice { background: var(--invert-bg); color: var(--invert-text); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.choice .tag { font-size: 11px; font-weight: 600; color: #C4A8FF; text-transform: uppercase; letter-spacing: 0.06em; }
.choice h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.choice p { font-size: 14px; line-height: 1.6; color: var(--invert-muted); }
.warn { font-size: 13px; line-height: 1.6; color: var(--warn-text); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 8px; padding: 12px 16px; }

/* 5단계: 진행률 */
.progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.progress .track { width: 140px; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress .fill { height: 6px; background: var(--accent); width: 0; transition: width .4s; }

/* 6단계: 점검 주기 · 차트 · 재설계 조건 */
.cadence { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cadence .when { align-self: flex-start; font-size: 11px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 6px; padding: 1px 7px; }
.cadence strong { font-size: 15px; }
.cadence .meta { font-size: 13px; line-height: 1.6; color: var(--text-3); }
.cadence.next { background: var(--invert-bg); border-color: var(--invert-bg); color: var(--invert-text); }
.cadence.next .when { background: rgba(148, 102, 255, .2); border-color: rgba(148, 102, 255, .4); color: #C4A8FF; }
.cadence.next .meta { color: var(--invert-muted); }
.cadence .meta [data-b6="annualCheck"] { margin-left: 6px; }
.chart { width: 100%; height: auto; }
.chart text { font-family: inherit; fill: var(--text-3); }
.chart line { stroke: var(--line); }
.chart .plan { stroke: var(--accent); }
.chart .actual { stroke: var(--warn); }
.chart circle { fill: var(--warn); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 13px; background: var(--surface); color: var(--text-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }

/* 시작: 기본 정보 입력 폼 */
.privacy { font-size: 13px; line-height: 1.6; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
fieldset.form-card { margin: 0; min-width: 0; }
fieldset.form-card legend { float: left; width: 100%; padding: 0; margin-bottom: 6px; font-size: 15px; font-weight: 600; display: flex; align-items: center; }
fieldset.form-card legend + * { clear: both; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.flabel { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; font-weight: 400; color: var(--text-3); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 15px; color: var(--text); background: var(--surface);
  min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; width: 100%;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--text-3); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--warn); }
.checks-row { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-2); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.check:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }
.check.solo { align-self: flex-start; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-error { font-size: 13px; color: var(--warn); font-weight: 600; }
.notice { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; font-size: 13.5px; background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-text); border-radius: 8px; padding: 12px 16px; }
.notice a { font-weight: 600; color: var(--warn-text); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--invert-bg); color: var(--invert-text); font-size: 13px; padding: 10px 16px; border-radius: 8px; z-index: 20; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }

.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 20px; padding-bottom: 28px; font-size: 12px; color: var(--text-3); line-height: 1.6; }

@media (max-width: 760px) {
  .topbar .wrap { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
  .topbar .plan-badge { align-self: flex-start; margin-top: 6px; }
  .steps { margin: 0 -16px; padding: 6px 12px 8px; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  main.wrap { padding-top: 24px; padding-bottom: 48px; gap: 22px; }
  .hero h1 { font-size: 23px; }
  .grid-280, .grid-300, .grid-320, .grid-240 { grid-template-columns: 1fr; }
  .balance { grid-template-columns: 1fr; }
  .pager .btn { flex: 1; text-align: center; padding: 0 12px; }
  .card.lg > * { padding-left: 16px; padding-right: 16px; }
  table.data th, table.data td { padding-left: 16px; padding-right: 16px; }
}

@media print {
  .topbar, .pager, .ai-run { display: none; }
}


/* 라인 아이콘: 연보라 배지 + 보라 선 (단계 칩 아이콘과 같은 규격) */
.ico { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 9px; border-radius: 8px; vertical-align: -7px; color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.ico svg { width: 15px; height: 15px; }
.card h2.orange .ico { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 28%, transparent); }
.btn .ico { width: auto; height: auto; margin: 0; background: none; box-shadow: none; color: inherit; vertical-align: 0; }
.btn .ico svg { width: 16px; height: 16px; }
.privacy .ico { width: auto; height: auto; margin-right: 6px; background: none; box-shadow: none; vertical-align: -3px; }

/* 자산·부채 직접 입력 */
.form-intro { margin: 0 0 14px; line-height: 1.6; }
.form-card .sub { margin: 18px 0 10px; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.04em; }
.form-card .sub:first-of-type { margin-top: 4px; }
.form-card .fields + .fields { margin-top: 18px; }
.asset-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 0; }
.asset-sum + .asset-sum { margin-top: 10px; }
.asset-sum div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.asset-sum dt { font-size: 11.5px; color: var(--text-3); }
.asset-sum dd { margin: 2px 0 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.asset-sum .net { border-color: var(--accent-line); background: var(--accent-soft); }
.asset-sum .net dd { color: var(--accent-text); }
.field.wide { grid-column: 1 / -1; }

/* AI 결과·검증 기록 (단계별, 브라우저 저장) */
.ai .review { width: 100%; min-height: 64px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.55; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.ai .review:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai .review.flash { animation: review-flash 1.2s ease-out; }
@keyframes review-flash { from { background: var(--accent-soft); border-color: var(--accent); } }
.ai .confirmed { margin-left: 6px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--accent-text); }
@media print { .ai .review { border: none; padding: 0; resize: none; background: none; } }
.ai-role { margin-top: -6px; font-size: 13.5px; color: var(--text-2); }
.ai-role strong { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 6px; font-size: 12.5px; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); }

/* 서버 저장 */
.sync-badge { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.sync-badge:hover { text-decoration: none; color: var(--text); }
.sync-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.sync-badge[data-state="ok"] { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.sync-badge[data-state="ok"]::before { background: var(--accent); }
.sync-badge[data-state="saving"]::before { background: var(--accent); animation: sync-pulse 1s infinite; }
.sync-badge[data-state="error"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.sync-badge[data-state="error"]::before { background: var(--warn); }
@keyframes sync-pulse { 50% { opacity: .3; } }
.storage { padding: 16px 20px; border-color: var(--accent-line); }
.storage-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.storage-row > div:first-child { flex: 1 1 320px; }
.storage-row strong { font-size: 15px; }
.storage-row .hint { margin-top: 4px; line-height: 1.55; }
.storage-login { display: flex; gap: 8px; }
.storage-login input { min-height: 36px; width: 200px; padding: 0 12px; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.storage-login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.storage-row .form-error { flex-basis: 100%; margin: 0; }
@media print { .sync-badge, .storage { display: none; } }

/* AI 추가 메모 예시 */
.note-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -2px; }
.note-examples .hint { margin-right: 2px; }
.note-chip { font: inherit; font-size: 12.5px; line-height: 1.3; color: var(--accent-text); background: var(--surface); border: 1px dashed var(--accent-line); border-radius: 999px; padding: 5px 11px; cursor: pointer; text-align: left; }
.note-chip::before { content: "+ "; font-weight: 700; }
.note-chip:hover { background: var(--accent-soft); border-style: solid; }
@media (max-width: 760px) {
  .topbar .wrap { position: relative; }
  .sync-badge { position: absolute; top: 12px; right: 16px; }
}

/* 인트로 */
.intro-main { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 20px 16px 24px; }
/* 그림은 화면 폭의 85.5%(최대 1026px), 노트북처럼 낮은 화면에서는 높이에 맞춰 줄여 스크롤이 생기지 않게 한다 (1670×941 비율) */
.intro-stage { position: relative; width: min(85.5%, 1026px, calc((100vh - 44px) * 1.775)); width: min(85.5%, 1026px, calc((100dvh - 44px) * 1.775)); }
.intro-hero { display: block; width: 100%; height: auto; border-radius: 20px; box-shadow: 0 12px 40px rgba(118, 36, 244, .12); }
/* 버튼은 그림 아래쪽 빈 띠의 오른쪽, 가구 고르기는 왼쪽에 얹는다 */
.intro-cta { position: absolute; right: 3%; bottom: 4.5%; }
.intro-cta .btn-pill { height: 50px; min-height: 0; padding: 0 28px; font-size: 16px; line-height: 1; white-space: nowrap; border: 1px solid var(--accent); }
/* 두 버튼이 같은 높이로 보이게 그림자를 같게 (큰 보라 그림자는 아래로 번져 더 커 보인다) */
.intro-cta .btn-pill, .intro-cta .btn-pill:hover { box-shadow: 0 2px 8px rgba(3, 8, 10, .10); transform: none; }
.intro-cta .btn-pill-ghost { border-color: var(--accent-line); }
.intro-stage .plan-box { position: absolute; left: 3%; bottom: 4.5%; }
.btn-pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 36px; border-radius: 999px; background: var(--accent); color: #FFFFFF; font-family: inherit; font-weight: 700; font-size: 17px; box-shadow: 0 6px 20px rgba(118, 36, 244, .28); transition: background .15s, transform .15s, box-shadow .15s; }
.btn-pill::after { content: "→"; }
.btn-pill:hover { background: var(--accent-hover); color: #FFFFFF; text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(118, 36, 244, .34); }
.btn-pill:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 3px; }
@media (max-width: 640px) {
  .intro-main { min-height: 0; justify-content: flex-start; gap: 16px; padding: 12px 12px 20px; }
  .intro-hero { width: 100%; border-radius: 12px; }
  .intro-stage { width: 100%; }
  .intro-cta, .intro-stage .plan-box { position: static; }
  .intro-cta { margin-top: 16px; }
  .intro-cta .intro-actions { flex-direction: column; align-items: center; }
  .intro-stage .plan-box { margin-top: 12px; }
  .btn-pill { width: 100%; max-width: 360px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.storage.gate { max-width: 640px; margin: 48px auto; }
.card h2:has(> .ico:first-child) { display: flex; align-items: center; }
.storage.gate { max-width: 420px; }
.storage.gate .storage-row { justify-content: center; }
.storage.gate .storage-login { flex: 1; }
.storage.gate .storage-login input { flex: 1; width: auto; min-width: 0; }

/* 2단계 재무목표 후보 고르기 */
.goal-intro { font-size: 13.5px; color: var(--text-2); margin: 0; }
.goal-empty { font-size: 13px; color: var(--text-3); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0; }
.goal-actions { display: flex; gap: 6px; margin-top: 4px; }
.btn-xs { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: default; }
.goal-pick { display: flex; flex-direction: column; gap: 12px; }
.goal-cands { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.goal-cand { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; height: 100%; box-sizing: border-box; }
.goal-cand:hover { background: var(--surface-2); }
.goal-cand.on { border-color: var(--accent-line); background: var(--accent-soft); }
.goal-cand input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.goal-cand-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.goal-cand-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.goal-cand strong { font-size: 14px; }
.goal-cand .meta { font-size: 12.5px; color: var(--text-3); }
.goal-cand .why { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.goal-rank { font-size: 11.5px; font-weight: 600; color: var(--accent-text); }

/* 설계 기록 */
.snap-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.snap-form .snap-memo { flex: 1; min-width: 220px; }
table.trend td { white-space: nowrap; }
table.trend td:first-child { position: sticky; left: 0; background: var(--surface); }
.delta { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-3); margin-top: 2px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--warn-text); }
.track-at { display: block; font-size: 11px; margin-top: 2px; }
.snap summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; cursor: pointer; list-style-position: outside; }
.snap summary strong { font-size: 16px; }
.snap-memo-t { font-size: 14px; color: var(--text-2); }
.snap h3 { font-size: 14px; margin: 12px 0 0; }
.snap-goals { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.snap-goals .meta { font-size: 12.5px; color: var(--text-3); }
.snap .item p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }
.snap-verify { color: var(--text-2); }
.snap .item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); }

/* 시작 페이지: 고른 재무목표 고치기 */
.goal-edit { display: flex; flex-direction: column; gap: 10px; }
.goal-row { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.goal-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.goal-row-head .badge { align-self: center; }
.goal-row-head .btn-xs:first-of-type { margin-left: auto; }
.goal-row .wide-2 { grid-column: span 2; }
@media (max-width: 640px) { .goal-row .wide-2 { grid-column: auto; } }
.gap-list { display: flex; flex-direction: column; gap: 16px; }
.gap-list[hidden] { display: none; }
.card.lg > .gap-list { padding-bottom: 20px; }
.goal-monthly { align-self: end; }

.ai-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; line-height: 1.6; }
.gap-item .src { font-size: 11.5px; color: var(--text-3); }
.gap-note { font-size: 12.5px; color: var(--text-3); }

.status-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; cursor: pointer; font-family: inherit; }
.status-btn:hover { background: var(--surface-2); }

/* 첫 화면: 이어서 하기 · 새 설계 시작 */
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.plan-box summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--accent-line); font-size: 13.5px; color: var(--text-2); cursor: pointer; max-width: 100%; }
.plan-box summary::-webkit-details-marker { display: none; }
.plan-box summary strong { color: var(--text); max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-change { color: var(--accent-text); font-weight: 600; }
.plan-change::after { content: " ▾"; }
.plan-box[open] .plan-change::after { content: " ▴"; }
.plan-panel { position: absolute; left: 0; bottom: calc(100% + 8px); width: min(440px, 80vw); max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 12px 40px rgba(3, 8, 10, .14); z-index: 5; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-head h2 { margin: 0; font-size: 16px; }
.plan-panel .hint { margin: 6px 0 12px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 8px 8px 12px; }
.plan-item.is-current { border-color: var(--accent-line); background: var(--accent-soft); }
.plan-pick { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; text-align: left; background: none; border: 0; padding: 4px 0; font: inherit; color: var(--text); cursor: pointer; }
.plan-pick[aria-current] { cursor: default; }
.plan-cur { font-size: 12px; font-weight: 600; color: var(--accent-text); }
.plan-meta { flex-basis: 100%; font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.plan-tools { display: flex; gap: 4px; flex: none; }
.plan-badge { flex: none; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; max-width: 12em; overflow: hidden; text-overflow: ellipsis; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.plan-badge:hover { text-decoration: none; color: var(--text); border-color: var(--accent-line); }
@media (max-width: 640px) { .plan-panel { position: static; width: 100%; max-height: none; margin-top: 8px; box-shadow: none; } }
@media (max-width: 560px) { .plan-item { flex-wrap: wrap; } .plan-tools { width: 100%; justify-content: flex-end; } }
@media print { .plan-badge { display: none; } }
.btn-pill-ghost { background: var(--surface); color: var(--accent-text); border: 1px solid var(--accent-line); box-shadow: none; cursor: pointer; }
.btn-pill-ghost::after { content: none; }
.btn-pill-ghost:hover { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.intro-resume { margin: -16px 0 0; font-size: 13.5px; color: var(--text-3); }
/* 새 설계 시작 대화상자 */
.np-dialog { max-width: 440px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.np-dialog::backdrop { background: rgba(10, 10, 13, .45); }
.np-dialog h2 { font-size: 18px; margin: 0 0 8px; }
.np-dialog p { font-size: 14px; color: var(--text-2); line-height: 1.6; margin: 0 0 14px; }
.np-options { display: flex; flex-direction: column; gap: 10px; }
.np-option { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-family: inherit; cursor: pointer; }
.np-option:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.np-option strong { font-size: 15px; }
.np-option span { font-size: 13px; color: var(--text-3); line-height: 1.5; }
.np-foot { display: flex; justify-content: flex-end; margin-top: 14px; }

/* 화면에서 바로 고치는 칸 */
.editable { border-radius: 6px; outline: 1px dashed var(--line); outline-offset: 3px; cursor: text; }
.editable:hover { outline-color: var(--accent-line); }
.editable:focus { outline: 2px solid var(--accent-line); background: var(--accent-soft); }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.6; }
.checks.editable { margin-top: 10px; }
.edit-hint { margin-top: 8px; }

.title-hint { margin-left: 10px; font-size: 13px; font-weight: 500; color: var(--accent-text); letter-spacing: 0; }

.ai-edit { display: flex; flex-direction: column; gap: 8px; }
.ai-edit textarea { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px; line-height: 1.6; padding: 12px; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }

/* 3~6단계 직접 고치기 */
.editable:empty::before { content: "입력"; color: var(--text-3); }
.editable.num, .result .editable { display: inline-block; min-width: 3ch; }
.gap-note.editable { display: block; min-height: 1.4em; }
/* 3단계 준비액 칸: 점선 테두리가 옆 글자(“준비”)를 가르지 않게 안쪽 여백으로 띄운다 */
.gap-item .editable.num { margin: 0 2px; padding: 0 5px; outline-offset: 1px; }
.gap-item .top { word-break: keep-all; }
.task-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.add-row { align-self: flex-start; margin-top: 4px; }
/* 행 추가 버튼: 카드 안쪽 여백에 맞춰 띄우고, 보라색 계열로 눈에 띄게 */
.btn.add-row { background: var(--accent-soft); color: var(--accent-text); border: 1px dashed var(--accent-line); }
.btn.add-row:hover { background: var(--accent); color: #FFFFFF; border-color: var(--accent); border-style: solid; }
.btn.add-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.lg > .add-row { padding: 0 16px; margin-left: 20px; margin-bottom: 20px; }
.option-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pill.editable { min-width: 4ch; }
.pill-add { cursor: pointer; border-style: dashed; background: transparent; font-family: inherit; color: var(--accent-text); }
.edit-hint { margin: -4px 0 0; }
/* AI 분석 창: 길면 안에서 스크롤 (잘리지 않게) */
.ai-output { max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere; min-width: 0; }
.ai-output .ai-edit textarea { max-height: 50vh; }
@media print { .ai-output { max-height: none; overflow: visible; } }
.flow-hint { margin: -6px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }

.empty-state { margin: 0; padding: 28px 20px; text-align: center; font-size: 14.5px; line-height: 1.7; color: var(--text-2); border: 1px dashed var(--accent-line); border-radius: var(--radius); background: var(--surface); }

/* 6단계 실적 그래프: 계획은 회색 점선(기준선), 실제는 강조색 실선 */
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .plan { fill: none; stroke: var(--text-3); stroke-width: 2; stroke-dasharray: 8 6; }
.chart .actual { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .actual-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart text { font-size: 14px; }
.chart text.direct { fill: var(--text); font-weight: 600; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; }
.lg-plan { stroke: var(--text-3); }
.lg-actual { stroke: var(--accent); }
.act-chart { position: relative; }
.chart-tip { position: absolute; top: 4px; transform: translateX(12px); display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; font-size: 12.5px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.08); pointer-events: none; white-space: nowrap; }
.chart-tip.flip { transform: translateX(calc(-100% - 12px)); }
.act-summary { margin: 0; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.act-table td { font-variant-numeric: tabular-nums; }
.act-input { width: 110px; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text); }
.act-setup { margin-bottom: 4px; }
.act-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.act-tab { cursor: pointer; font-family: inherit; }
.act-tab[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); font-weight: 600; }
.act-cands { display: flex; flex-direction: column; gap: 8px; }
.act-cand-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.act-cand { display: flex; flex-direction: column; gap: 3px; text-align: left; font: inherit; cursor: pointer; padding: 10px 12px; border: 1px dashed var(--accent-line); border-radius: 10px; background: var(--surface); color: var(--text); }
.act-cand strong { font-size: 14px; color: var(--accent-text); }
.act-cand span { font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.act-cand:hover { border-color: var(--accent); }
.act-cand.on { border-style: solid; background: var(--accent-soft); }
.act-cand.custom strong { color: var(--text-2); }
.act-empty { margin: 0; font-size: 14px; color: var(--text-3); }
.card.lg > .act-empty { padding-bottom: 20px; }
.act-setup .act-del { align-self: end; justify-self: start; }
.act-table td.good { color: var(--ok); } .act-table td.bad { color: var(--warn-text); }
.chart text.direct { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
/* 탑 메뉴: 아이콘 상자를 없애고 글자와 붙여 보이게, 마우스를 올리면 예전 상자 색(연보라)으로 칩 전체를 칠한다 */
.chip-ico, .step-chip:hover .chip-ico, .step-chip[aria-current] .chip-ico { width: auto; height: auto; margin-right: 6px; border-radius: 0; color: currentColor; background: none; box-shadow: none; }
.chip-ico svg { width: 16px; height: 16px; }
.step-chip { transition: background .15s, color .15s; }
.step-chip:hover { color: var(--accent-text); background: var(--accent-soft); }
.step-chip[aria-current] { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
/* 모든 아이콘: 보라색 바탕 상자를 없애고 아이콘만 글자 옆에 둔다 */
.ico, .card h2.orange .ico { width: auto; height: auto; margin-right: 8px; border-radius: 0; background: none; box-shadow: none; vertical-align: -3px; }
.ico svg { width: 18px; height: 18px; }
.btn .ico { margin: 0; }
.btn .ico svg { width: 16px; height: 16px; }

/* 위·아래 이동 버튼 */
.scroll-nav { position: fixed; right: 20px; bottom: 24px; z-index: 15; display: flex; flex-direction: column; gap: 6px; }
.scroll-nav button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text-2); cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .10); transition: background .15s, color .15s, border-color .15s, opacity .15s; }
.scroll-nav button:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.scroll-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scroll-nav button:disabled { opacity: .35; cursor: default; }
.scroll-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) { .scroll-nav { right: 12px; bottom: 16px; } .scroll-nav button { width: 36px; height: 36px; } }
@media print { .scroll-nav { display: none; } }

/* ---- 시각화 (3단계 재무상태표·현금흐름·은퇴 시간표, 4단계 대안 비교) ---- */
:root { --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; }
}
:root[data-theme="dark"] { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; }
.c1 { background: var(--c1); } .c2 { background: var(--c2); } .c3 { background: var(--c3); }
.c4 { background: var(--c4); } .c5 { background: var(--c5); }
.net { background: var(--accent); }
.debt, .tgap { background: repeating-linear-gradient(135deg, var(--warn-soft) 0 4px, var(--warn-line) 4px 8px); box-shadow: inset 0 0 0 1px var(--warn-line); }
.rest-fill { background: var(--line); }
.work { background: var(--c1); }
.pens { background: var(--c3); }
.viz { display: flex; flex-direction: column; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.vrow { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 10px; }
.vlab { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.vbar { display: flex; gap: 2px; height: 14px; }
.vbar .seg { min-width: 3px; border-radius: 2px; cursor: default; }
.vbar .seg:first-child { border-radius: 4px 2px 2px 4px; }
.vbar .seg:last-child { border-radius: 2px 4px 4px 2px; }
.vbar .seg:only-child { border-radius: 4px; }
.vbar .seg.rest { background: none; cursor: auto; }
.vbar .seg:hover, .tseg:hover, .otrack span:hover { filter: brightness(1.08); outline: 2px solid var(--surface); outline-offset: -1px; }
.vlegend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.vlegend li { display: inline-flex; align-items: center; gap: 6px; }
.vlegend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.vlegend span { color: var(--text-3); font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.vwarn { margin: 0; font-size: 12.5px; color: var(--warn-text); }
/* 은퇴·연금 시간표 */
.tl { display: flex; flex-direction: column; gap: 6px; }
.tlbody { position: relative; display: flex; flex-direction: column; gap: 14px; padding-top: 22px; }
.trow, .taxis { display: grid; grid-template-columns: 64px minmax(0, 1fr) 190px; align-items: center; gap: 10px; }
.ttrack { position: relative; height: 16px; background: var(--line-soft); border-radius: 4px; }
.tseg { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.tseg + .tseg { border-left: 2px solid var(--surface); }
.tmarks { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tlover { position: absolute; inset: 0 200px 0 74px; pointer-events: none; }
.tband { position: absolute; top: 0; bottom: -6px; border-left: 1px dashed var(--warn); border-right: 1px dashed var(--warn); background: color-mix(in srgb, var(--warn) 6%, transparent); }
.tband span { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--warn-text); }
.tticks { position: relative; height: 16px; border-top: 1px solid var(--line); }
.tticks span { position: absolute; top: 3px; transform: translateX(-50%); font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tticks span:first-child { transform: none; }
/* 4단계 대안별 부족액 */
.orow { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 190px; align-items: center; gap: 12px; padding: 4px 0; }
.olab { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.olab b { color: var(--text); }
.olab em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; }
.otrack { position: relative; height: 14px; }
.otrack span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.obefore { background: var(--line); }
.oafter { background: var(--c1); top: 3px !important; bottom: 3px !important; border: 0; }
.orow.on .oafter { background: var(--accent); }
.oval { font-size: 12.5px; color: var(--text-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.oval b { color: var(--text); }
.oval .down { color: var(--ok); } .oval .up { color: var(--warn-text); }
.viz-tip { position: fixed; z-index: 30; pointer-events: none; background: var(--invert-bg); color: var(--invert-text); font-size: 12px; padding: 6px 9px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); white-space: nowrap; }
@media (max-width: 640px) {
  .vrow { grid-template-columns: 1fr; gap: 4px; }
  .trow, .taxis { grid-template-columns: 52px minmax(0, 1fr); }
  .trow .tmarks { grid-column: 2; margin-top: -6px; }
  .taxis .tmarks { display: none; }
  .tlover { inset: 0 0 0 62px; }
  .orow { grid-template-columns: 1fr; gap: 4px; }
  .oval { text-align: left; }
}
@media print { .viz-tip { display: none; } }
/* 2단계 목표 연표 · 5단계 실행 일정표 */
.gantt { display: flex; flex-direction: column; gap: 8px; }
.grow { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 150px; align-items: center; gap: 12px; }
.glab { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glab b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; color: var(--text-2); margin-right: 2px; }
.glab span { font-size: 12px; color: var(--text-3); }
.gval { font-size: 12px; color: var(--text-2); line-height: 1.35; font-variant-numeric: tabular-nums; }
.gval em { font-style: normal; font-weight: 600; color: var(--warn-text); }
.gtrack { position: relative; height: 18px; background: var(--line-soft); border-radius: 4px; }
.gtrack.bare { background: none; height: 16px; }
.gtrack .tseg.guess { opacity: .45; }
.vmark { position: absolute; top: -5px; bottom: -5px; border-left: 1.5px dashed var(--text-3); pointer-events: none; }
.vmark.now { border-left: 2px solid var(--accent); }
.vmark-lab { position: absolute; bottom: 0; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--text-2); }
.vmark-lab.now { color: var(--accent-text); }
.vmark-sw { width: 0; height: 12px; border-radius: 0; border-left: 1.5px dashed var(--text-3); }
.vmark-sw.now { border-left: 2px solid var(--accent); }
.gdot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.sw.gdot { position: static; margin: 0; box-shadow: none; }
.gdot.done { background: var(--ok); }
.gdot.doing { background: var(--accent); }
.gdot.todo { background: var(--surface); border: 2px solid var(--warn); }
.gaxis .tticks span:first-child { transform: translateX(-50%); }
@media (max-width: 640px) {
  .grow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .grow > span:empty { display: none; }
  .grow + .grow:not(.gaxis) { margin-top: 6px; }
}
/* 6단계 점검 달력 · 달별 실제 저축 */
.cal { display: flex; flex-direction: column; gap: 4px; overflow-x: auto; }
.cal-row { display: grid; grid-template-columns: 48px repeat(12, minmax(26px, 1fr)); gap: 3px; align-items: center; min-width: 420px; }
.cal-head span { position: relative; text-align: center; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; padding-top: 14px; }
.cal-head span em { position: absolute; top: 0; left: 0; right: 0; font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--text-2); }
.cal-head span.is-next { color: var(--accent-text); font-weight: 700; }
.cal-lab { font-size: 12px; color: var(--text-2); font-weight: 600; }
.cal-cell { height: 22px; border-radius: 4px; background: var(--line-soft); }
.cal-cell.on.k0, .cal-sw.k0 { background: var(--c1); }
.cal-cell.on.k1, .cal-sw.k1 { background: var(--c2); }
.cal-cell.on.k2, .cal-sw.k2 { background: var(--c3); }
.cal-cell.is-next, .cal-sw.is-next { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.on.is-next { box-shadow: 0 0 0 2px var(--accent); }
.cal-sw.is-next { background: var(--surface); }
.cal-cell.on:hover { filter: brightness(1.08); }
.glab { white-space: normal; text-overflow: clip; word-break: keep-all; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* 5단계 상태 선택: 예정 · 진행 중 · 완료 */
.seg-status { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface-2); gap: 2px; }
.seg-status button { border: 0; background: none; font-family: inherit; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 4px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.seg-status button:hover { color: var(--text); background: var(--surface); }
.seg-status button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg-status button[aria-pressed="true"] { font-weight: 700; color: var(--surface); }
.seg-status button.todo[aria-pressed="true"] { background: var(--warn); }
.seg-status button.doing[aria-pressed="true"] { background: var(--accent); }
.seg-status button.done[aria-pressed="true"] { background: var(--ok); }
/* 6단계 달별 실제 저축 막대 (연한 채움 + 위쪽 진한 선) */
.card.lg > [data-act-bars] { margin-top: 18px; }
.mb-title { font-size: 13px; font-weight: 600; }
.mbars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); padding-bottom: 0; margin-bottom: 18px; }
.mb-col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.mb { width: min(100%, 28px); background: var(--accent); border-radius: 4px 4px 0 0; }
.mb.low { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, color-mix(in srgb, var(--warn) 55%, var(--surface)) 3px 6px); }
.mb.empty { background: none; }
.mb:hover { filter: brightness(1.08); }
.mb-lab { position: absolute; bottom: -17px; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.mb-plan { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--text-3); pointer-events: none; z-index: 1; }
.mb-plan em { position: absolute; right: 0; bottom: 2px; font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface); padding: 0 4px; }
.mb-sw { background: var(--accent); }
.mb-sw.low { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, color-mix(in srgb, var(--warn) 55%, var(--surface)) 3px 6px); }
.mb { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); box-shadow: inset 0 2px 0 var(--accent); }
.mb.low, .mb-sw.low { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 35%, var(--surface)) 0 3px, color-mix(in srgb, var(--warn) 12%, var(--surface)) 3px 6px); box-shadow: inset 0 2px 0 var(--warn); }
.mb.empty { background: none; box-shadow: none; }
.mb-sw { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent); }
.mb-sw.low { box-shadow: inset 0 0 0 1px var(--warn); }
/* 시작 탭: 설계자(2칸)와 가구(4칸)를 한 줄에 나란히 두어 빈 공간을 줄인다 */
.grid-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: stretch; }
.grid-pair > .form-card + .form-card .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) {
  .grid-pair { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid-pair > .form-card + .form-card .fields { grid-template-columns: 1fr; }
}

/* 2단계 구성원 카드 */
.card.member { gap: 16px; padding: 20px; background: linear-gradient(180deg, var(--accent-soft) 0, var(--surface) 88px); }
.m-head { display: flex; align-items: center; gap: 12px; }
.m-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #FFFFFF; font-weight: 700; font-size: 18px; box-shadow: 0 4px 12px rgba(118, 36, 244, .25); }
.card.member h2 { font-size: 17px; font-weight: 700; }
.card.member .m-sub { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.m-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.m-k { font-size: 12.5px; color: var(--text-3); }
.m-v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.m-v small { margin-left: 2px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.m-note { font-size: 11.5px; color: var(--text-3); }
.m-tl { display: flex; flex-direction: column; gap: 6px; }
.m-track { position: relative; height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.m-work { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 999px; }
.m-gap { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--warn) 0 4px, color-mix(in srgb, var(--warn) 35%, transparent) 4px 8px); }
.m-marks { position: relative; height: 34px; font-size: 11.5px; color: var(--text-3); }
.m-marks span { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; white-space: nowrap; }
.m-marks span:first-child { transform: none; align-items: flex-start; }
.m-marks span:last-child:not(:first-child) { transform: translateX(-100%); align-items: flex-end; }
.m-marks b { font-size: 13px; font-weight: 600; color: var(--text); }
.card.member .m-tl-note { margin: 0; font-size: 13px; }
.m-tl-note .m-warn { color: var(--warn-text); }
.m-marks span.near-end { transform: translateX(-100%); align-items: flex-end; padding-right: 4px; }
.m-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.m-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text); }
.m-tk { font-weight: 400; color: var(--text-3); }
.m-tag.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.m-tag.mid { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.m-tag.low { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }
.m-meter { display: inline-flex; gap: 2px; }
.m-meter i { width: 6px; height: 10px; border-radius: 2px; background: var(--line); }
.m-meter i.on { background: var(--accent); }
@media (max-width: 380px) { .m-v { font-size: 19px; } .m-stat { padding: 10px 12px; } }
/* 2단계 목표 금액 출처: 기본 정보로 계산 / AI 추정 */
.amt-src { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 18px; vertical-align: 1px; }
.amt-src[data-src="calc"] { color: var(--accent-text); background: var(--accent-soft); }
.amt-src[data-src="ai"] { color: var(--warn-text); background: var(--warn-soft); }
.amt-src[data-src="user"] { color: var(--ok); background: var(--ok-soft); }
/* 2단계 고른 목표의 금액 칸 */
.goal-amt { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--text-2); padding: 8px 10px; border-radius: 8px; background: var(--line-soft); }
.goal-amt.is-empty { background: var(--warn-soft); }
.goal-amt label { display: inline-flex; align-items: center; gap: 4px; }
.goal-amt label > span { font-weight: 600; color: var(--text); }
.goal-amt input, .goal-amt select { font: inherit; font-size: 13px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.goal-amt input { width: 84px; }
.goal-amt em { flex-basis: 100%; font-style: normal; font-size: 12px; color: var(--warn-text); }
.surplus { color: var(--ok); font-weight: 600; }
.goal-amt small { font-size: 12px; color: var(--text-3); }
