/* 육아 백과 — index.html·page.html 공용. 따뜻한 종이색(밝은 화면)과 어두운 코코아(다크 모드).
   공용 조각(_site_foot·_related·_site_guide·_channel)이 --bg·--card·--border·--accent·--accent2·
   --text·--muted·--ok 를 그대로 쓰므로 이름을 바꾸지 말 것. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #fff8f1; --bg2: #fdeee0; --card: #ffffff; --border: #f0dfcd;
  --text: #2e2620; --sub: #5b4d42; --muted: #8a7768;
  --accent: #e2703f; --accent2: #f0a04b; --accent-soft: #fde6d7;
  --ok: #2f9466; --ok-soft: #e1f4ea; --sky: #3c8fc4; --sky-soft: #e3f1fa;
  --warn: #c2410c; --warn-soft: #fff1e6; --warn-line: #f6b48a;
  --tip-soft: #fff7d6; --tip-line: #f2cf62;
  --shadow: 0 1px 2px rgba(90, 55, 25, .05), 0 8px 24px -12px rgba(120, 70, 30, .22);
  --radius: 18px; --barh: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120f; --bg2: #211914; --card: #221b16; --border: #3a2e25;
    --text: #f4ebe2; --sub: #d8c8b9; --muted: #a8968a;
    --accent: #ff8f5e; --accent2: #ffbb6b; --accent-soft: #3a2519;
    --ok: #5cc794; --ok-soft: #173126; --sky: #74b9e6; --sky-soft: #15283a;
    --warn: #ffa07a; --warn-soft: #34201a; --warn-line: #7a3f28;
    --tip-soft: #302814; --tip-line: #7c6522;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
@media (max-width: 480px) { :root { --barh: 46px; } }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--bg); color: var(--text); line-height: 1.7; min-height: 100vh;
       font-family: 'Pretendard', 'Segoe UI', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.pt-wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.pt-narrow { max-width: 720px; margin: 0 auto; }
.kw { word-break: var(--xn-wb, keep-all); overflow-wrap: anywhere; }

/* ── 홈: 히어로 ── */
.pt-hero { text-align: center; padding: 38px 0 22px; }
.pt-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; letter-spacing: .02em;
              color: var(--accent); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; }
.pt-h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.25; margin: 14px 0 10px; }
.pt-h1 .ico { display: inline-block; margin-right: 6px; }
.pt-lead { max-width: 600px; margin: 0 auto; font-size: 1rem; color: var(--sub); word-break: var(--xn-wb, keep-all); }
.pt-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.pt-quick a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; text-decoration: none;
              background: var(--card); border: 1px solid var(--border); font-size: .86rem; font-weight: 700; color: var(--text);
              box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.pt-quick a:hover { transform: translateY(-2px); border-color: var(--accent); }

/* ── 계산기 ── */
.pt-calc { background: var(--card); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow);
           padding: 20px; margin: 10px auto 0; max-width: 720px; position: relative; overflow: hidden; }
.pt-calc::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px;
                   background: linear-gradient(90deg, var(--accent), var(--accent2), var(--ok)); }
.pt-calc h2 { font-size: 1.25rem; font-weight: 900; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.pt-calc .hint { font-size: .86rem; color: var(--muted); margin-top: 2px; }
.pt-kids { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.pt-kids button { font: inherit; font-size: .84rem; font-weight: 800; padding: 7px 13px; border-radius: 999px; cursor: pointer;
                  border: 1px solid var(--border); background: var(--bg); color: var(--sub); }
.pt-kids button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pt-kids button.add { border-style: dashed; }
.pt-form { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: 1fr; }
.pt-seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); width: 100%; }
.pt-seg label { flex: 1; text-align: center; cursor: pointer; }
.pt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pt-seg span { display: block; padding: 9px 8px; border-radius: 10px; font-size: .9rem; font-weight: 800; color: var(--muted); transition: background .15s ease, color .15s ease; }
.pt-seg input:checked + span { background: var(--card); color: var(--accent); box-shadow: 0 2px 8px -4px rgba(0,0,0,.25); }
.pt-seg input:focus-visible + span { outline: 2px solid var(--accent2); outline-offset: 1px; }
.pt-field { display: grid; gap: 5px; }
.pt-field > span { font-size: .8rem; font-weight: 800; color: var(--sub); }
.pt-field input { font: inherit; font-size: 1rem; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border);
                  background: var(--bg); color: var(--text); width: 100%; min-height: 46px; }
.pt-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pt-btn { font: inherit; font-weight: 800; font-size: .95rem; padding: 12px 18px; border-radius: 12px; cursor: pointer; border: 1px solid transparent;
          background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; flex: 1 1 auto; min-height: 46px; }
.pt-btn.ghost { background: transparent; color: var(--muted); border-color: var(--border); flex: 0 0 auto; }
.pt-btn:hover { filter: brightness(1.05); }
.pt-privacy { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; color: var(--muted); margin-top: 14px;
              padding: 10px 12px; border-radius: 12px; background: var(--bg); word-break: var(--xn-wb, keep-all); }
.pt-err { color: var(--warn); font-size: .86rem; font-weight: 700; }
.pt-err:empty { display: none; }

.pt-result { margin-top: 18px; display: grid; gap: 14px; }
.pt-result[hidden] { display: none; }
.pt-big { text-align: center; padding: 18px 12px; border-radius: 18px; background: linear-gradient(160deg, var(--accent-soft), var(--bg)); }
.pt-big .who { font-size: .86rem; font-weight: 800; color: var(--accent); }
.pt-big .age { font-size: clamp(1.7rem, 7vw, 2.3rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.25; margin-top: 4px; }
.pt-big .sub { font-size: .9rem; color: var(--sub); margin-top: 4px; }
.pt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pt-stat { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 10px 8px; text-align: center; }
.pt-stat b { display: block; font-size: .74rem; color: var(--muted); font-weight: 800; }
.pt-stat span { display: block; font-size: .98rem; font-weight: 900; margin-top: 2px; font-variant-numeric: tabular-nums; }
.pt-stat em { display: block; font-style: normal; font-size: .72rem; color: var(--muted); }
.pt-now { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; text-decoration: none;
          background: var(--card); border: 2px solid var(--accent); }
.pt-now .i { font-size: 2rem; }
.pt-now small { display: block; font-size: .76rem; font-weight: 800; color: var(--accent); }
.pt-now strong { display: block; font-size: 1.08rem; font-weight: 900; }
.pt-now .go { margin-left: auto; color: var(--accent); font-weight: 900; }
.pt-due h3 { font-size: .95rem; font-weight: 900; margin: 4px 0 8px; display: flex; align-items: center; gap: 6px; }
.pt-due h3 a { margin-left: auto; font-size: .78rem; font-weight: 800; color: var(--accent); text-decoration: none; }
.pt-due ul { list-style: none; display: grid; gap: 6px; }
.pt-due li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font-size: .9rem; }
.pt-due li.done { opacity: .55; }
.pt-due li.done .nm { text-decoration: line-through; }
.pt-due .nm { flex: 1; min-width: 0; font-weight: 700; }
.pt-due .nm small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.pt-due .when { font-size: .78rem; font-weight: 800; white-space: nowrap; text-align: right; }
.pt-due .tag { display: inline-block; font-size: .7rem; font-weight: 900; padding: 2px 8px; border-radius: 999px; margin-bottom: 2px; }
.tag.now { background: var(--accent-soft); color: var(--accent); }
.tag.soon { background: var(--sky-soft); color: var(--sky); }
.tag.past { background: var(--warn-soft); color: var(--warn); }
.pt-due input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ok); flex: 0 0 auto; cursor: pointer; }
.pt-empty { font-size: .86rem; color: var(--muted); padding: 6px 2px; word-break: var(--xn-wb, keep-all); }
.pt-past { margin-top: 8px; }
.pt-past summary { cursor: pointer; font-size: .84rem; font-weight: 800; color: var(--warn); padding: 6px 2px; }
.pt-past ul { margin-top: 4px; }

/* ── 홈: 그룹 카드 ── */
.pt-group { margin-top: 44px; scroll-margin-top: calc(var(--barh) + 12px); }
.pt-group > h2 { font-size: 1.3rem; font-weight: 900; letter-spacing: -.02em; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.pt-group > h2::after { content: ''; flex: 1; height: 1px; background: var(--border); margin-left: 8px; }
.pt-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pt-card { display: flex; gap: 12px; align-items: flex-start; padding: 15px 15px; border-radius: var(--radius); text-decoration: none;
           background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 0;
           transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.pt-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.pt-card .i { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
              font-size: 1.5rem; background: var(--accent-soft); }
.pt-card .b { min-width: 0; }
.pt-card strong { display: block; font-size: 1rem; font-weight: 900; line-height: 1.35; }
.pt-card p { font-size: .84rem; color: var(--muted); line-height: 1.55; margin-top: 3px; word-break: var(--xn-wb, keep-all);
             display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pt-age { display: inline-block; font-size: .72rem; font-weight: 900; color: var(--accent); background: var(--accent-soft);
          padding: 2px 9px; border-radius: 999px; margin-bottom: 4px; }
/* 성장 단계는 가로 타임라인처럼 — 번호 띠 */
.pt-cards.stage .pt-card .i { background: linear-gradient(135deg, var(--accent-soft), var(--bg2)); }
.pt-card.is-now { border: 2px solid var(--accent); }

/* ── 응급·고지 ── */
.pt-sos { margin-top: 44px; display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.pt-sos a { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius); text-decoration: none;
            background: var(--warn-soft); border: 1px solid var(--warn-line); }
.pt-sos .n { font-size: 1.6rem; font-weight: 900; color: var(--warn); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pt-sos .d { font-size: .84rem; color: var(--sub); line-height: 1.45; word-break: var(--xn-wb, keep-all); }
.pt-sos .d b { display: block; color: var(--text); font-size: .92rem; }
.pt-sos-h { grid-column: 1 / -1; font-size: 1.05rem; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.pt-disc { margin: 18px auto 0; font-size: .8rem; color: var(--muted); line-height: 1.65; padding: 12px 14px; border-radius: 14px;
           border: 1px dashed var(--border); word-break: var(--xn-wb, keep-all); }
.pt-disc b { color: var(--sub); }

/* ── 글 페이지 ── */
.pt-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 22px; font-size: .84rem; color: var(--muted); }
.pt-crumb a { text-decoration: none; font-weight: 700; color: var(--sub); }
.pt-crumb a:hover { color: var(--accent); }
.pt-crumb .sep { opacity: .5; }
.pt-head { padding: 18px 0 8px; }
.pt-head .ico { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
                font-size: 2.2rem; background: var(--accent-soft); margin-bottom: 14px; }
.pt-head h1 { font-size: clamp(1.65rem, 6vw, 2.3rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.28; word-break: var(--xn-wb, keep-all); }
.pt-head .pt-age { font-size: .8rem; margin: 0 0 8px; }
.pt-head .sum { font-size: 1.08rem; line-height: 1.75; color: var(--sub); margin-top: 12px; font-weight: 500; word-break: var(--xn-wb, keep-all); }
.pt-head .meta { font-size: .78rem; color: var(--muted); margin-top: 10px; }

.pt-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 18px; }
@media (min-width: 1000px) { .pt-layout { grid-template-columns: minmax(0, 1fr) 240px; } .pt-toc { order: 2; } }
.pt-toc { align-self: start; }
.pt-toc nav { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 10px; }
@media (min-width: 1000px) { .pt-toc nav { position: sticky; top: calc(var(--barh) + 16px); max-height: calc(100vh - var(--barh) - 32px); overflow: auto; } }
.pt-toc b { display: block; font-size: .74rem; font-weight: 900; letter-spacing: .06em; color: var(--muted); padding: 0 8px 6px; }
.pt-toc ol { list-style: none; display: grid; gap: 1px; }
.pt-toc a { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 10px; text-decoration: none;
            font-size: .88rem; color: var(--sub); line-height: 1.45; border-left: 3px solid transparent; transition: background .15s ease, color .15s ease; }
.pt-toc a:hover { background: var(--bg); color: var(--text); }
.pt-toc a.on { background: var(--accent-soft); color: var(--accent); font-weight: 800; border-left-color: var(--accent); }
/* 좁은 화면: 본문 위에 붙는 가로 칩 띠. 읽는 내내 지금 위치가 보인다. */
@media (max-width: 999px) {
  .pt-toc { position: sticky; top: var(--barh); z-index: 30; margin: 0 -16px; }
  .pt-toc nav { border: 0; border-radius: 0; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--border);
                overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pt-toc nav::-webkit-scrollbar { display: none; }
  .pt-toc b { display: none; }
  .pt-toc ol { display: flex; gap: 6px; width: max-content; }
  .pt-toc a { white-space: nowrap; font-size: .82rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); }
  .pt-toc a.on { border-color: var(--accent); }
  .pt-sec { scroll-margin-top: calc(var(--barh) + 64px); }
}

.pt-art { min-width: 0; }
.pt-sec { padding: 26px 0 8px; scroll-margin-top: calc(var(--barh) + 14px); border-top: 1px solid var(--border); }
.pt-sec:first-child { border-top: 0; padding-top: 4px; }
.pt-sec > h2 { font-size: 1.32rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.35; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pt-sec > h2 .si { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; background: var(--bg2); }
.pt-sec p { font-size: 1.03rem; line-height: 1.9; margin-bottom: 14px; word-break: var(--xn-wb, keep-all); }
.pt-check { list-style: none; display: grid; gap: 8px; margin: 4px 0 16px; }
.pt-check li { position: relative; padding: 11px 14px 11px 44px; border-radius: 14px; background: var(--card); border: 1px solid var(--border);
               font-size: .98rem; line-height: 1.65; word-break: var(--xn-wb, keep-all); }
.pt-check li::before { content: '✓'; position: absolute; left: 13px; top: 11px; width: 21px; height: 21px; border-radius: 7px;
                       display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 900; color: #fff; background: var(--ok); }
.pt-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; margin: 6px 0 16px; font-size: .98rem; line-height: 1.75; word-break: var(--xn-wb, keep-all); }
.pt-box .bi { font-size: 1.25rem; line-height: 1.4; flex: 0 0 auto; }
.pt-box b { display: block; font-size: .78rem; font-weight: 900; letter-spacing: .03em; margin-bottom: 2px; }
.pt-box.tip { background: var(--tip-soft); border: 1px solid var(--tip-line); }
.pt-box.tip b { color: #a07a00; }
.pt-box.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); border-left: 5px solid var(--warn); }
.pt-box.warn b { color: var(--warn); }
@media (prefers-color-scheme: dark) { .pt-box.tip b { color: #f2cf62; } }

/* 표(예방접종·건강검진) */
.pt-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 16px; background: var(--card); margin: 6px 0 12px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 460px; }
.pt-table th, .pt-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; word-break: var(--xn-wb, keep-all); }
.pt-table thead th { font-size: .76rem; font-weight: 900; color: var(--muted); background: var(--bg); position: sticky; top: 0; }
.pt-table tbody tr:last-child td, .pt-table tbody tr:last-child th { border-bottom: 0; }
.pt-table th[scope=row] { font-weight: 900; background: var(--bg); min-width: 130px; }
.pt-table .when { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pt-table small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.pt-vnote { font-size: .84rem; color: var(--muted); margin: -4px 0 8px; }
.pt-dose { display: inline-flex; flex-direction: column; margin: 0 6px 6px 0; padding: 6px 10px; border-radius: 10px; background: var(--accent-soft); vertical-align: top; }
.pt-dose b { font-size: .74rem; color: var(--accent); }
.pt-dose span { font-size: .86rem; font-weight: 800; }

.pt-faq { display: grid; gap: 8px; }
.pt-faq details { border: 1px solid var(--border); border-radius: 14px; background: var(--card); padding: 13px 16px; }
.pt-faq details[open] { border-color: var(--accent); }
.pt-faq summary { cursor: pointer; list-style: none; font-weight: 800; font-size: 1rem; display: flex; gap: 10px; align-items: baseline; word-break: var(--xn-wb, keep-all); }
.pt-faq summary::-webkit-details-marker { display: none; }
.pt-faq summary::before { content: 'Q'; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
                          font-size: .74rem; font-weight: 900; color: #fff; background: var(--accent); transform: translateY(-1px); }
.pt-faq details p { margin: 10px 0 0 32px; font-size: .98rem; line-height: 1.8; word-break: var(--xn-wb, keep-all); }
.pt-src { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.pt-src li { font-size: .82rem; padding: 5px 11px; border-radius: 999px; background: var(--bg2); color: var(--sub); }
.pt-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; }
.pt-nav a { display: block; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); text-decoration: none; min-width: 0; }
.pt-nav a:hover { border-color: var(--accent); }
.pt-nav small { display: block; font-size: .74rem; font-weight: 800; color: var(--muted); }
.pt-nav strong { display: block; font-size: .98rem; font-weight: 900; margin-top: 2px; }
.pt-nav .next { text-align: right; grid-column: 2; }
.pt-h2 { font-size: 1.2rem; font-weight: 900; letter-spacing: -.02em; margin: 34px 0 12px; display: flex; align-items: center; gap: 8px; }
.pt-mini { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pt-prog { position: fixed; left: 0; right: 0; bottom: 0; height: 3px; z-index: 40; pointer-events: none; }
.pt-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

.back { text-align: center; margin: 26px 0 40px; font-size: .85rem; color: var(--muted); }
.back a { color: var(--accent); text-decoration: none; }

@media (max-width: 560px) {
  .pt-calc { padding: 18px 14px; border-radius: 20px; }
  .pt-sos { grid-template-columns: 1fr; }
  .pt-cards { grid-template-columns: 1fr; }
  .pt-stat span { font-size: .9rem; }
  .pt-faq details p { margin-left: 0; }
  .pt-nav { grid-template-columns: 1fr; }
  .pt-nav .next { grid-column: 1; }
  .pt-table { min-width: 0; font-size: .84rem; }
  .pt-table th, .pt-table td { padding: 9px 8px; }
  .pt-table th[scope=row] { min-width: 0; width: 38%; }
  .pt-table .when { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .pt-card, .pt-quick a { transition: none; } .pt-card:hover, .pt-quick a:hover { transform: none; } }
