:root {
  --bg: #f7faf7; --card: #fff; --ink: #1b2a22; --sub: #5b6b62; --line: #e3ebe5;
  --green: #16a34a; --green-d: #0f7a37; --green-l: #e8f6ed; --sun: #f59e0b; --sun-l: #fff4dc; --red: #dc2626;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--green-d); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.logo { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -0.5px; white-space: nowrap; }
.logo .leaf { margin-right: 4px; }
.top nav { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; }
.top nav a { color: var(--sub); text-decoration: none; font-size: 14px; white-space: nowrap; }
.top nav a:hover { color: var(--green-d); }

main { padding-top: 8px; padding-bottom: 40px; }
.hero { padding: 28px 0 12px; }
.hero h1 { font-size: 28px; line-height: 1.35; margin: 0 0 10px; letter-spacing: -0.8px; }
.hero p { color: var(--sub); margin: 0; }
.hero b { color: var(--green-d); }

.finder { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 16px 0 24px; box-shadow: 0 4px 18px rgba(22,163,74,.06); display: grid; gap: 14px; }
.finder label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.finder small { font-weight: 400; color: var(--sub); font-size: 12.5px; }
.finder input[type=number], .finder select { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; min-height: 44px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.chip { display: inline-flex !important; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; font-size: 14px; cursor: pointer; background: #fff; user-select: none; }
.chip input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.chip input:focus-visible + span { outline: 2px solid var(--green-d); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--green); color: var(--green-d); background: #fff; text-decoration: none; cursor: pointer; min-height: 48px; }
.btn.main { background: var(--green); color: #fff; }
.btn.main:hover { background: var(--green-d); }
.btn.wide { width: 100%; }
.btns { display: grid; gap: 10px; margin: 18px 0 8px; }

.result h2 { font-size: 20px; margin: 8px 0 12px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.tabs button { font: inherit; font-size: 14px; white-space: nowrap; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.warn { color: var(--sub); font-size: 13px; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: var(--ink); text-decoration: none; }
.card a:hover { border-color: var(--green); }
.card strong { display: block; font-size: 16.5px; line-height: 1.45; margin: 6px 0 4px; }
.card p { margin: 0; color: var(--sub); font-size: 14px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .why { color: var(--green-d); font-size: 12.5px; margin-top: 6px; -webkit-line-clamp: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 5px; }
.b { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #f0f3f1; color: var(--sub); line-height: 1.6; }
.b.f { background: var(--green-l); color: var(--green-d); }
.b.dl { background: var(--sun-l); color: #9a5b00; font-weight: 700; }
.b.dl.hot { background: #fde8e8; color: var(--red); }

.more { margin-top: 32px; }
.more h2, .sub { font-size: 19px; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; }
.more .all { font-size: 14px; font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 20px; }
.grid a { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); font-size: 14.5px; }
.grid a small { color: var(--sub); }

.crumb { font-size: 13px; color: var(--sub); margin: 12px 0; }
.crumb a { color: var(--sub); }
.detail h1 { font-size: 25px; line-height: 1.4; margin: 10px 0 8px; letter-spacing: -0.6px; }
.notice { background: #fff8e6; border: 1px solid #f5d98b; border-radius: 10px; padding: 10px 14px; font-size: 14px; color: #6b5413; margin: 0 0 14px; }
.small { font-size: 13px; color: #5b6b62; }
.aka { margin: -4px 0 10px; font-size: 14px; color: #5b6b62; }
.lead { font-size: 17px; color: #33443a; margin: 0 0 16px; }
.glance { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin: 0; padding: 6px 16px; }
.glance div { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.glance div:last-child { border-bottom: 0; }
.glance dt { font-weight: 700; color: var(--green-d); }
.glance dd { margin: 0; }
.check { background: var(--green-l); border-radius: 10px; padding: 10px 14px; font-size: 14.5px; }
.detail section { margin-top: 28px; }
.detail h2, .prose h2 { font-size: 19px; margin: 0 0 10px; padding-left: 10px; border-left: 4px solid var(--green); line-height: 1.4; }
.txt p { margin: 0 0 8px; }
.txt p.l1 { padding-left: 16px; position: relative; font-weight: 600; margin-top: 12px; }
.txt p.l1::before { content: ""; position: absolute; left: 3px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.txt p.l2 { padding-left: 28px; position: relative; }
.txt p.l2::before { content: "–"; position: absolute; left: 14px; color: var(--sub); }
.txt p.note { font-size: 14px; color: var(--sub); background: #f3f5f4; padding: 6px 10px; border-radius: 8px; }
.plain { padding-left: 20px; margin: 0; }
.updated { color: var(--sub); font-size: 12.5px; margin-top: 28px; }
.ph { font-size: 25px; margin: 18px 0 8px; letter-spacing: -0.6px; }
.intro { color: var(--sub); margin: 0 0 18px; }
.empty { color: var(--sub); }
.prose h2 { margin-top: 26px; }

.foot { border-top: 1px solid var(--line); background: #fff; color: var(--sub); font-size: 13px; padding: 20px 0 32px; }
.foot .src { line-height: 1.6; }
.foot .links { display: flex; gap: 14px; flex-wrap: wrap; }
.foot a { color: var(--sub); }

@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
  .detail h1, .ph { font-size: 22px; }
  .top nav { gap: 10px; }
  .top nav a { font-size: 13px; }
}
.pf { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 4px; margin: 0 0 12px; }
.pf .tabs { flex-wrap: wrap; overflow: visible; padding-bottom: 10px; }
.pf-h { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--sub); }
.pf .tabs small { color: inherit; opacity: .6; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px; }
/* 계산기 */
.result .big { font-size: 20px; margin: 4px 0; }
.result .big b { color: var(--green-d); font-size: 28px; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.bar span { display: block; height: 100%; background: var(--green); width: 0; transition: width .3s; }
.levels { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 4px; }
.levels li { display: grid; grid-template-columns: 1fr auto 44px; gap: 8px; padding: 7px 10px; border-radius: 8px; background: #f3f5f4; font-size: 14px; color: var(--sub); }
.levels li.ok { background: var(--green-l); color: var(--ink); }
.levels li em { font-style: normal; font-weight: 700; text-align: right; }
.levels li.ok em { color: var(--green-d); }
.tbl { overflow-x: auto; margin: 8px 0; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 14px; background: #fff; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 6px 8px; text-align: right; white-space: nowrap; }
.tbl th { background: #f3f5f4; text-align: center; }
.incomebox { background: var(--sun-l); border-radius: var(--r); padding: 14px 16px; margin: 16px 0; }
.incomebox h2 { font-size: 17px; margin: 0 0 6px; border: 0; padding: 0; }
.mc { background: var(--green-l); border-radius: 10px; padding: 10px 12px; font-weight: 400; }
.mc summary { cursor: pointer; font-weight: 700; color: var(--green-d); font-size: 14.5px; }
.mc .row2 { margin-top: 10px; }
.mc input, .mc select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff; }
.mres { margin: 8px 0 0; }
.finder input[type=date] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; min-height: 44px; box-sizing: border-box; }
.finder input[type=number] { box-sizing: border-box; }
.lf-s { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; margin-bottom: 10px; }
.cards li[hidden] { display: none; }
/* 가이드 */
.guide .byline { color: var(--sub); font-size: 13px; margin: 4px 0 14px; }
.guide .answer { background: var(--green-l); border-radius: var(--r); padding: 14px 16px; margin: 0 0 14px; }
.guide .answer p { margin: 0; }
.guide .eyebrow { font-size: 12px; font-weight: 700; color: var(--green-d); letter-spacing: .04em; margin: 0 0 4px; }
.guide .calc-cta { margin: 0 0 14px; }
.guide .toc { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin: 0 0 18px; background: var(--card); }
.guide .toc ol { margin: 0; padding-left: 20px; }
.guide .toc a { color: var(--ink); }
.guide .prose h3 { font-size: 16px; margin: 16px 0 4px; }
.guide .sources { margin-top: 22px; }
.guide .sources h2 { font-size: 16px; }
.guide .howmade { font-size: 13px; color: var(--sub); background: #f3f5f4; border-radius: 10px; padding: 10px 12px; margin-top: 14px; }
.guide .gimg { margin: 16px 0 18px; }
.guide .gimg img { display: block; width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); }

/* 지원금 찾기 바로가기(위쪽 메뉴 줄이면서 옮김) */
.subnav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 14px 0 4px; padding-bottom: 2px; }
.subnav a { flex: none; font-size: 13.5px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--sub); text-decoration: none; white-space: nowrap; }
.subnav a.on, .subnav a:hover { background: var(--green-l); color: var(--green-d); border-color: var(--green); }

/* 동네 지원금 비교표 */
.tscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); margin: 12px 0 20px; }
table.cmp { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 560px; }
table.cmp th, table.cmp td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
table.cmp thead th { background: var(--green-l); color: var(--green-d); font-weight: 700; position: sticky; top: 0; }
table.cmp td.hi { color: var(--green-d); font-weight: 800; }
table.cmp tr:last-child td { border-bottom: 0; }
table.cmp.wrap td { white-space: normal; text-align: left; }
table.cmp.wrap td:first-child { white-space: nowrap; }
.note { color: var(--sub); font-size: 13px; }
