/* 첫 화면·소개·개인정보처리방침 등 글 페이지 공용 스타일 (계산기 페이지는 자체 스타일) */
:root {
  --bg: #f6f8f6; --surface: #ffffff; --text: #17201a; --muted: #5b6a5f; --border: #d9e2da;
  --brand: #1b5e20; --brand-soft: #e3f0e4; --on-brand: #ffffff; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1411; --surface: #171e19; --text: #e6ede7; --muted: #9db0a1; --border: #2c382f;
    --brand: #81c784; --brand-soft: #1f3322; --on-brand: #0d1f0f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1411; --surface: #171e19; --text: #e6ede7; --muted: #9db0a1; --border: #2c382f;
  --brand: #81c784; --brand-soft: #1f3322; --on-brand: #0d1f0f; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; }
a { color: var(--brand); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 40px; }

header.site { border-bottom: 1px solid var(--border); background: var(--surface); }
header.site .bar { max-width: 720px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.logo { font-weight: 800; color: var(--brand); text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
header.site nav { display: flex; align-items: center; gap: 12px; font-size: 14px; }
header.site nav a { text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
header.site nav a:hover { color: var(--brand); }
header.site nav a.nav-app { color: var(--brand); background: var(--brand-soft); padding: 5px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
header.site nav a.nav-app:hover { opacity: .88; }

h1 { font-size: clamp(26px, 6vw, 34px); margin: 32px 0 8px; letter-spacing: -.02em; line-height: 1.3; }
h2 { font-size: 21px; margin: 36px 0 10px; letter-spacing: -.01em; }
h3 { font-size: 17px; margin: 22px 0 6px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.asof { display: inline-block; font-size: 13px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 2px 10px; border-radius: 999px; }

.tools { display: grid; gap: 12px; margin: 20px 0 8px; }
a.tool { display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px; transition: border-color .15s; }
a.tool:hover, a.tool:focus-visible { border-color: var(--brand); }
a.tool h2 { margin: 0 0 4px; font-size: 18px; }
a.tool p { margin: 0; color: var(--muted); font-size: 15px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 4px 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 6px; min-width: 7em; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
ol, ul { padding-left: 22px; }
li { margin: 4px 0; }
.note { font-size: 14px; color: var(--muted); }

.cta { margin-top: 32px; background: var(--brand); color: var(--on-brand); border-radius: 16px; padding: 20px; }
.cta h2 { margin: 0 0 4px; font-size: 18px; }
.cta p { margin: 0 0 14px; opacity: .9; font-size: 14px; }
.cta a { display: inline-block; background: var(--on-brand); color: var(--brand); font-weight: 800; text-decoration: none; padding: 12px 18px; border-radius: 12px; }
.cta a.cta-sub-link { display: inline-block; margin-left: 12px; margin-top: 8px; background: transparent; color: var(--on-brand); padding: 6px 2px; font-weight: 600; font-size: 13px; text-decoration: underline; opacity: .9; }

.result-cta { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.result-cta-text { flex: 1 1 220px; font-size: 14px; line-height: 1.5; color: var(--text); }
.result-cta a { display: inline-block; background: var(--brand); color: var(--on-brand); text-decoration: none; font-weight: 700; font-size: 13px; padding: 8px 13px; border-radius: 10px; white-space: nowrap; }
.result-cta a:hover { opacity: .9; }

.ios-sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; }
.ios-sheet-backdrop[hidden] { display: none; }
.ios-sheet { width: 100%; max-width: 380px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.ios-sheet h3 { margin: 0 0 8px; font-size: 18px; }
.ios-sheet p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.ios-sheet ol { margin: 0 0 16px; padding-left: 20px; font-size: 14px; }
.ios-sheet-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ios-sheet-sub { font-size: 13px; color: var(--muted); text-decoration: underline; }
.ios-sheet-close { border: 0; background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 10px; cursor: pointer; }

footer.site { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* ---------- 계산기 (중도상환·대환·부대비용 페이지) ---------- */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin: 20px 0 12px; }
.calc h2 { font-size: 17px; margin: 0 0 14px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.fields .full { grid-column: 1 / -1; }
.field { min-width: 0; }
.label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 0 12px; }
.input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input input, .input select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 17px; font-weight: 600; padding: 10px 0; text-align: right; font-variant-numeric: tabular-nums; }
.input select { text-align: left; font-size: 16px; appearance: none; cursor: pointer; }
.input .unit { color: var(--muted); font-size: 14px; margin-left: 6px; white-space: nowrap; }
.korean { font-size: 12px; color: var(--muted); text-align: right; min-height: 18px; margin-top: 2px; }
fieldset { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 14px; padding: 8px 4px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; line-height: 1.3; }
.seg input:checked + label { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 4px 0 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.result { border-top: 1px dashed var(--border); padding-top: 16px; margin-top: 4px; }
.result .k { font-size: 14px; color: var(--muted); font-weight: 600; }
.big { font-size: clamp(28px, 7vw, 36px); font-weight: 800; letter-spacing: -.03em; line-height: 1.25; color: var(--brand); font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.big.loss { color: #b42318; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .big.loss { color: #f28b82; } }
:root[data-theme="dark"] .big.loss { color: #f28b82; }
.verdict { padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; background: var(--brand-soft); margin: 8px 0 4px; }
.rows { margin-top: 12px; }
.rows .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.rows .row:last-child { border-bottom: 0; }
.rows .row span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rows .row.total span { font-weight: 800; color: var(--brand); }
.chart { margin-top: 14px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .cap { font-size: 13px; color: var(--muted); margin-top: 4px; }
details.faq { border-bottom: 1px solid var(--border); padding: 12px 0; }
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq p { margin: 8px 0 0; color: var(--muted); }

/* ---------- 가이드 글 ---------- */
.crumb { margin: 24px 0 -16px; font-size: 14px; }
.crumb a { text-decoration: none; font-weight: 600; }
.assume { margin: 16px 0 8px; font-size: 15px; }
.assume p { margin: 10px 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: normal; }
@media (max-width: 480px) {
  header.site nav { gap: 8px; font-size: 13px; }
  header.site nav a.nav-app { padding: 4px 8px; font-size: 12px; }
  .card { padding: 2px 10px; }
  table { font-size: 13px; }
  th, td { padding: 8px 4px; min-width: 0; }
  th { font-size: 12px; }
  td:first-child { min-width: 5.5em; }
}
