:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b2230;
  --muted: #5a6475;
  --line: #dde2ea;
  --brand: #1f4e8c;
  --brand-soft: #e8eef8;
  --accent: #b7791f;
  --warn-bg: #fff7e6;
  --warn-line: #f0d39a;
  --radius: 12px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141a;
    --surface: #191d25;
    --text: #e6ebe8;
    --muted: #a3ada7;
    --line: #2c3340;
    --brand: #8db4f2;
    --brand-soft: #1c2638;
    --accent: #e0a95a;
    --warn-bg: #2a2416;
    --warn-line: #5a4a26;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--brand); }
img { max-width: 100%; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 14px; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; padding-bottom: 12px; }
  .nav.open { display: flex; }
}

/* home */
.hero { padding: 48px 0 28px; }
.hero h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.3; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); max-width: 680px; margin: 0 0 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; background: var(--brand); color: #fff; text-decoration: none; padding: 10px 18px; border-radius: 10px; font-weight: 700; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
@media (prefers-color-scheme: dark) { .btn { color: #0e1522; } }
.m { display: none; }
@media (max-width: 520px) { .m { display: inline; } }
.section-title { font-size: 21px; margin: 36px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.tile span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.tile:hover, .card:hover { border-color: var(--brand); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.card strong { font-size: 17px; line-height: 1.45; }
.card-desc { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.badge { align-self: flex-start; font-size: 12.5px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; }
.about-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 16px; margin: 36px 0; }

/* article */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px clamp(16px, 4vw, 44px) 32px; margin: 24px 0; }
.page-head { margin: 28px 0 18px; }
.crumb { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.crumb a { color: var(--muted); }
.post h1, .page-head h1 { font-size: clamp(25px, 4vw, 33px); line-height: 1.35; margin: 0 0 10px; letter-spacing: -0.02em; }
.lead { color: var(--muted); font-size: 17.5px; margin: 0 0 12px; }
.meta { font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.toc { background: var(--brand-soft); border-radius: 10px; padding: 14px 20px; margin: 0 0 24px; }
.toc-title { font-weight: 800; margin: 0 0 4px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc a { color: var(--text); text-decoration: none; }
.prose h2 { font-size: 23px; margin: 40px 0 12px; padding-top: 8px; line-height: 1.4; scroll-margin-top: 80px; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 15.5px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; min-width: 90px; }
.prose th { background: var(--brand-soft); }
.tip, .note, .warn { border-radius: 10px; padding: 14px 18px; margin: 16px 0 20px; }
.tip { background: var(--brand-soft); border-left: 4px solid var(--brand); }
.note { background: var(--bg); border: 1px solid var(--line); }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.tip p:last-child, .note p:last-child, .warn p:last-child { margin-bottom: 0; }
.box-title { font-weight: 800; display: block; margin-bottom: 4px; }
.sources { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 15px; }
.sources-title { font-size: 16px; margin: 0 0 6px; }
.sources ul { margin: 0; padding-left: 20px; }
.disclaimer { margin-top: 18px; font-size: 14px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 12px 16px; }
.related-title { font-size: 19px; margin: 8px 0 12px; }
.related { margin-bottom: 32px; }

/* calculator */
.calc { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0 28px; background: var(--bg); }
.calc .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.calc label { display: flex; flex-direction: column; font-size: 14.5px; font-weight: 600; gap: 4px; }
.calc label small { font-weight: 400; color: var(--muted); }
.calc input, .calc select { font: inherit; font-size: 16px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; }
.calc input:focus { outline: 2px solid var(--brand); border-color: transparent; }
.calc button { font: inherit; font-weight: 700; border-radius: 8px; padding: 9px 16px; cursor: pointer; border: 1px solid var(--brand); }
.calc .primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .calc .primary { color: #0e1522; } }
.calc .secondary { background: transparent; color: var(--brand); }
.calc .actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.result { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.result:empty { display: none; }
.result .big { font-size: 26px; font-weight: 800; color: var(--brand); display: block; line-height: 1.3; }
.result table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 10px; }
.result td, .result th { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }
.result td.num, .result th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rows .row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
@media (max-width: 600px) { .rows .row { grid-template-columns: 1fr 1fr; } }
.good { color: var(--brand); font-weight: 700; }
.bad { color: #c0392b; font-weight: 700; }
@media (prefers-color-scheme: dark) { .bad { color: #ff8a7a; } }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; padding: 24px 0 32px; font-size: 14px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-links a { color: var(--text); text-decoration: none; }
.footer-note { line-height: 1.6; }

/* benefit finder */
.calc .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 14px; margin-top: 16px; }
.calc label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.calc label.check input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.finder { list-style: none; padding: 0; margin: 12px 0 0; }
.finder li { border-top: 1px solid var(--line); padding: 10px 0; line-height: 1.55; }
.finder small { color: var(--muted); }
.badge.soft { color: var(--accent); background: var(--warn-bg); }
