/* 고향기부 계산기 — 40대 이상 휴대폰 사용자 기준: 큰 글자(본문 18px), 진한 대비, 48px 이상 누르는 칸, 한 줄 세로 흐름 */
:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --fg: #111a15;
  --muted: #3f4a44;
  --line: #cfd8d2;
  --pine: #17513d;
  --pine-soft: #e2efe8;
  --straw: #9a5d00;
  --straw-soft: #fbefd9;
  --warn: #a3260b;
  --warn-soft: #fde9e1;
  --radius: 16px;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101512; --surface: #18201b; --fg: #f1f5f2; --muted: #c2ccc6; --line: #34403a;
    --pine: #7fd3b0; --pine-soft: #1d3a2e; --straw: #f2c06a; --straw-soft: #3a2d14;
    --warn: #ffab8c; --warn-soft: #3f2219;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 18px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--pine); text-underline-offset: 3px; }
.wrap { max-width: 640px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

header.top { padding-block: 16px 0; display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 800; font-size: 19px; color: var(--pine); text-decoration: none; }
.badge { font-size: 15px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--muted); }

h1 { font-size: clamp(27px, 7.4vw, 34px); line-height: 1.32; letter-spacing: -0.03em; margin: 14px 0 6px; text-wrap: balance; }
h2 { font-size: 23px; line-height: 1.35; letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
.lede { color: var(--muted); margin: 0 0 16px; }
section { padding-block: 36px 0; }
.small { font-size: 16px; color: var(--muted); margin: 0; }

/* 계산기 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; }
.calc { display: grid; gap: 22px; }
.qtitle { display: block; font-weight: 800; font-size: 19px; margin-bottom: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select, input[type="number"] {
  width: 100%; min-width: 0; height: 56px; font: inherit; font-size: 18px; font-weight: 600; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg);
}
select:focus, input:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--pine); outline-offset: 2px; }
.nogo-line { margin: 10px 0 0; font-weight: 700; color: var(--warn); }
.nogo-line:empty { display: none; }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip { font: inherit; font-size: 18px; font-weight: 700; min-height: 54px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; padding: 0 6px; }
.chip[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }
.custom { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.custom label { font-weight: 700; white-space: nowrap; }
.custom input { flex: 1; text-align: right; }
.unit { font-weight: 700; white-space: nowrap; }
.error { color: var(--warn); font-size: 16px; margin: 8px 0 0; }

.result { background: var(--pine-soft); border-radius: 14px; padding: 18px; display: grid; gap: 12px; }
.result .head { font-weight: 700; }
.result .big { font-size: clamp(40px, 12vw, 50px); line-height: 1.1; font-weight: 800; color: var(--pine); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.lines { display: grid; gap: 4px; margin: 0; }
.lines div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.lines dt { color: var(--muted); }
.lines dd { margin: 0; font-weight: 800; text-align: right; }
.lines .net { border-top: 1.5px solid var(--line); padding-top: 8px; margin-top: 4px; }
.lines .net dd { color: var(--straw); }
.result .warn { font-size: 16px; font-weight: 600; color: var(--warn); margin: 0; }
.more-info summary { font-size: 17px; font-weight: 700; color: var(--pine); cursor: pointer; padding: 12px 0; }
.more-info .lines { font-size: 16px; margin-top: 6px; }
.toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 16px; padding: 6px 0; }
.toggle input { width: 24px; height: 24px; flex: none; margin: 2px 0 0; accent-color: var(--pine); }

.deadline { display: block; margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--straw-soft); color: var(--straw); font-weight: 800; text-align: center; }

/* 기부할 곳 */
.filters { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.filters .toggle { font-size: 17px; font-weight: 700; white-space: nowrap; }
.count { font-size: 16px; color: var(--muted); margin: 0 0 8px; }
.regions { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.regions li + li { border-top: 1px solid var(--line); }
.region { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 16px; text-decoration: none; color: var(--fg); }
.region .name { font-weight: 800; }
.region .sido { color: var(--muted); font-size: 16px; }
.region .tag { margin-left: auto; font-size: 15px; font-weight: 700; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.tag.dep { background: var(--pine-soft); color: var(--pine); }
.tag.int { background: var(--straw-soft); color: var(--straw); }
.tag.mine { background: var(--warn-soft); color: var(--warn); }
.region.blocked { opacity: 0.6; }
.btn { font: inherit; font-weight: 800; min-height: 54px; padding: 0 20px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; width: 100%; }
.btn.primary { background: var(--pine); border-color: var(--pine); color: #fff; }
#moreBtn { margin-top: 10px; }

/* 어디서·순서 */
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plain li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.plain b { display: block; font-size: 19px; }
.plain span { color: var(--muted); font-size: 17px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.steps li::before { counter-increment: s; content: counter(s); width: 34px; height: 34px; border-radius: 50%; background: var(--pine); color: #fff; font-weight: 800; display: grid; place-items: center; margin-top: 2px; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 17px; }

/* 질문 */
details.qa { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
details.qa + details.qa { margin-top: 8px; }
details.qa summary { font-weight: 800; cursor: pointer; padding: 16px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: "+"; font-size: 24px; line-height: 1; color: var(--pine); }
details.qa[open] summary::after { content: "−"; }
details.qa p { margin: 0; padding: 0 16px 16px; color: var(--muted); }

.deplist summary { font-weight: 800; cursor: pointer; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.deplist h3 { font-size: 18px; margin: 16px 0 2px; }
.deplist p { margin: 0; color: var(--muted); font-size: 17px; }

.share { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.copy-msg { grid-column: 1 / -1; text-align: center; font-size: 16px; color: var(--pine); margin: 0; }
footer { border-top: 1px solid var(--line); margin-top: 40px; padding-block: 20px 48px; font-size: 15px; color: var(--muted); }
footer p { margin: 0 0 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 380px) {
  .chip { font-size: 17px; }
  .filters { grid-template-columns: 1fr; }
}
