:root {
  --bg: #faf7f1;
  --surface: #fffefb;
  --surface-2: #f6f1e8;
  --ink: #2c281f;
  --muted: #766c5e;
  --faint: #a89d8b;
  --line: #ece4d5;
  --line-2: #ddd2bf;
  --sage: #5f7461;
  --sage-deep: #46594a;
  --sage-soft: #e9efe8;
  --terra: #bb6c49;
  --terra-deep: #8a4d31;
  --terra-soft: #f7eae0;
  --amber-soft: #fbf2dc;
  --amber-bd: #e7d4a4;
  --amber-ink: #7a5e1e;
  --radius: 16px;
  --radius-sm: 11px;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.62;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px 96px; }

/* header */
header.site { display: flex; align-items: center; gap: 11px; padding: 24px 0 20px; }
.logo {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  background: var(--sage); color: #fff;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
}
.brand b { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand .beta {
  margin-left: 7px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--sage-deep); background: var(--sage-soft);
  border-radius: 999px; padding: 2px 8px; vertical-align: 2px;
}
.brand small { display: block; color: var(--faint); font-size: 12px; margin-top: 1px; }

/* hero */
.hero { padding: 30px 0 26px; }
.hero h1 {
  font-size: clamp(27px, 5.6vw, 37px); font-weight: 700;
  line-height: 1.28; letter-spacing: -0.03em; margin: 0 0 14px;
}
.hero h1 em { font-style: normal; color: var(--sage); }
.hero p.lede { color: var(--muted); font-size: 16.5px; margin: 0 0 20px; max-width: 54ch; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips span {
  font-size: 12.5px; font-weight: 500; color: var(--sage-deep);
  background: var(--sage-soft); border-radius: 999px; padding: 5px 12px;
}

/* cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(44, 40, 31, 0.03), 0 18px 40px -28px rgba(44, 40, 31, 0.22);
  padding: 24px 22px; margin-bottom: 22px;
}
.card h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 5px; }
.card p.sub { color: var(--faint); font-size: 13px; margin: 0 0 20px; }

/* segmented asset selector */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; background: var(--surface-2); border-radius: 12px; padding: 5px; margin-bottom: 20px; }
.seg button {
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--muted);
  background: transparent; border: 0; border-radius: 8px; padding: 9px 4px; cursor: pointer;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--sage-deep); font-weight: 600; box-shadow: 0 1px 3px rgba(44,40,31,0.1); }
@media (max-width: 520px) { .seg { grid-template-columns: repeat(3, 1fr); } }

/* form */
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--terra-deep); padding: 16px 0 11px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 15px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

label.f { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
label.f span.name { display: block; margin-bottom: 6px; color: var(--ink); }
label.f .hint { font-weight: 400; color: var(--faint); font-size: 11.5px; }
input[type="text"], input[type="email"], input[type="date"], select {
  width: 100%; font-family: var(--sans); font-size: 15.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px;
  font-variant-numeric: tabular-nums; transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus { outline: 0; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
.suffix { position: relative; }
.suffix::after { content: "원"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13.5px; pointer-events: none; }
.suffix input { padding-right: 32px; text-align: right; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; padding: 7px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--sage); cursor: pointer; }
.check .hint { color: var(--faint); font-size: 12px; display: block; }

.radio-row { display: flex; gap: 8px; }
.radio-row label { flex: 1; }
.radio-row input { position: absolute; opacity: 0; }
.radio-row span { display: block; text-align: center; font-size: 13.5px; font-weight: 500; color: var(--muted); background: #fff; border: 1px solid var(--line-2); border-radius: 9px; padding: 10px; cursor: pointer; transition: all 0.12s; }
.radio-row input:checked + span { color: var(--sage-deep); border-color: var(--sage); background: var(--sage-soft); font-weight: 600; }

.toggle-block { border-left: 2px solid var(--sage-soft); padding-left: 15px; margin: 8px 0 6px; }
[hidden] { display: none !important; }

.adv { margin-top: 6px; }
.adv summary { cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--sage-deep); padding: 8px 0; list-style: none; }
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before { content: "+ "; font-weight: 600; }
.adv[open] summary::before { content: "− "; }

button.calc {
  width: 100%; margin-top: 22px; font-family: var(--sans);
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: #fff; background: var(--sage); border: 0; border-radius: 12px; padding: 15px; cursor: pointer;
  transition: background 0.15s, transform 0.08s;
}
button.calc:hover { background: var(--sage-deep); }
button.calc:active { transform: scale(0.99); }

/* result */
#result { scroll-margin-top: 16px; }
.headline { text-align: center; padding: 8px 0 18px; }
.headline .eyebrow { font-size: 13px; color: var(--faint); margin: 0 0 6px; }
.headline .big { font-size: clamp(34px, 8vw, 46px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; color: var(--ink); }
.headline .approx { color: var(--sage); }
.headline .sub { font-size: 13px; color: var(--muted); margin: 9px 0 0; }
.headline .basis { font-size: 12px; color: var(--faint); margin: 3px 0 0; }
.stamp { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--sage-deep); background: var(--sage-soft); border-radius: 999px; padding: 6px 18px; }

.ledger { width: 100%; border-collapse: collapse; margin: 8px 0 2px; }
.ledger td { padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.ledger td.amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 500; }
.ledger td.amt.neg { color: var(--terra); }
.ledger tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); padding-top: 14px; font-weight: 700; font-size: 15.5px; }
.ledger tr.total td.amt { font-size: 19px; letter-spacing: -0.02em; }

.notes { margin: 18px 0 0; padding: 0; list-style: none; }
.notes li { font-size: 13px; color: var(--muted); padding: 5px 0 5px 20px; position: relative; }
.notes li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--sage); }

.warns { margin: 16px 0 0; padding: 14px 16px; background: var(--amber-soft); border: 1px solid var(--amber-bd); border-radius: 12px; }
.warns b { font-size: 13px; color: var(--amber-ink); }
.warns ul { margin: 7px 0 0; padding-left: 18px; }
.warns li { font-size: 12.5px; color: var(--amber-ink); padding: 2px 0; line-height: 1.5; }

/* CTA */
.cta { background: var(--sage-deep); border: 0; color: #fff; }
.cta-tag {
  display: inline-block; margin: 0 0 11px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--sage-deep); background: #fff;
  border-radius: 999px; padding: 4px 12px;
}
.cta h2 { color: #fff; }
.cta p.sub { color: #d6e0d4; font-size: 14px; }
.cta form { display: flex; gap: 9px; margin-top: 16px; }
.cta input[type="email"] { flex: 1; border: 0; }
.cta button { font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--sage-deep); background: #fff; border: 0; border-radius: 10px; padding: 0 18px; cursor: pointer; white-space: nowrap; }
.cta button:hover { background: var(--sage-soft); }
.cta .ok { color: #d6e0d4; font-weight: 500; font-size: 14px; margin: 12px 0 0; }
@media (max-width: 520px) { .cta form { flex-direction: column; } .cta button { padding: 12px; } }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 14px 0; list-style: none; position: relative; padding-right: 26px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 13px; color: var(--sage); font-size: 18px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

/* mode tabs */
.mode-tabs { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.mode-tabs button { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--faint); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 6px 13px; margin-bottom: -1px; cursor: pointer; }
.mode-tabs button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--sage); }

/* comparison result */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 4px; }
@media (max-width: 520px) { .compare { grid-template-columns: 1fr; } }
.compare .col { border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px; background: #fff; }
.compare .col.win { border: 2px solid var(--sage); background: var(--sage-soft); }
.compare .col h3 { font-size: 13.5px; font-weight: 600; margin: 0 0 9px; }
.compare .col .amt { font-size: 23px; font-weight: 700; letter-spacing: -0.025em; }
.compare .col .amt small { font-size: 13px; font-weight: 500; color: var(--muted); }
.compare .col .ln { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 4px 0; border-top: 1px dotted var(--line); margin-top: 8px; }
.compare .col .ln:first-of-type { margin-top: 12px; }
.win-badge { display: inline-block; font-size: 11px; font-weight: 600; color: var(--sage-deep); background: #fff; border: 1px solid var(--sage); border-radius: 999px; padding: 2px 9px; margin-bottom: 8px; }
.saving { text-align: center; padding: 20px 0 6px; }
.saving .big { font-size: clamp(26px, 6vw, 32px); font-weight: 700; color: var(--sage); letter-spacing: -0.03em; }
.saving .lbl { font-size: 13.5px; color: var(--muted); margin-top: 5px; }

/* info tooltip */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 5px; padding: 0; vertical-align: middle;
  border: 1px solid var(--line-2); border-radius: 50%; background: #fff;
  color: var(--faint); font-family: var(--sans); font-size: 10.5px; font-weight: 700; font-style: italic;
  line-height: 1; cursor: pointer; position: relative;
}
.tip:hover, .tip.open { color: var(--sage); border-color: var(--sage); }
.tip:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }
.tip-pop {
  position: absolute; left: 50%; top: calc(100% + 9px); transform: translateX(-50%);
  width: 244px; max-width: 74vw; z-index: 30;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 400; font-style: normal;
  line-height: 1.55; text-align: left; padding: 11px 13px; border-radius: 11px;
  box-shadow: 0 10px 28px -10px rgba(44, 40, 31, 0.4); display: none;
}
.tip.open .tip-pop { display: block; }
.tip-pop::before { content: ""; position: absolute; left: 50%; top: -5px; transform: translateX(-50%); border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid var(--ink); }
.tip-pop .ex { display: block; margin-top: 6px; color: #c9d0c7; }
.field-note { font-size: 12px; color: var(--faint); margin: 7px 0 0; line-height: 1.5; }
.field-note a { color: var(--sage); }
.region-badge { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 500; padding: 4px 11px; border-radius: 999px; }
.region-badge.on { color: var(--terra-deep); background: var(--terra-soft); }
.region-badge.off { color: var(--sage-deep); background: var(--sage-soft); }

footer.site { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; line-height: 1.7; }
footer.site b { color: var(--muted); font-weight: 600; }
footer.site a { color: var(--sage); }

/* trust / currency line */
.hero .trust { margin: 16px 0 0; font-size: 12.5px; color: var(--faint); font-weight: 500; }

/* example fill */
.example-btn {
  display: inline-block; margin: 0 0 2px; font-family: var(--sans);
  font-size: 12.5px; font-weight: 500; color: var(--sage-deep);
  background: var(--sage-soft); border: 0; border-radius: 8px; padding: 7px 13px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.example-btn:hover { background: var(--sage); color: #fff; }

/* custom unit suffix (명/년) */
.suffix.unit::after { content: var(--sfx, "원"); }

/* result-linked CTA */
.result-cta { margin-top: 18px; padding: 16px 16px 15px; background: var(--sage-soft); border-radius: 12px; }
.result-cta p { margin: 0 0 11px; font-size: 13.5px; color: var(--sage-deep); line-height: 1.55; }
.result-cta button {
  width: 100%; font-family: var(--sans); font-size: 14px; font-weight: 600; color: #fff;
  background: var(--sage); border: 0; border-radius: 10px; padding: 12px 16px; cursor: pointer;
  transition: background 0.15s;
}
.result-cta button:hover { background: var(--sage-deep); }

/* cta fine print */
.cta .cta-fine { color: #c3cfc1; font-size: 12px; margin: 11px 0 0; }

/* 이월과세 적용 vs 미적용 비교 (mini compare) */
.cmp-mini { margin: 16px 0 2px; padding: 14px 16px 13px; background: var(--surface-2); border-radius: 12px; }
.cmp-mini .cmp-title { font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: var(--terra-deep); margin: 0 0 9px; }
.cmp-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 8px 11px; border-radius: 9px; }
.cmp-row + .cmp-row { margin-top: 4px; }
.cmp-row span { color: var(--muted); }
.cmp-row b { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.cmp-row.win { background: var(--sage-soft); }
.cmp-row.win span, .cmp-row.win b { color: var(--sage-deep); }
.cmp-mini .cmp-note { font-size: 12px; color: var(--faint); margin: 10px 0 0; line-height: 1.55; }

/* 4-tab wrap on narrow screens */
@media (max-width: 420px) {
  .mode-tabs { flex-wrap: wrap; }
  .mode-tabs button { font-size: 14px; padding: 6px 4px 11px; }
}
