:root {
  --ink: #17211b;
  --muted: #5c675f;
  --paper: #f7f3e9;
  --surface: #fffdf8;
  --line: #dcd7c9;
  --green: #1f5c43;
  --green-deep: #164432;
  --mint: #dfeee3;
  --coral: #e56a4b;
  --coral-soft: #fbe7dd;
  --amber: #b2681a;
  --shadow: 0 22px 55px rgba(29, 44, 35, 0.09);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 7%, rgba(229, 106, 75, 0.09), transparent 28rem),
    linear-gradient(180deg, #faf7ef 0%, var(--paper) 100%);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  line-height: 1.58;
}

a { color: inherit; }
button, input, select { font: inherit; }

.app-header {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(23, 33, 27, 0.12);
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.03em; }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--green); font-family: Georgia, serif; }
.trust-pill { padding: 7px 11px; color: var(--green-deep); background: var(--mint); border-radius: 99px; font-size: 0.78rem; font-weight: 700; }

main { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.hero { min-height: 480px; display: grid; grid-template-columns: 1.5fr 0.7fr; gap: 64px; align-items: center; padding: 70px 0 60px; }
.eyebrow { margin: 0 0 12px; color: var(--coral); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; max-width: 780px; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(3rem, 7vw, 5.7rem); line-height: 0.99; letter-spacing: -0.055em; font-weight: 700; }
h1 span { color: var(--green); }
.hero-lead { max-width: 630px; margin: 28px 0 24px; color: #465149; font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-jump { display: inline-flex; gap: 12px; align-items: center; color: var(--green); font-weight: 850; text-underline-offset: 5px; }
.status-card { padding: 22px; display: flex; align-items: flex-start; gap: 13px; background: rgba(255, 253, 248, 0.82); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.status-card strong, .status-card span { display: block; }
.status-card span { color: var(--muted); margin-top: 3px; font-size: 0.9rem; }
.status-dot { flex: 0 0 11px; height: 11px; margin-top: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(178, 104, 26, 0.13); }

.calculator-shell { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 24px; padding: 24px; background: var(--green-deep); border-radius: 34px; box-shadow: 0 28px 80px rgba(22, 68, 50, 0.2); }
.task-card, .result-card { min-width: 0; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius-lg); }
.task-card { background: var(--surface); }
.result-card { min-height: 100%; display: flex; flex-direction: column; justify-content: center; color: #f9fbf7; background: var(--green); }
.result-card[data-state="buy-this-month"] { background: #255d42; }
.result-card[data-state="wait-next-month"] { background: #27516a; }
.result-card[data-state="error"], .result-card[data-state="unsupported"] { background: #7d4032; }
.section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -0.04em; line-height: 1.12; }
.section-heading .eyebrow { margin-bottom: 3px; }
.step { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--green); font: 800 0.8rem/1 system-ui, sans-serif; }

.field-stack { display: grid; gap: 8px; margin-top: 20px; }
.field-stack label { font-size: 0.92rem; font-weight: 800; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
select, input { width: 100%; min-height: 52px; padding: 0 15px; color: var(--ink); background: #fff; border: 1px solid #cfcabb; border-radius: var(--radius-sm); outline: none; }
select:focus, input:focus, a:focus-visible, summary:focus-visible { border-color: var(--green); box-shadow: 0 0 0 4px rgba(31, 92, 67, 0.15); outline: none; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 108px; }
.input-suffix span { position: absolute; top: 50%; right: 14px; color: var(--muted); font-size: 0.8rem; transform: translateY(-50%); pointer-events: none; }
.helper { margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.optional-field { padding-top: 20px; border-top: 1px solid var(--line); }
.label-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.label-line span { padding: 3px 8px; color: var(--muted); background: #ece9df; border-radius: 99px; font-size: 0.7rem; font-weight: 800; }

.result-card .eyebrow { color: #bce2cb; }
.result-card h2 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(2rem, 4.2vw, 3.4rem); letter-spacing: -0.045em; line-height: 1.12; }
.result-context { margin: 13px 0 25px; color: rgba(255, 255, 255, 0.74); }
.number-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.number-grid > div { padding: 16px; background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius-sm); }
.number-grid span, .number-grid strong { display: block; }
.number-grid span { margin-bottom: 5px; color: rgba(255,255,255,.7); font-size: 0.78rem; }
.number-grid strong { font-size: clamp(1.15rem, 2vw, 1.5rem); }
.formula { margin: 10px 0 0; color: rgba(255,255,255,.64); font-size: 0.75rem; }
.critical-caveat { margin-top: 26px; padding: 16px; color: #47291f; background: var(--coral-soft); border-radius: var(--radius-sm); font-size: 0.88rem; }
.critical-caveat strong { display: block; margin-bottom: 3px; }
.next-action { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.button { min-height: 48px; padding: 12px 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; font-weight: 850; text-decoration: none; }
.button-primary { color: var(--green-deep); background: #fff; }
.button-secondary { color: #fff; border: 1px solid rgba(255,255,255,.35); }

.data-section, .explain-section, .faq-section { padding: 100px 0; }
.wide-heading { align-items: flex-end; }
.freshness { margin-left: auto; text-align: right; }
.freshness span, .freshness strong { display: block; }
.freshness span { color: var(--muted); font-size: .72rem; }
.freshness strong { font-size: .86rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 17px 20px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); background: #f0ede4; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tbody th { width: 58%; font-weight: 500; }
tbody th strong, tbody th span { display: block; }
tbody th span { margin-top: 3px; color: var(--muted); font-size: .78rem; }
tbody td { font-variant-numeric: tabular-nums; font-weight: 800; }
tbody tr.is-selected { background: #edf5ef; box-shadow: inset 4px 0 var(--green); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.pending-cell { color: var(--amber); }
.source-row { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; color: var(--muted); font-size: .83rem; }
.source-row a { color: var(--green); font-weight: 800; text-underline-offset: 3px; }
.month-pages { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.month-pages a { padding: 8px 12px; background: var(--mint); color: var(--green-deep); border-radius: 99px; font-size: .8rem; font-weight: 800; text-decoration: none; }

.explain-section { display: grid; grid-template-columns: .75fr 1.25fr; gap: 72px; border-top: 1px solid var(--line); }
.explain-section h2, .faq-section h2 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.08; letter-spacing: -.045em; }
.explain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.explain-grid article { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.explain-grid h3 { margin: 18px 0 9px; font-size: 1.1rem; }
.explain-grid p { margin: 0; color: var(--muted); font-size: .9rem; }
.explain-icon { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-weight: 900; }
.explain-icon.warn { background: var(--coral); }

.faq-section { max-width: 820px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq-section h2 { margin-bottom: 32px; }
details { padding: 20px 0; border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 850; }
details p { margin: 12px 28px 0 0; color: var(--muted); }

footer { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 34px 0 50px; display: flex; justify-content: space-between; gap: 30px; color: var(--muted); border-top: 1px solid var(--line); font-size: .8rem; }
footer strong, footer span { display: block; }
footer strong { color: var(--ink); }
footer p { max-width: 520px; margin: 0; text-align: right; }

.content-page { max-width: 900px; margin: 0 auto; padding: 64px 0 100px; }
.content-page h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
.content-page .lead { color: var(--muted); font-size: 1.1rem; }
.content-page section { margin-top: 48px; }
.content-page h2 { font-family: Georgia, "Noto Serif KR", serif; font-size: 2rem; letter-spacing: -.035em; }
.notice-box { padding: 20px; background: var(--coral-soft); border-left: 4px solid var(--coral); border-radius: var(--radius-sm); }
.back-link { display: inline-block; margin-top: 32px; color: var(--green); font-weight: 800; }
.related-pages { display: grid; gap: 10px; padding: 20px; background: var(--mint); border-radius: var(--radius-md); }
.related-pages strong { color: var(--green-deep); }
.related-pages a { width: fit-content; color: var(--green); font-weight: 800; text-underline-offset: 4px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 28px; min-height: auto; padding: 54px 0; }
  .status-card { max-width: 420px; }
  .calculator-shell { grid-template-columns: 1fr; padding: 12px; border-radius: 25px; }
  .explain-section { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 560px) {
  .app-header, main, footer { width: min(100% - 24px, var(--max)); }
  .app-header { min-height: 66px; }
  .trust-pill { font-size: 0; padding: 8px; }
  .trust-pill::after { content: "저장 없음"; font-size: .72rem; }
  .hero { padding: 46px 4px 44px; }
  h1 { font-size: clamp(2.7rem, 14vw, 4rem); }
  .task-card, .result-card { padding: 24px 18px; border-radius: 18px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .number-grid { grid-template-columns: 1fr; }
  .next-action { display: grid; }
  .data-section, .explain-section, .faq-section { padding: 72px 0; }
  .wide-heading { align-items: flex-start; flex-wrap: wrap; }
  .freshness { width: 100%; margin-left: 56px; text-align: left; }
  .source-row { flex-direction: column; gap: 4px; }
  .explain-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
  footer p { text-align: left; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
