/* ═══════════════════════════════════════════════════════════
   2413 청약가점 계산기 — style.css
   출발점: DesignKit kit-corporate (신뢰·정돈) → 변형:
   · 웜 페이퍼 배경 + 잉크 네이비 단색 액센트(#1f4e79) · 1px 헤어라인 · 그림자 없음
   · 좌측 정렬 문서형 레이아웃 · 명세서풍 점수판(탭뷸러 숫자) · 모서리 6px 절제
   · 기피 요소(글래스·블러·그라디언트·글로우·다색 코딩·과한 그림자) 배제
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #dcd9d0;
  --line-2: #c9c5b9;
  --ink: #16202b;
  --text: #26313d;
  --text-2: #5b6570;
  --text-3: #858c93;
  --accent: #1f4e79;
  --accent-ink: #ffffff;
  --accent-soft: #e7eef5;
  --warn: #8a5a00;
  --warn-soft: #fbf3e2;
  --bad: #9b2c2c;
  --r: 6px;
  --wrap: 1080px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121518;
  --surface: #181c20;
  --surface-2: #1d2226;
  --line: #2b3137;
  --line-2: #3a4148;
  --ink: #eef0f2;
  --text: #dfe3e6;
  --text-2: #a4acb3;
  --text-3: #7d858c;
  --accent: #8db4dc;
  --accent-ink: #0f1a24;
  --accent-soft: #1d2a36;
  --warn: #e0b35c;
  --warn-soft: #2a2416;
  --bad: #e38b8b;
  color-scheme: dark;
}

*, *::before, *::after { 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: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── header ── */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand svg { color: var(--accent); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 1.02rem; letter-spacing: -0.02em; }
.brand-text small { font-size: .72rem; color: var(--text-3); letter-spacing: .01em; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 10px; color: var(--text-2); text-decoration: none; font-size: .92rem; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.theme-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text-2); cursor: pointer; flex-shrink: 0; }
.theme-btn:hover { color: var(--ink); border-color: var(--line-2); }
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; }
  .brand-text small { display: none; }
  .theme-btn { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0 -4px; padding-bottom: 4px; }
}

.ribbon { border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: .82rem; color: var(--text-2); }
.ribbon .wrap { padding-top: 7px; padding-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.ribbon-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

main.wrap { padding-top: 24px; padding-bottom: 48px; }

/* ── generic ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.pad { padding: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--text-2); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; }
.help { margin: 6px 0 0; font-size: .85rem; color: var(--text-2); line-height: 1.55; }
.err { margin: 12px 0 0; padding: 8px 12px; border-left: 3px solid var(--bad); background: var(--warn-soft); color: var(--bad); font-size: .9rem; }
.disclaimer { margin: 16px 0 0; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r); font-size: .86rem; color: var(--text-2); }

/* ── form ── */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.step-title { display: block; font-size: 1.12rem; font-weight: 700; color: var(--ink); margin: 0 0 16px; padding: 0; letter-spacing: -0.01em; }
.field { margin: 0 0 18px; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: .94rem; color: var(--ink); margin-bottom: 7px; }
input[type="date"], input[type="number"] {
  width: 100%; max-width: 280px; min-height: 44px; padding: 8px 12px; font: inherit; font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
}
input[type="date"]:focus, input[type="number"]:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); font-size: .92rem; color: var(--text); }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; padding: 4px 0; cursor: pointer; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }

/* ── main tool ── */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.tool.two { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .tool, .tool.two { grid-template-columns: 1fr; } }
.wizard { padding: 0; overflow: visible; }
.wizard form { padding: 22px 22px 18px; }
.stepper { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.stepper li { min-width: 0; }
.step-tab { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 10px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font: inherit; color: var(--text-3); cursor: pointer; text-align: left; }
.step-tab .n { width: 22px; height: 22px; flex-shrink: 0; display: inline-grid; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.step-tab .t { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-tab.done { color: var(--text-2); }
.step-tab.done .n { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.step-tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.step-tab.on .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 560px) {
  .step-tab { flex-direction: column; gap: 4px; padding: 10px 2px; text-align: center; }
  .step-tab .t { font-size: .72rem; }
  .wizard form { padding: 18px 16px 14px; }
}
.nav-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.nav-row #nextBtn { margin-left: auto; min-width: 120px; }

.people { display: grid; gap: 10px; margin: 14px 0; }
.person { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); }
.person.no { border-left-color: var(--line-2); }
.person-head { display: flex; align-items: center; gap: 10px; }
.person-head b { color: var(--ink); font-size: .95rem; }
.person-head .link-btn { margin-left: auto; }
.badge { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--accent); color: var(--accent); }
.person.no .badge { border-color: var(--line-2); color: var(--text-3); }
.checks { margin-top: 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 14px; }
.why { margin: 8px 0 0; padding-left: 18px; font-size: .84rem; color: var(--bad); }
.empty { color: var(--text-3); font-size: .9rem; margin: 14px 0; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.add-row .btn { min-height: 38px; padding: 0 12px; font-size: .88rem; }

/* scoreboard — 명세서풍 */
.scoreboard { position: sticky; top: 16px; padding: 18px; }
.sb-total { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.sb-label { font-weight: 700; color: var(--ink); }
.sb-num b { font-size: 2.6rem; line-height: 1; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.sb-num small { margin-left: 4px; color: var(--text-2); font-size: .9rem; }
.sb-items { list-style: none; margin: 0; padding: 0; }
.sb-items li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sb-row { display: flex; justify-content: space-between; font-size: .92rem; }
.sb-row b { font-variant-numeric: tabular-nums; color: var(--ink); }
.bar { height: 6px; margin-top: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width .25s ease; }
.sb-basis { margin: 10px 0 0; font-size: .76rem; color: var(--text-3); }
@media (max-width: 900px) {
  .scoreboard { position: sticky; bottom: 0; top: auto; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 8px 16px; margin: 0 -16px; border-width: 1px 0 0; border-radius: 0; }
  .sb-total { flex-direction: column; align-items: flex-start; gap: 0; padding: 0 14px 0 0; border-bottom: 0; border-right: 2px solid var(--ink); }
  .sb-label { font-size: .72rem; color: var(--text-2); }
  .sb-num b { font-size: 1.7rem; }
  .sb-num small { font-size: .75rem; }
  .sb-items { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sb-items li { border-bottom: 0; padding: 0; }
  .sb-row { flex-direction: column; font-size: .74rem; line-height: 1.35; }
  .bar, .sb-basis { display: none; }
}

/* result */
.res-total { display: flex; align-items: baseline; gap: 8px; padding: 14px 0 12px; border-bottom: 2px solid var(--ink); }
.res-total span { font-weight: 700; color: var(--ink); }
.res-total b { font-size: 2.8rem; line-height: 1; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; margin-left: auto; }
.res-total small { color: var(--text-2); }
.res-table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-variant-numeric: tabular-nums; }
.res-table th, .res-table td { padding: 9px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: right; font-size: .94rem; }
.res-table th:first-child, .res-table td:first-child { text-align: left; }
.res-table th { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.res-table tr.sum td { font-weight: 800; color: var(--ink); border-bottom: 0; }
.result h3 { font-size: 1rem; margin: 18px 0 8px; color: var(--ink); }
.basis-block { border-top: 1px solid var(--line); padding: 10px 0; }
.basis-block h4 { margin: 0 0 4px; font-size: .93rem; color: var(--ink); }
.reason, .warn { margin: 0; padding-left: 18px; font-size: .88rem; color: var(--text-2); }
.reason li, .warn li { margin: 3px 0; }
.warn { background: var(--warn-soft); border-left: 3px solid var(--warn); padding: 10px 12px 10px 30px; border-radius: 0 var(--r) var(--r) 0; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* check / deposit */
.page-head { margin: 4px 0 20px; }
.page-head h1 { margin: 0; font-size: clamp(1.45rem, 3.6vw, 1.95rem); line-height: 1.3; color: var(--ink); letter-spacing: -0.025em; }
.eyebrow { margin: 0 0 6px; font-size: .8rem; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.eyebrow a { text-decoration: none; }
.updated { margin: 8px 0 0; font-size: .84rem; color: var(--text-3); }
.lead { margin: 10px 0 0; color: var(--text-2); max-width: 720px; }
.card-title { margin: 0 0 12px; font-size: 1.05rem; color: var(--ink); }
.verdict { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-left: 4px solid var(--accent); border-radius: var(--r); font-weight: 700; color: var(--ink); }
.verdict.no { border-left-color: var(--bad); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist .mark { width: 22px; height: 22px; flex-shrink: 0; display: inline-grid; place-items: center; border-radius: 50%; font-size: .78rem; font-weight: 800; border: 1px solid var(--accent); color: var(--accent); }
.checklist li.no .mark { border-color: var(--bad); color: var(--bad); }
.checklist b { display: block; font-size: .93rem; color: var(--ink); font-weight: 600; }
.checklist small { display: block; font-size: .82rem; color: var(--text-2); }
.notes { margin: 12px 0 0; padding-left: 18px; font-size: .85rem; color: var(--text-2); }
.grid-form .field { margin-bottom: 16px; }
.grid-form.inline { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.big-answer { margin: 6px 0 16px; padding: 14px 16px; background: var(--accent-soft); border-radius: var(--r); font-size: 1.02rem; color: var(--ink); }
.big-answer strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.deposit-table td.hit { background: var(--accent-soft); color: var(--ink); font-weight: 800; box-shadow: inset 0 0 0 2px var(--accent); }

/* tables (prose + deposit) */
.table-wrap { overflow-x: auto; margin: 14px 0 18px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
caption { caption-side: bottom; text-align: left; font-size: .8rem; color: var(--text-3); padding-top: 8px; }
th, td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: left; }
thead th { background: var(--surface-2); color: var(--ink); font-weight: 700; white-space: nowrap; }
.deposit-table td { text-align: right; font-variant-numeric: tabular-nums; }

/* prose / doc */
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 900px) { .doc { grid-template-columns: 1fr; gap: 12px; } }
.toc { position: sticky; top: 16px; font-size: .86rem; border-left: 1px solid var(--line); padding-left: 14px; }
.toc p { margin: 0 0 6px; font-weight: 700; color: var(--ink); }
.toc ol { margin: 0; padding-left: 16px; color: var(--text-2); }
.toc li { margin: 4px 0; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 900px) { .toc { position: static; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); } }
.prose { max-width: 760px; font-size: 1.01rem; }
.prose.narrow { margin-top: 28px; }
.prose h2 { margin: 36px 0 12px; font-size: 1.32rem; line-height: 1.4; color: var(--ink); letter-spacing: -0.02em; padding-top: 14px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 24px 0 8px; font-size: 1.08rem; color: var(--ink); }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose code { font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
.callout { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--r) var(--r) 0; font-size: .95rem; }
.callout p { margin: 4px 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.faq details > div { padding-top: 8px; color: var(--text); }
.cta-line { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.pager a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); background: var(--surface); font-weight: 600; font-size: .92rem; }
.pager a small { display: block; color: var(--text-3); font-weight: 500; font-size: .78rem; }
.pager a.next { text-align: right; grid-column: 2; }
.pager a:hover { border-color: var(--accent); }

/* guides hub */
.guide-group { margin: 0 0 28px; }
.guide-group h2 { font-size: 1.05rem; color: var(--ink); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.guide-card { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; color: var(--text); }
.guide-card:hover { border-color: var(--accent); }
.guide-card b { display: block; color: var(--ink); font-size: .98rem; line-height: 1.4; margin-bottom: 6px; }
.guide-card span { display: block; font-size: .86rem; color: var(--text-2); line-height: 1.55; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0 40px; font-size: .88rem; color: var(--text-2); }
.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:nth-child(2) { grid-column: 1 / -1; order: 3; } }
.site-footer h2 { font-size: .82rem; color: var(--ink); margin: 0 0 8px; letter-spacing: .02em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 5px 0; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.foot-basis, .foot-note { margin: 22px 0 0; font-size: .8rem; line-height: 1.6; }
.foot-note { margin-top: 6px; }
.copyright { margin: 14px 0 0; font-size: .78rem; color: var(--text-3); }

/* ads (§4-1: 래퍼에 border-radius·overflow 금지) */
.ad-wrap { margin: 32px auto 0; }
.ad-grid { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 672px; margin: 0 auto; }
.ad-grid[data-ad-layout="mixed"] { max-width: 780px; }
.ad-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.ad-cell { max-width: 100%; }
.ad-row.ad-mo { display: none; }
.ad-row.ad-pc { display: flex; }
.ad-row.ad-any { display: flex; }
@media (max-width: 719px) {
  .ad-row.ad-pc { display: none; }
  .ad-row.ad-mo { display: flex; }
}

/* print */
@media print {
  :root { --bg: #fff; --surface: #fff; }
  .site-header, .ribbon, .site-footer, .ad-wrap, .stepper, .nav-row, .actions, #shareMsg, .skip, .scoreboard { display: none !important; }
  .tool { display: block; }
  .wizard { border: 0; }
  .step[hidden] { display: none !important; }
  .step.result { display: block !important; }
  body { font-size: 12pt; }
  .warn { background: none; }
}
