:root {
  --bg: #f4f6f9; --card: #fff; --fg: #191f28; --sub: #4e5968; --muted: #8b95a1; --line: #e5e8eb;
  --accent: #3182f6; --accent-ink: #1b64da; --accent-soft: #e8f3ff;
  --c-nat: #3182f6; --c-sido: #12b886; --c-sgg: #f59f00;
  --warn: #f04452; --warn-soft: #ffeeee; --ok: #0e9f6e; --draft: #fff3bf;
  --t0: #eef4fe; --t1: #d3e5fd; --t2: #a9cdfb; --t3: #6eaaf8; --t4: #3182f6; --t5: #1957c2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101318; --card: #1a1e25; --fg: #eef0f3; --sub: #b0b8c1; --muted: #7e8896; --line: #2b313a;
    --accent-ink: #6fa8ff; --accent-soft: #17283f; --warn-soft: #3a1c20; --ok: #34d399; --draft: #4a3b00;
    --t0: #18202c; --t1: #1c2d45; --t2: #213f68; --t3: #275496; --t4: #2f6fd6; --t5: #4a90f7;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.5; word-break: keep-all;
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
button { font: inherit; }
a { color: var(--accent-ink); }
[hidden] { display: none !important; }
main, .site-header, .site-footer { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.site-header { padding-top: 14px; padding-bottom: 14px; }
.logo { font-weight: 800; font-size: 17px; color: var(--fg); text-decoration: none; }
.logo span { color: var(--accent); }
.site-footer { margin-top: 40px; padding-top: 16px; padding-bottom: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-footer a { color: var(--sub); }
.draft-banner { margin: 0; padding: 8px 16px; background: var(--draft); text-align: center; font-size: 14px; }
.crumbs { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.crumbs a { color: var(--sub); text-decoration: none; }
.note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.unk { color: var(--muted); }

/* ---- 검색 ---- */
.hero { padding: 32px 0 8px; }
.hero h1 { font-size: 30px; line-height: 1.3; margin: 0 0 10px; letter-spacing: -0.02em; }
.hero p.lead { margin: 0 0 24px; color: var(--sub); font-size: 17px; }
.search { position: relative; }
.search input { width: 100%; font: inherit; font-size: 18px; padding: 18px 20px 18px 52px; border-radius: 16px; border: 2px solid transparent;
  background: var(--card); color: var(--fg); box-shadow: 0 2px 12px rgba(0,0,0,.06); outline: none; }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search.compact input { font-size: 16px; padding: 12px 16px 12px 44px; border-radius: 12px; }
.search.compact svg { left: 14px; }
.ac { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--card);
  border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.14); max-height: 360px; overflow: auto; }
.ac-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; cursor: pointer; }
.ac-item:hover, .ac-item.on { background: var(--accent-soft); }
.ac-item small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.ac-amt { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-head { padding: 8px 14px 4px; font-size: 13px; color: var(--muted); }
.ac-empty { padding: 14px; color: var(--sub); font-size: 15px; }
.hint { margin: 12px 4px 0; font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 0; background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 600; cursor: pointer; text-decoration: none; }
.label { font-size: 13px; color: var(--muted); margin: 22px 4px 0; font-weight: 600; }
.sticky { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0; }

/* ---- 카드 공통 ---- */
.card { background: var(--card); border-radius: 20px; padding: 22px; margin: 12px 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card h2 { font-size: 18px; margin: 0; }
.desc { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.seg button { font-size: 15px; border: 0; background: transparent; color: var(--sub); padding: 8px 13px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--fg); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.seg.sm button { font-size: 13px; padding: 6px 9px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--sub); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--fg); font-variant-numeric: tabular-nums; }
.baseline { margin: 12px 0 0; padding: 16px 18px; border-radius: 14px; background: var(--card); color: var(--sub); font-size: 15px; }
.baseline b { color: var(--fg); }

/* ---- 지도 + 순위 ---- */
.mapcard { margin-top: 22px; }
.maplayout { display: grid; grid-template-columns: 300px 1fr; gap: 22px; margin-top: 18px; align-items: start; }
.map { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.tile { aspect-ratio: 1 / 0.92; min-width: 0; overflow: hidden; border-radius: 10px; border: 2px solid transparent; padding: 6px; display: flex;
  flex-direction: column; justify-content: space-between; color: var(--fg); text-decoration: none; transition: transform .12s; }
.tile b { font-size: 15px; }
.tile small { font-size: 10.5px; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .9; }
.tile.dark { color: #fff; }
.tile.sel { border-color: var(--fg); box-shadow: 0 2px 10px rgba(0,0,0,.15); }
a.tile:hover { transform: translateY(-2px); }
.tile.off { background: var(--bg); color: var(--muted); }
.t0 { background: var(--t0); } .t1 { background: var(--t1); } .t2 { background: var(--t2); }
.t3 { background: var(--t3); } .t4 { background: var(--t4); } .t5 { background: var(--t5); }
.scale { display: flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.scale i { width: 20px; height: 8px; border-radius: 3px; display: inline-block; }
.scale span { margin: 0 4px; }
.rank-group + .rank-group { margin-top: 22px; }
.rank-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rank-head h3 { margin: 0; font-size: 16px; }
.rank-head h3 a { color: inherit; text-decoration: none; }
.rank-head span { font-size: 13px; color: var(--muted); }
.rank { list-style: none; margin: 10px 0 0; padding: 0; }
.rank a { display: grid; grid-template-columns: 18px 84px 1fr 84px 10px; align-items: center; gap: 10px; padding: 9px 8px; color: var(--fg);
  border-radius: 10px; text-decoration: none; font-size: 15px; }
.rank a:hover { background: var(--accent-soft); }
.rank .no { color: var(--muted); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.rank .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--bg); }
.track i { height: 100%; display: block; }
.rank .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.rank .go { color: var(--muted); }
.more { margin-top: 6px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: var(--bg); color: var(--sub); cursor: pointer; font-size: 14px; }
.rank-legend { margin-top: 12px; font-size: 13px; }

/* ---- 지역 요약 ---- */
.region-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.region-head h1 { margin: 0; font-size: 22px; line-height: 1.35; }
.region-head h1 small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }
.region-head .crumb { color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; }
.horizon { font: inherit; font-size: 14px; color: var(--sub); border: 0; background: transparent; margin-left: 4px; cursor: pointer; }
.big { margin: 20px 0 4px; font-size: 15px; color: var(--sub); }
.big strong { display: block; font-size: 40px; color: var(--fg); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 14px 0 10px; background: var(--line); }
.stack i { height: 100%; display: block; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key { padding: 14px; border-radius: 14px; background: var(--bg); text-align: left; border: 0; color: var(--fg); }
.key .k { font-size: 13px; color: var(--muted); }
.key .v { font-size: 16px; font-weight: 700; margin-top: 4px; }
.key .s { font-size: 13px; color: var(--sub); margin-top: 2px; }
a.key { text-decoration: none; display: block; }
.key.urgent { background: var(--warn-soft); }
.key.urgent .v { color: var(--warn); }

/* ---- 나이별 막대 ---- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 22px; margin-top: 18px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; cursor: pointer; position: relative; min-width: 0;
  border: 0; background: transparent; padding: 0; }
.bar .s { width: 100%; display: block; transition: opacity .15s; }
.bar .s.top { border-radius: 6px 6px 0 0; }
.bar:not(.sel) .s { opacity: .35; }
.bar:hover .s { opacity: .8; }
.bar .amt { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar.sel .amt { color: var(--accent-ink); font-weight: 700; font-size: 12px; }
.xlabels { display: flex; gap: 6px; margin-top: 6px; }
.xlabels span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); min-width: 0; }
.xlabels span.sel { color: var(--accent-ink); font-weight: 700; }
.age-legend { margin-top: 12px; font-size: 13px; }
.agebox { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.agepanel { background: var(--bg); border-radius: 16px; padding: 16px 18px; min-width: 0; }
.agepanel .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.age-now { font-size: 24px; font-weight: 800; margin: 2px 0 8px; letter-spacing: -0.01em; }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 0; }
.ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.direct { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.direct .k { margin-bottom: 8px; }
.direct-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.direct-grid .dk { font-size: 14px; color: var(--sub); white-space: nowrap; }
.direct-grid input[type=date] { width: 100%; min-width: 0; }
.direct-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.direct-row label { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: var(--sub); }
.field { font: inherit; font-size: 15px; padding: 9px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--fg); outline: none; }
.field:focus { border-color: var(--accent); }
.field.num { width: 58px; text-align: right; font-variant-numeric: tabular-nums; }
.age-hint { font-size: 13px; color: var(--accent-ink); margin: 8px 0 0; min-height: 1.5em; }
.month-total { font-size: 14px; color: var(--sub); }
.month-total strong { display: block; font-size: 30px; color: var(--fg); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.month-items { list-style: none; padding: 0; margin: 10px 0 0; }
.month-items li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.month-items .tag { font-size: 12px; color: var(--muted); display: block; }
.month-items b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.month-items i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.year-sum { font-size: 13px; color: var(--muted); margin-top: 10px; }
.year-sum b { color: var(--fg); }

/* ---- 할 일 ---- */
.todo-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.progress { height: 6px; background: var(--bg); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.notice { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; flex-wrap: wrap; }
.notice button, .btn { border: 0; background: var(--accent); color: #fff; font-weight: 700; padding: 8px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.btn { padding: 12px 16px; border-radius: 12px; font-size: 15px; }
.move { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--sub); flex-wrap: wrap; }
.phase { margin: 24px 2px 8px; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.phase span { font-size: 13px; color: var(--muted); font-weight: 400; }
.todo { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 16px; border-radius: 16px; background: var(--bg); margin: 8px 0; }
.todo.checked { opacity: .5; }
.todo.checked .prog-name { text-decoration: line-through; }
.todo input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); margin: 2px 0 0; cursor: pointer; }
.todo .prog-amt { font-size: 17px; color: var(--accent-ink); }
.due { display: inline-block; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); }
.due.rel { background: transparent; padding: 0; }
.due.past { background: var(--line); color: var(--sub); }
.ok { color: var(--ok); font-weight: 600; }
.ng { color: var(--warn); font-weight: 600; }
.plain { background: var(--bg); border-radius: 16px; padding: 4px 16px; }
.plain ul { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.plain li:last-child { border-bottom: 0; }
.plain .w { color: var(--muted); flex: 0 0 76px; font-variant-numeric: tabular-nums; }
.plain .n { flex: 1; }
.plain b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 8px; margin-top: 18px; }

/* ---- 지원금 카드 ---- */
h2.sec { font-size: 20px; margin: 36px 4px 0; }
h3.grp { font-size: 16px; margin: 20px 4px 2px; }
.sec-sub { margin: 0 4px 10px; color: var(--muted); font-size: 14px; }
.prog { background: var(--card); border-radius: 18px; padding: 18px 20px; margin: 10px 0; }
.prog-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.prog-name { font-weight: 700; font-size: 17px; margin: 0; }
.prog-name small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin-bottom: 4px; }
.badge.national { color: var(--c-nat); background: color-mix(in srgb, var(--c-nat) 14%, transparent); }
.badge.sido { color: var(--c-sido); background: color-mix(in srgb, var(--c-sido) 14%, transparent); }
.badge.sigungu { color: var(--c-sgg); background: color-mix(in srgb, var(--c-sgg) 16%, transparent); }
.badge.plain-badge { color: var(--sub); background: var(--line); }
.prog-amt { font-size: 20px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: 52px 1fr; gap: 6px 10px; margin: 12px 0 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts .warn { color: var(--warn); font-weight: 600; }
.unverified { background: var(--draft); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; color: var(--sub); font-size: 14px; }
details p { margin: 8px 0 0; font-size: 14px; color: var(--sub); }
.siblings { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.siblings a { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--card); border-radius: 12px; color: var(--fg); text-decoration: none; }
.siblings a:hover { outline: 2px solid var(--accent); }
.siblings span { color: var(--accent-ink); font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- 광고·제휴 ---- */
/* 광고 자리는 높이를 미리 잡아 둬서 광고가 늦게 떠도 화면이 밀리지 않게 한다(CLS). */
.ad { margin: 20px 0; min-height: 120px; text-align: center; }
.ad .adsbygoogle { min-height: 100px; }
.ad-label { display: inline-block; font-size: 11px; color: var(--muted); letter-spacing: .02em; margin-bottom: 4px; }
.ad-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 28px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 14px; }
.ad-placeholder small { font-size: 12px; }
.affiliate { margin: 28px 0; padding: 18px; background: var(--card); border-radius: 16px; }
.affiliate-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.affiliate-head h2 { margin: 0 0 10px; font-size: 17px; }
.affiliate ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.affiliate li a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--fg); text-decoration: none; }
.affiliate li a:hover { border-color: var(--accent); }
.affiliate li a span { font-size: 14px; color: var(--sub); }
.affiliate-disc { margin: 4px 2px 0; font-size: 12px; color: var(--muted); }
.affiliate-label { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* ---- 공유·기준일 ---- */
.share-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.updated { font-size: 13px; color: var(--muted); }
.share { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--fg); font-size: 14px; font-weight: 600; cursor: pointer; }
.share:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---- FAQ ---- */
.faq h2 { margin: 0 0 6px; font-size: 18px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.5; }
.faq summary::after { content: "+"; flex: none; color: var(--muted); font-size: 18px; line-height: 1.2; }
.faq details[open] summary::after { content: "−"; }
.faq details p { font-size: 15px; line-height: 1.7; }

/* ---- 메인: 전국 공통 ---- */
.natlist { list-style: none; margin: 10px 0 0; padding: 0; }
.natlist li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.natlist li:first-child { border-top: 0; }
.natlist li div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.natlist li span { font-size: 14px; color: var(--sub); }
.natlist strong { white-space: nowrap; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* ---- 문의 ---- */
.contact-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 16px 0 8px; }
.contact-way { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; }
.contact-way:hover { border-color: var(--accent); }
.contact-way span { font-size: 14px; color: var(--sub); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 6px; }

/* ---- 글 페이지 ---- */
.prose { background: var(--card); border-radius: 20px; padding: 24px; margin-top: 12px; }
.prose h1 { font-size: 26px; line-height: 1.3; margin: 0 0 12px; }
.prose h2 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { max-width: 68ch; line-height: 1.7; }
.prose .lead { font-size: 17px; color: var(--sub); }
.page-title { font-size: 26px; margin: 24px 0 8px; }

@media (max-width: 680px) {
  .maplayout { grid-template-columns: 1fr; }
  .map { max-width: 360px; }
  .agebox { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 25px; }
  .keys { grid-template-columns: 1fr; }
  .todo-sum .key { padding: 10px; }
  .todo-sum .key .v { font-size: 15px; }
  .big strong { font-size: 34px; }
  .card, .prose { padding: 18px; }
  .rank a { grid-template-columns: 16px 72px 1fr 76px; padding: 9px 4px; gap: 8px; }
  .rank .go { display: none; }
  .bar .amt { display: none; }
  .bar.sel .amt { display: block; }
  .facts { grid-template-columns: 40px 1fr; }
  .seg button { padding: 8px 10px; font-size: 14px; }
}
.lv-national { background: var(--c-nat); } .lv-sido { background: var(--c-sido); } .lv-sigungu { background: var(--c-sgg); }
@media (max-width: 380px) {
  .todo-sum { gap: 6px; }
  .todo-sum .key .k, .todo-sum .key .s { font-size: 12px; }
}
