/* 동갑계산기 스타일 */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --text: #1c1d1f;
  --muted: #62656b;
  --line: #e2dfd6;
  --accent: #1f6b5c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0ec;
  --logo-blue: #1e7eed;
  --logo-ink: #18233a;
  --warn: #a4471f;
  --warn-soft: #fbece4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 6px 20px rgba(20, 20, 20, .05);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517;
    --surface: #1d1f22;
    --surface-2: #26292d;
    --text: #ecebe7;
    --muted: #a3a5a9;
    --line: #33363b;
    --accent: #5cc0a8;
    --accent-ink: #0d2420;
    --accent-soft: #1d3530;
    --logo-blue: #5aa4ff;
    --logo-ink: #ecebe7;
    --warn: #f0976c;
    --warn-soft: #3a261d;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141517;
  --surface: #1d1f22;
  --surface-2: #26292d;
  --text: #ecebe7;
  --muted: #a3a5a9;
  --line: #33363b;
  --accent: #5cc0a8;
  --accent-ink: #0d2420;
  --accent-soft: #1d3530;
  --logo-blue: #5aa4ff;
  --logo-ink: #ecebe7;
  --warn: #f0976c;
  --warn-soft: #3a261d;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
img, svg { max-width: 100%; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* 헤더 */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 19px; letter-spacing: -.02em;
  color: var(--text); text-decoration: none; margin-right: auto;
}
.logo-img {
  height: 44px; width: auto;
  flex-shrink: 0; display: block;
}
.logo-text { font-size: 20px; font-weight: 900; letter-spacing: -.03em; color: var(--logo-ink); }
.logo-a { color: var(--logo-blue); }
.site-nav { display: flex; gap: 2px; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 17px;
  display: grid; place-items: center;
}
#menu-toggle { display: none; }
@media (max-width: 760px) {
  #menu-toggle { display: grid; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: 8px 16px 14px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 8px; font-size: 15.5px; }
}

/* 본문 */
main { padding: 28px 0 56px; }
.breadcrumb { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
h1 { font-size: clamp(26px, 5vw, 34px); line-height: 1.3; letter-spacing: -.03em; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 24px; font-size: 16.5px; }
h2 { font-size: 21px; letter-spacing: -.02em; margin: 40px 0 12px; line-height: 1.4; }
h3 { font-size: 17px; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
ul, ol { padding-left: 22px; margin: 0 0 14px; }
li { margin-bottom: 6px; }

/* 계산기 카드 */
.calc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px;
}
@media (max-width: 520px) { .calc { padding: 18px 16px; } }
.field { margin-bottom: 16px; }
.field > label, .field > .label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.field .hint { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

input[type=text], input[type=number], input[type=date], select {
  width: 100%; font: inherit; font-size: 17px; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 12px; min-height: 48px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.with-unit { position: relative; }
.with-unit input { padding-right: 46px; }
.with-unit .unit {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; pointer-events: none;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 15px;
}
.radio-row input { accent-color: var(--accent); }
.radio-row label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: 17px; font-weight: 800; cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--line); font-weight: 700; }
.btn-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 4px; }
.btn-row .btn-ghost { width: auto; padding: 0 18px; }

/* 탭 */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--surface-2); padding: 5px; border-radius: 12px; }
.tabs [role=tab] {
  flex: 1; border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 15px;
  color: var(--muted); padding: 9px 8px; border-radius: 9px; cursor: pointer;
}
.tabs [role=tab][aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* 결과 */
.result {
  margin-top: 18px; padding: 18px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid transparent;
}
.result-big { font-size: clamp(26px, 6vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin: 2px 0 10px; }
.result-big small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.result-label { font-size: 14px; font-weight: 700; color: var(--accent); }
.result-list { margin: 0; }
.result-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed color-mix(in srgb, var(--accent) 25%, transparent); }
.result-row:first-child { border-top: 0; }
.result-row dt { color: var(--muted); }
.result-row dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.result-row.is-strong dd { color: var(--accent); font-size: 18px; }
.result-note { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; }
.result-error { color: var(--warn); font-weight: 700; margin: 0; }
.result .alert { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: 14.5px; font-weight: 600; margin: 10px 0 0; }
.progress { height: 12px; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* 정보 박스 / 표 */
.info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 8px; margin-top: 12px; }
.formula {
  background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px;
  font-size: 15px; font-weight: 600;
}
table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 15px; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: left; }
th { background: var(--surface-2); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; position: relative; padding-right: 26px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 8px; font-size: 20px; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); }

.notice { font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 32px; padding-top: 14px; }

/* 카드 목록 */
.cat-title { font-size: 15px; color: var(--muted); font-weight: 700; margin: 30px 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card .card-icon { font-size: 22px; line-height: 1; }
.card strong { display: block; font-size: 16.5px; margin: 8px 0 2px; }
.card span { font-size: 14px; color: var(--muted); line-height: 1.5; display: block; }

.hero { padding: 12px 0 4px; }
.hero h1 { font-size: clamp(28px, 6vw, 40px); }

/* 광고 자리 (애드센스 승인 후 사용) */
.ad-slot { margin: 24px 0; min-height: 0; }

/* 푸터 */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 26px 0 34px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0 0 4px; }

.prose h2 { margin-top: 32px; }
