:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #161a20;
  --muted: #586273;
  --line: #e6e9ef;
  --border: #e6e9ef;
  --text: #161a20;
  --accent: #0E9F6E;
  --accent-dark: #0B7E57;
  --accent-soft: rgba(14, 159, 110, 0.10);
  --ok: #0e9f6e;
  --warn: #b45309;
  --shadow: 0 8px 26px rgba(20, 34, 64, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }

/* a11y: skip link + visible keyboard focus */
.skipLink {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}
.skipLink:focus { left: 8px; top: 8px; }

a:focus-visible,
summary:focus-visible,
.hubCard:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.muted { color: var(--muted); }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.navInner {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
}

.brand .logo {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  align-items: center;
  justify-content: center;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.navLinks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.navLinks a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 0;
}

.navLinks a:hover { color: var(--accent); }

/* ---------- hero / page head ---------- */

.hero {
  margin-bottom: 18px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.hero h1 {
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.18;
}

.hero .sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 16px;
}

.panel h2 {
  font-size: 17px;
  margin-bottom: 14px;
}

/* ---------- form ---------- */

.field { margin-bottom: 14px; }

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* group heading for checkbox/radio clusters (not tied to a single control) */
.groupLabel {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  height: 46px;
  border: 1px solid #d4dae6;
  border-radius: 10px;
  padding: 0 13px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.fieldHint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}

.check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.warnings {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  background: #fffaf0;
}

.warnTitle {
  font-size: 14px;
  color: #7c4a03;
  margin-bottom: 6px;
}

.warnings ul {
  margin: 0;
  padding-left: 18px;
  color: #7c4a03;
  font-size: 13.5px;
  line-height: 1.7;
}

.checklist {
  margin-top: 10px;
  padding-left: 18px;
  line-height: 1.9;
  color: #2c3340;
}

/* live (input-reactive) chart */
.chartBox {
  margin-top: 12px;
  display: grid;
  gap: 9px;
}

.cbRow {
  display: grid;
  grid-template-columns: 104px 1fr auto;
  align-items: center;
  gap: 10px;
}

.cbLabel {
  font-size: 12.5px;
  color: var(--muted);
  min-width: 0;
}

.cbTrack {
  height: 13px;
  border-radius: 999px;
  background: #eef1ee;
  overflow: hidden;
}

.cbFill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #b8c2bd;
  transition: width 0.18s ease;
}

.cbFill--hl {
  background: var(--accent);
}

.cbVal {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.chartCaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- result ---------- */

.result {
  background: #0f172a;
  color: #fff;
  border-radius: 14px;
  padding: 22px;
  margin-top: 16px;
  text-align: center;
}

.result .label {
  color: #94a3b8;
  font-size: 13px;
}

.result .big {
  display: block;
  margin-top: 6px;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800;
  color: #facc15;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
}

.result.ok .big { color: #4ade80; }

.draftBadge, .refTag {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.hubIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 10px;
}

.breakdown {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.breakdown .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
}

.breakdown .row + .row { border-top: 1px solid var(--line); }
.breakdown .row.minus { background: #fef2f2; color: #b91c1c; }
.breakdown .row span { min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.breakdown .row strong { font-variant-numeric: tabular-nums; flex: 0 0 auto; white-space: nowrap; }

/* ---------- content sections ---------- */

.section { margin-top: 16px; }
.section h2 { font-size: 16px; margin-bottom: 10px; }
.section p { margin-top: 8px; line-height: 1.7; color: #2c3340; }

.formula {
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #1e293b;
  overflow-wrap: anywhere;
  word-break: keep-all;
  overflow-x: auto;
}

.asof {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

details.faq {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 8px;
  background: #fff;
}

details.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  padding: 4px 0;
}

details.faq p { color: var(--muted); font-size: 14px; }

/* ---------- ad slot ---------- */

.adSlot {
  margin-top: 16px;
  border: 1px dashed #c7cfdc;
  border-radius: 12px;
  background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 10px, #f1f5f9 10px, #f1f5f9 20px);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  position: relative;
}

.adSlot::before {
  content: "광고";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 10px;
  color: #94a3b8;
}

/* ad slots hidden until AdSense approval (no placeholder/fake-ad boxes during review) */
.adSlot { display: none; }

/* ---------- hub (index) ---------- */

.hubGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.hubCard {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
  transition: border-color 0.15s, transform 0.15s;
}

.hubCard:hover { border-color: var(--accent); transform: translateY(-2px); }
.hubCard h3 { font-size: 16px; }
.hubCard p { margin-top: 6px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.hubCard .go { display: inline-block; margin-top: 10px; color: var(--accent); font-weight: 800; font-size: 13.5px; }

/* ---------- footer ---------- */

.siteFooter {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.footerInner {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.footerLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 6px;
}

.footerLinks a {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 0;
}

.footerLinks a:hover { color: var(--accent); }

.footerNote {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------- policy / doc pages ---------- */

.docPage h1 { font-size: 26px; }
.docPage h2 { margin-top: 26px; font-size: 17px; }
.docPage p { margin-top: 10px; line-height: 1.7; }
.docPage ul { margin-top: 10px; padding-left: 20px; line-height: 1.8; }
.docPage a { color: var(--accent); }
.docMeta { margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.docLead { margin-top: 16px; font-size: 15px; line-height: 1.75; color: var(--text); }
.docPage .sourceLink { display: inline-block; font-weight: 700; text-decoration: none; padding: 4px 0; }
.docBack { margin-top: 26px; }
.docBack a { color: var(--accent); text-decoration: none; font-weight: 700; }

/* ---------- guide table of contents ---------- */
.toc { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc; }
.toc .tocTitle { margin: 0 0 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.toc ol { margin: 0; padding-left: 20px; line-height: 1.9; }
.toc a { color: var(--accent); text-decoration: none; display: inline-block; padding: 4px 0; }
.toc a:hover { text-decoration: underline; }

/* ---------- guide list (home + calc pages) ---------- */
.guideList { display: grid; gap: 10px; }
.guideList a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); transition: border-color .15s ease, background .15s ease; }
.guideList a:hover { border-color: var(--accent); background: #f8fafc; }
.guideList strong { display: block; color: var(--accent); font-size: 15px; }
.guideList span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.relatedGuide { margin-top: 14px; font-size: 13.5px; }
.relatedGuide a { color: var(--accent); text-decoration: none; font-weight: 700; }

/* ---------- responsive ---------- */

/* tablet & large phones: keep nav reachable as a single horizontal-scroll row (never hide it) */
@media (max-width: 820px) {
  .navInner { min-height: 58px; height: auto; gap: 10px; padding: 6px 0; }
  .brand { flex: 0 0 auto; }
  .brand small { display: none; }
  .navLinks {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 14px;
  }
  .navLinks::-webkit-scrollbar { display: none; }
  .navLinks a { white-space: nowrap; }
}

@media (max-width: 640px) {
  .hubGrid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .cbRow { grid-template-columns: minmax(64px, 38%) 1fr auto; gap: 8px; }
  .cbLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cbTrack { min-width: 60px; }
  .cbVal { font-size: 12px; }
}

@media (max-width: 480px) {
  .panel { padding: 16px; }
}

@media (max-width: 400px) {
  .result { padding: 18px 14px; }
  .result .big { font-size: clamp(24px, 7vw, 40px); }
}

/* very narrow: stack chart label above its bar so nothing collides */
@media (max-width: 380px) {
  .cbRow { grid-template-columns: 1fr auto; }
  .cbLabel { grid-column: 1 / -1; white-space: normal; }
}

.copyright { margin-top: 10px; color: var(--muted); font-size: 12px; }

/* CTA box used in pay-check guides */
.ctaBox {
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid var(--accent-soft);
  border-radius: 14px;
  background: var(--accent-soft);
}
.ctaBox p { margin: 0 0 12px; color: var(--ink); font-weight: 600; }
.ctaBtn {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.ctaBtn:hover { background: var(--accent-dark); }
.guideList li { margin-bottom: 8px; line-height: 1.7; }
article h3 { margin: 18px 0 6px; font-size: 17px; }
