:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1d2320;
  --muted: #5d6762;
  --line: #e0ded6;
  --accent: #0f6b52;
  --accent-ink: #ffffff;
  --accent-soft: #e4f1ec;
  --warn-soft: #fdf3dc;
  --warn-ink: #6f4e07;
  --placeholder: #eeece5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --surface: #1d2320;
    --ink: #ecefec;
    --muted: #a3ada8;
    --line: #333b37;
    --accent: #58c4a2;
    --accent-ink: #0c1f19;
    --accent-soft: #1d352d;
    --warn-soft: #3a2f14;
    --warn-ink: #f0d591;
    --placeholder: #272d2a;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: var(--accent); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--accent); }

main { padding: 28px 0 48px; }

h1 { font-size: 30px; line-height: 1.3; letter-spacing: -0.03em; margin: 0 0 10px; }
h2 { font-size: 22px; line-height: 1.4; letter-spacing: -0.02em; margin: 40px 0 10px; }
h3 { font-size: 18px; margin: 26px 0 6px; }
p { margin: 0 0 14px; }
.lead { color: var(--muted); font-size: 18px; }
.meta { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 18px 0; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.field small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 4px; }
.field input, .field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 560px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.btn {
  display: block;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }

.result { background: var(--accent-soft); border-color: transparent; }
.result[hidden] { display: none; }
.result .big-label { font-size: 15px; color: var(--muted); margin: 0; }
.result .big { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.3; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.rows { width: 100%; border-collapse: collapse; font-size: 15px; }
.rows th, .rows td { padding: 7px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 400; }
.rows td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows tr.sum th, .rows tr.sum td { font-weight: 700; }
.note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.alert { background: var(--warn-soft); color: var(--warn-ink); border-radius: 10px; padding: 10px 14px; font-size: 15px; margin: 0 0 12px; }

.table-wrap { overflow-x: auto; margin: 14px 0 20px; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); }
table.data th, table.data td { border: 1px solid var(--line); padding: 8px 10px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th { background: var(--bg); font-weight: 600; text-align: center; }
table.data td:first-child { text-align: left; font-weight: 600; }

.list { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .list { grid-template-columns: minmax(0, 1fr); } }
.list a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.list a:hover { border-color: var(--accent); }
.list strong { display: block; line-height: 1.45; }
.list span { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 4px; }

.faq dt { font-weight: 700; margin-top: 16px; }
.faq dd { margin: 4px 0 0; }

.sources { font-size: 15px; padding-left: 20px; }

.ad { margin: 26px 0; min-height: 100px; text-align: center; }
.ad-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.ad-dev {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--placeholder);
  color: var(--muted);
  font-size: 14px;
}

.foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; padding: 22px 0 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-bottom: 8px; }
.foot a { color: var(--muted); }
.foot p { margin: 0; line-height: 1.6; }
