/* ============================================================
   연금공백 계산기 — 공통 스타일
   모바일 우선. 다크모드는 시스템 설정을 따른다.
   ============================================================ */
:root {
  /* ★ 바탕과 카드의 명도차가 7 이라 흑백에서 한 덩어리였다(2026-08-15 눈검사 미달 · WO-0046).
     바탕을 초록 쪽으로 한 단 눌러 흰 카드와 명도차 28 을 만든다 — 구조는 그대로다. */
  --bg: #dde6e2;
  --card: #ffffff;
  --line: #e4e7ec;
  --text: #14181f;
  --dim: #5b6472;
  /* 새 바탕 위에서 2.38:1 이던 값을 4.4:1 로 올린다(작은 글씨라 WCAG AA 4.5 를 겨눈다) */
  --faint: #5f6875;
  --brand: #0b6b53;
  --brand-weak: #e6f3ef;
  /* .btn 글자색 — 배경이 --brand 라 명암비가 여기서 갈린다.
     라이트는 흰 글자로 12.3:1, 다크는 밝은 --brand 위라 흰 글자면 2.27:1 로 떨어진다(WCAG AA 4.5 미달). */
  --btn-fg: #ffffff;
  --accent: #9c4708;   /* 새 바탕 위 3.94:1 → 4.97:1 */
  --accent-weak: #fdf1e5;
  --danger: #b42318;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1319;
    --card: #282f3b;
    --line: #2a323d;
    --text: #e9edf3;
    --dim: #a3adbb;
    --faint: #949fb0;
    --brand: #4bbf9c;
    --brand-weak: #12332a;
    --btn-fg: #08211a;
    --accent: #e79a4f;
    --accent-weak: #33240f;
    --danger: #f97066;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  }
  /* WO-0054 — 머리띠를 카드와 같은 면으로 합친다(위 주석 참조). 라이트는 반투명 그대로다. */
  :root .site-head { background: var(--card); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
}
img { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }

/* ── 레이아웃 ── */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 14px; height: 56px; }
.site-head .logo { font-weight: 800; letter-spacing: -.02em; color: var(--text); text-decoration: none; font-size: 17px; }
.site-head nav { margin-left: auto; display: flex; gap: 14px; font-size: 14px; }
.site-head nav a { color: var(--dim); text-decoration: none; }
.site-head nav a:hover { color: var(--brand); }
main { padding: 24px 0 48px; }
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 60px; color: var(--faint); font-size: 13px; }
.site-foot a { color: var(--dim); }
.site-foot .links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }

/* ── 타이포 ── */
h1 { font-size: 27px; line-height: 1.35; letter-spacing: -.03em; margin: 8px 0 12px; }
h2 { font-size: 21px; line-height: 1.4; letter-spacing: -.02em; margin: 40px 0 12px; padding-top: 4px; }
h3 { font-size: 17px; margin: 24px 0 8px; }
.lead { color: var(--dim); font-size: 16px; margin: 0 0 20px; }
.meta { color: var(--faint); font-size: 13px; margin: 0 0 24px; }
small, .small { font-size: 13px; color: var(--faint); }

/* ── 카드 ── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 16px 0;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ── 폼 ── */
.field { margin: 14px 0; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--faint); font-weight: 400; margin-left: 6px; }
input[type=number], input[type=text], select {
  width: 100%; padding: 11px 12px; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 84px; padding: 10px 8px; font-size: 14px; font-family: inherit;
  background: var(--bg); color: var(--dim); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
}
.seg button[aria-pressed=true] { background: var(--brand-weak); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.btn {
  display: inline-block; width: 100%; padding: 14px 18px; font-size: 16px; font-weight: 700;
  font-family: inherit; text-align: center; text-decoration: none;
  background: var(--brand); color: var(--btn-fg); border: 0; border-radius: 12px; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn.sub { background: transparent; color: var(--brand); border: 1px solid var(--brand); }

/* ── 결과 ── */
.result { display: none; }
.result.on { display: block; }
.big {
  font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.big.brand { color: var(--brand); }
.big.accent { color: var(--accent); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--bg); }
.panel.hi { border-color: var(--brand); background: var(--brand-weak); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-weak); color: var(--brand); }
.tag.acc { background: var(--accent-weak); color: var(--accent); }

/* ── 표 ── */
.tablewrap { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 540px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--bg); font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
caption { caption-side: bottom; text-align: left; color: var(--faint); font-size: 12px; padding-top: 8px; }

/* ── 체크리스트 · FAQ ── */
ul.check { list-style: none; padding: 0; margin: 12px 0; }
ul.check li { position: relative; padding: 7px 0 7px 28px; border-bottom: 1px dashed var(--line); }
ul.check li:before { content: '✓'; position: absolute; left: 4px; color: var(--brand); font-weight: 800; }
details.faq { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 10px 0; background: var(--card); }
details.faq summary { font-weight: 700; cursor: pointer; }
details.faq p { color: var(--dim); margin: 10px 0 2px; }

/* ── 알림 ── */
.note { border-left: 3px solid var(--brand); background: var(--brand-weak); padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 14px; margin: 16px 0; }
.note.warn { border-color: var(--accent); background: var(--accent-weak); }

/* ── 광고 · CTA 자리 ── */
.ad { margin: 24px 0; min-height: 1px; }
.ad:empty { display: none; }
.cta { margin: 20px 0; }
.cta a {
  display: flex; gap: 12px; align-items: center; text-decoration: none;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--card);
}
.cta a:hover { border-color: var(--brand); }
.cta .t { font-weight: 700; color: var(--text); }
.cta .d { font-size: 13px; color: var(--faint); }
.cta .go { margin-left: auto; color: var(--brand); font-weight: 700; }

/* ── 카드 링크(랜딩) ── */
.tools { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 20px 0; }
@media (min-width: 620px) { .tools { grid-template-columns: 1fr 1fr; } }
.tool {
  display: block; text-decoration: none; color: inherit; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.tool:hover { border-color: var(--brand); }
.tool .n { font-size: 12px; font-weight: 800; color: var(--brand); }
.tool .t { font-size: 18px; font-weight: 800; margin: 6px 0; letter-spacing: -.02em; }
.tool .d { font-size: 14px; color: var(--dim); }
.list { list-style: none; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list a { display: block; padding: 14px 2px; text-decoration: none; color: var(--text); font-weight: 600; }
.list a span { display: block; font-weight: 400; font-size: 13px; color: var(--faint); }
.list a:hover { color: var(--brand); }
