@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --bg: #f5f4ef;
  --card: #ffffff;
  --ink: #1d2327;
  --muted: #5d676e;
  --line: #e3e1d8;
  --brand: #0f5c55;
  --brand-soft: #e3f0ee;
  --accent: #e0902a;
  --accent-soft: #fdf1e1;
  --warn: #b3412e;
  --radius: 14px;
}

* { 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", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
}

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

/* 상단 */
.site-header {
  background: var(--brand);
  color: #fff;
}
.site-header .inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--brand);
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
}
.header-tag { font-size: 13px; opacity: .85; }

.nav {
  background: #0c4c46;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.nav .inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
}
.nav a {
  color: #d5e8e5;
  text-decoration: none;
  font-size: 14px;
  padding: 10px 10px;
  border-bottom: 3px solid transparent;
}
.nav a.on { color: #fff; border-bottom-color: var(--accent); font-weight: 700; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: -0.03em;
  margin: 6px 0 8px;
}
.lead { color: var(--muted); margin: 0 0 18px; }
.updated {
  display: inline-block;
  font-size: 12.5px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 6px;
  font-weight: 600;
}

h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
  margin: 34px 0 10px;
  padding-top: 4px;
}
h3 { font-size: 17px; margin: 22px 0 6px; }

/* 계산기 카드 */
.calc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.field { margin-bottom: 14px; }
.field > label, .field > .label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input-wrap { position: relative; }
.input-wrap input, .calc select, .calc input[type="date"] {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 11px 44px 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fcfcfa;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.calc input[type="date"] { padding-right: 12px; }
.calc select { padding-right: 12px; }
.input-wrap input:focus, .calc select:focus, .calc input[type="date"]:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.input-wrap .unit {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label {
  flex: 1 1 auto;
  text-align: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 15px;
  cursor: pointer;
  background: #fcfcfa;
  user-select: none;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { font-weight: 700; }
.seg label:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fcfcfa;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.quick { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.quick button {
  font: inherit; font-size: 13px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  color: var(--muted);
}

.btn {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  margin-top: 6px;
}
.btn:active { transform: translateY(1px); }

/* 결과 */
.result {
  margin-top: 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid #f1d6ae;
  padding: 18px;
  display: none;
}
.result.show { display: block; }
.result .big-label { font-size: 14px; color: #7a5317; font-weight: 700; }
.result .big {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #5e3c0c;
  line-height: 1.25;
}
.result .sub { font-size: 14px; color: #7a5317; margin-top: 2px; }
.result table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; background: rgba(255,255,255,.6); border-radius: 10px; overflow: hidden; }
.result th, .result td { padding: 8px 10px; border-bottom: 1px solid #f1d6ae; text-align: right; }
.result th:first-child, .result td:first-child { text-align: left; }
.result thead th { font-size: 13px; color: #7a5317; }
.result tr.total td { font-weight: 800; }
.result .note { font-size: 13px; color: #7a5317; margin-top: 10px; }
.alert {
  font-size: 14px;
  color: var(--warn);
  background: #fbeae6;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}

/* 본문 */
.content p, .content li { color: #2c3439; }
.content ul, .content ol { padding-left: 20px; }
.formula {
  background: var(--card);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 600;
  margin: 10px 0;
}
.content table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  font-size: 15px;
  margin: 10px 0;
}
.content th, .content td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.content th { background: #eef3f2; font-size: 14px; }

details.faq {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0;
}
details.faq summary { font-weight: 700; cursor: pointer; }
details.faq p { margin: 8px 0 0; }

/* 메인 카드 목록 */
.tools { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 620px) { .tools { grid-template-columns: 1fr 1fr; } }
.tool {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
}
.tool:hover { border-color: var(--brand); }
.tool b { font-size: 17px; display: block; margin-bottom: 2px; }
.tool span { font-size: 14px; color: var(--muted); }
.tool.feature { background: var(--brand); color: #fff; border-color: var(--brand); }
.tool.feature span { color: #cfe5e1; }
.tool .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: #3d2707;
  border-radius: 999px;
  padding: 1px 8px;
  margin-bottom: 6px;
}

.related { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.related a {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  text-decoration: none;
}

/* 광고 자리: 애드센스 승인 후 코드를 넣으면 채워진다 */
.ad-slot { margin: 22px 0; min-height: 0; }

.disclaimer {
  font-size: 13px;
  color: var(--muted);
  background: #ecebe4;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 30px;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 22px 16px 34px;
}
footer a { color: var(--muted); margin: 0 6px; }

@media (max-width: 420px) {
  h1 { font-size: 22px; }
  .result .big { font-size: 28px; }
  .row { grid-template-columns: 1fr 1fr; gap: 8px; }
}
