@charset "UTF-8";
/* 첫날부터 디자인 시스템. 인라인 style 금지(CSP style-src 'self') — 모든 모양은 이 파일의 클래스로. */
:root {
  --bg: #FFFFFF; --band: #F6F5F2; --band-2: #EDEBE6; --line: #E2E0DB; --line-2: #C9C6BF; --ink-line: #141414;
  --fg: #141414; --fg-2: #3D3D3D; --muted: #5F5F5F; --field: #767676;
  --accent: #C8102E; --accent-d: #A30D26; --accent-bg: #FBECEE;
  --warn: #7A4A0B; --warn-bg: #FFF3CF; --bad: #B3261E;
  --r: 4px; --r-ctl: 10px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --f1: 13px; --f2: 15px; --f3: 17px; --f4: 21px; --f5: 28px; --f6: 40px; --f7: 56px;
  --gutter: max(var(--s4), calc((100% - 1080px) / 2 + var(--s4)));
  --bar-h: 64px; --hdr-h: 56px; --tab-h: 56px;
  --blue: #2F5D8A; --blue-bg: #EAF2FB; --blue-line: #BFD5EE;
  /* 오행: 면(막대·점)은 기본색, 글자·라벨·셀 경계는 -text(배경 #fff·--bg·--pillar-day·--band-2 대비 4.5:1 이상) */
  --el-wood: #3F8A5F; --el-wood-text: #2A6B5E; --el-fire: #D9503F; --el-fire-text: #B5452F;
  --el-earth: #B7791F; --el-earth-text: #8A5A12; --el-metal: #8A8F98; --el-metal-text: #5F6572;
  --el-water: #2F5D8A; --el-water-text: #2F5D8A; --pillar-day: #EDEBE6;
  --sage-line: #7A9483;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: var(--f3)/1.6 "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--fg); background: var(--bg); word-break: keep-all; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
img, video, svg { max-width: 100%; }
a { color: var(--fg); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.025em; line-height: 1.3; margin: 0; text-wrap: balance; }
h1 { font-size: var(--f5); margin: var(--s2) 0 var(--s3); word-break: keep-all; text-wrap: balance; }
.h1-sub { display: block; margin-top: var(--s1); font-size: 18px; font-weight: 700; color: var(--fg-2); }
@media (max-width: 767px) { h1 { font-size: 26px; } }
h2 { font-size: var(--f4); margin: var(--s5) 0 var(--s2); }
h3 { font-size: var(--f3); }
p { margin: 0 0 var(--s3); text-wrap: pretty; }
small { font-size: var(--f1); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink-line); outline-offset: 3px; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }

/* 머리글·바닥글 */
.site-header { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); min-height: var(--hdr-h); padding: var(--s1) var(--gutter); background: var(--bg); border-bottom: 1px solid var(--ink-line); }
.brand { display: inline-flex; flex: none; white-space: nowrap; align-items: center; gap: var(--s2); min-height: 44px; font-size: 21px; font-weight: 900; letter-spacing: -0.04em; color: var(--fg); text-decoration: none; }
.logo { width: 32px; height: 32px; color: var(--fg); }
.site-header nav { display: flex; flex-wrap: wrap; margin-left: auto; gap: var(--s1); margin-right: calc(-1 * var(--s3)); }
.site-header nav a { display: inline-flex; align-items: center; white-space: nowrap; min-height: 44px; padding: 0 var(--s3); border-radius: var(--r); font-size: var(--f2); font-weight: 700; color: var(--fg); text-decoration: none; }
.site-header nav a[aria-current="page"] { font-weight: 800; color: var(--fg); text-decoration: underline; text-decoration-color: var(--ink-line); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.nav-s { display: none; }
/* 메뉴 패널(details, JS 없음): 768 미만은 머리글 아래로 펼치는 전체 메뉴, 768+ 는 summary 를 숨기고 가로로 펼친다 */
.site-menu { margin-left: auto; }
.site-menu > summary { display: inline-flex; align-items: center; gap: var(--s1); min-height: 44px; margin-right: calc(-1 * var(--s3)); padding: 0 var(--s3); border-radius: var(--r); font-size: var(--f2); font-weight: 700; color: var(--fg); cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.site-menu > summary::-webkit-details-marker { display: none; }
.menu-ic, .tab-ic { width: 24px; height: 24px; flex: none; }
.site-menu > summary:focus-visible { outline: 2px solid var(--ink-line); outline-offset: -3px; }
.site-menu[open] .i-open, .site-menu:not([open]) .i-shut { display: none; }
.menu-h { margin: 0; font-size: var(--f1); font-weight: 700; color: var(--muted); }
@media (max-width: 767px) {
  .menu-panel { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; max-height: calc(100vh - var(--hdr-h) - var(--tab-h)); overflow-y: auto; padding: var(--s2) var(--gutter) calc(var(--tab-h) + env(safe-area-inset-bottom) + var(--s4)); background: var(--bg); border-bottom: 1px solid var(--ink-line); }
  /* 열린 동안 본문을 가리는 막(패널 아래·하단 탭 아래). summary 의 가상 요소라 막을 누르면 메뉴가 닫힌다 */
  .site-menu[open] > summary::after { content: ""; position: fixed; inset: var(--hdr-h) 0 0; z-index: 9; background: rgba(20, 20, 20, .45); cursor: default; }
  .site-header .menu-panel nav { gap: var(--s2); margin: var(--s2) 0 0; }
  .site-header .menu-panel nav a { padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r); white-space: normal; }
  .site-header .menu-more { display: none; }
  /* '자주 찾는 도구'는 아래 시기 지도와 링크가 겹쳐 768 미만에서 숨긴다(DOM 은 그대로) */
  .site-header .menu-panel > .menu-h, .site-header .menu-panel > .menu-h + nav { display: none; }
  /* 전체 지도: 왼쪽 묶음 제목, 오른쪽 1열 목록. 소개는 맨 아래 한 줄 */
  .site-header .menu-panel .menu-map { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 0; margin-top: var(--s4); }
  .menu-map .menu-h { padding: 12px var(--s2) 0 0; border-top: 1px solid var(--line); }
  .menu-map ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
  .site-header .menu-panel .menu-map a { display: flex; padding: 0; border: 0; font-weight: 600; }
  .menu-about { grid-column: 1 / -1; margin: 0; border-top: 1px solid var(--line); }
}
/* 하단 탭(768 미만): 홈·도구·가이드·사주·이름. 현재 구역은 색만이 아니라 위 2px 선 + 굵기로 표시 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--ink-line); }
.tabbar a { position: relative; flex: 1 1 0; min-width: 64px; min-height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: var(--f1); font-weight: 600; line-height: 1.2; color: var(--muted); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.tabbar a[aria-current="page"] { color: var(--fg); font-weight: 800; }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 20%; right: 20%; height: 2px; background: var(--accent); }
.tabbar a:focus-visible { outline: 2px solid var(--ink-line); outline-offset: -3px; }
body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + var(--s4)); }
.site-footer { display: block; margin-top: var(--s6); padding: var(--s3) var(--gutter) var(--s5); border-top: 1px solid var(--ink-line); background: var(--bg); }
.site-footer nav { display: flex; flex-wrap: wrap; margin-left: calc(-1 * var(--s2)); overflow: hidden; }
.site-footer a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s2); font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
/* 구분점은 모든 링크 앞에 두고, 줄 첫 링크의 점은 nav 왼쪽 밖이라 잘린다(줄 끝·줄 첫머리에 홀로 남지 않음). 포커스 테두리는 안쪽으로 */
.site-footer a::before { content: "·"; position: absolute; right: 100%; color: var(--muted); text-decoration: none; }
.site-footer a:focus-visible { outline-offset: -3px; }
.footer-name { margin: var(--s2) 0 0; font-size: 14px; color: var(--muted); }

/* 본문 폭 */
.page { max-width: 1080px; margin: 0 auto; padding: var(--s3) var(--s4) 0; }
.prose { max-width: 680px; line-height: 1.75; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: var(--s2); }
.lead { font-size: var(--f3); color: var(--fg-2); }
.nw { white-space: nowrap; }
.nb { white-space: nowrap; }
.updated, .hint { color: var(--muted); font-size: var(--f1); }
.hint { font-size: var(--f2); }
.hint-fill { text-wrap: wrap; }
.warn { color: var(--bad); min-height: 1.2em; font-weight: 700; font-size: var(--f2); }
.warn-fold:empty { min-height: 0; margin: 0; }
.note-warn { margin: var(--s1) 0 0; font-size: var(--f1); font-weight: 700; color: var(--warn); }

/* 칩 */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s3); list-style: none; margin: var(--s2) 0 0; padding: 0; border-bottom: 1px solid var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px; border-radius: var(--r); font-size: var(--f1); font-weight: 700; line-height: 1.3; background: var(--band-2); color: var(--fg-2); white-space: nowrap; }
.chip-mint, .chip-health, .chip-oral { background: var(--band-2); color: var(--fg-2); }
.chip-coral { background: none; color: var(--accent); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chips .chip { gap: 0; min-height: 44px; padding: 0; background: none; font-size: var(--f2); font-weight: 700; color: var(--muted); }
.chips .chip .ic { display: none; width: 18px; height: 18px; }

/* 버튼 */
button, .btn { font: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 52px; padding: 0 var(--s5); border: 1.5px solid var(--ink-line); border-radius: var(--r-ctl); font-size: var(--f3); font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: transform .12s ease, background-color .15s ease, color .15s ease; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink-line); color: #fff; }
.btn-primary:active { background: #000; }
.btn-secondary { background: var(--bg); color: var(--fg); }
.btn-secondary:active { background: var(--band-2); }
.btn-soft { background: var(--bg); color: var(--fg); border-color: var(--line-2); }
.btn-text { min-height: 44px; padding: 0 var(--s3); border: 0; border-radius: 0; background: none; color: var(--fg); text-decoration: underline; font-weight: 600; font-size: var(--f2); }
.btn-block { width: 100%; }
@media (max-width: 767px) { .name-go .btn { width: 100%; } }
.btn-sub { font-size: var(--f1); font-weight: 600; }

/* 입력 */
.card, .panel, .preview, .sheet { background: none; border: 0; border-radius: 0; padding: 0; margin: var(--s3) 0; }
.card + .card { padding-top: var(--s3); border-top: 1px solid var(--line); }
form.panel { margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4)); padding: var(--s4); background: var(--band); }
.panel label { display: block; font-weight: 700; margin: var(--s3) 0 var(--s1); }
.panel > label:first-child { margin-top: 0; }
.panel label, .panel legend { font-size: var(--f2); }
input[type=date], input[type=number], .panel input[type=text], select { font: inherit; width: 100%; min-height: 52px; padding: var(--s2) var(--s3); border: 1px solid var(--field); border-radius: var(--r-ctl); background: var(--bg); color: var(--fg); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink-line); outline: 2px solid var(--ink-line); outline-offset: 0; }
.notice { margin: var(--s3) 0; padding: var(--s2) 0 0; border-top: 1px solid var(--line); font-size: var(--f2); color: var(--fg-2); }
.src-list { margin: var(--s2) 0 0; padding-left: var(--s5); font-size: var(--f1); }
.src-list a { display: inline-flex; align-items: center; min-height: 44px; }
.empty-note { display: flex; align-items: center; gap: var(--s4); margin: var(--s3) 0; padding: var(--s4); border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--muted); }
.empty-note img { width: 96px; height: 96px; flex: none; border-radius: var(--r); }
.empty-note p { margin: 0; font-size: var(--f2); }
#result:not([hidden]) + .empty-note { display: none; }

/* 카드: 표면은 없다. 구분은 hairline(공통 초기화는 입력 절) */
.card h2, .card h3 { margin: 0; }

/* 홈: 히어로 */
.hero { position: relative; display: flex; flex-direction: column; gap: var(--s3); padding: 0; text-align: left; }
.hero picture { display: block; width: 100%; border-radius: var(--r); overflow: hidden; background: var(--band); }
/* <600 그림 띠: 그림을 240px 폭 가운데에 두어(양옆은 --band) 96px 높이에 정수리·리본부터 턱까지 들어오게, 위쪽 기준으로 자른다 */
.hero img { display: block; width: 240px; height: 96px; margin: 0 auto; object-fit: cover; object-position: center 20%; }
.hero-copy { width: 100%; }
.hero h1 { font-size: var(--f5); margin: 0 0 var(--s2); }
.hero .lead { margin: 0 0 var(--s2); }
/* 모바일 리드는 1줄: 둘째 문장은 신뢰 문구 줄(입력값은 내 폰에만)과 겹쳐 600+ 에서만 보인다 */
.hero .lead-more { display: none; }
.hero-cta { display: none; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
/* 히어로 그림 놀이: hero.js 가 .hero-art 에 .on 과 버튼·말풍선·반짝이·조각을 붙인다(JS 가 없으면 그림만). 모두 absolute 라 흐름에 영향 없음.
   기울기 값은 JS 가 CSS 변수(--hx·--hy 최대 6px, --hrx·--hry 최대 3°)로만 넘긴다. 튕김은 기울기(picture 의 transform)와 겹치지 않게 안쪽 img 에 */
.hero-art { position: relative; }
.hero-art.on picture { transform: perspective(800px) translate(var(--hx, 0px), var(--hy, 0px)) rotateX(var(--hrx, 0deg)) rotateY(var(--hry, 0deg)); transition: transform .3s ease-out; }
.hero-art.pop img { animation: hero-pop .35s ease-out; }
@keyframes hero-pop { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.03); } }
.hero-play { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: var(--r); background: none; cursor: pointer; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.hero-play:focus-visible { outline-offset: -5px; border-radius: var(--r); }
.hero-spark { position: absolute; width: 14px; height: 14px; background: #F2A93B; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); opacity: .3; pointer-events: none; animation: hero-twinkle 3s ease-in-out infinite; }
.hero-spark-1 { top: 8%; right: 10%; }
.hero-spark-2 { top: 34%; right: 4%; width: 10px; height: 10px; animation-delay: -1s; animation-duration: 3.6s; }
.hero-spark-3 { bottom: 14%; right: 30%; animation-delay: -2s; }
.hero-spark-4 { top: 14%; right: 42%; width: 10px; height: 10px; animation-delay: -.6s; animation-duration: 4s; }
@keyframes hero-twinkle { 0%, 100% { opacity: .25; scale: .7; } 50% { opacity: 1; scale: 1; } }
.hero-bubble { position: absolute; top: 12px; right: 12px; z-index: 2; width: max-content; max-width: min(300px, calc(100% - 24px)); padding: 10px 44px 10px 14px; border: 1px solid var(--ink-line); border-radius: var(--r); background: var(--bg); color: var(--fg); font-size: var(--f2); font-weight: 700; line-height: 1.4; text-align: left; }
.hero-bubble p { margin: 0; }
.hero-bubble a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; }
.hero-bubble-x { position: absolute; top: 0; right: 0; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: var(--r); background: none; color: var(--muted); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
/* 축하 조각: 누른 자리(--px·--py)에서 --dx·--dy 만큼 날아가며 .9초 안에 사라진다(JS 가 1초 뒤 DOM 에서 지운다) */
.hero-bit { position: absolute; left: var(--px, 50%); top: var(--py, 50%); width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--fg); pointer-events: none; animation: hero-fly .9s cubic-bezier(.2, .7, .3, 1) forwards; }
.hero-bit:nth-child(3n) { background: var(--field); }
.hero-bit:nth-child(3n+1) { background: #F2A93B; }
.hero-bit-heart { clip-path: path("M6 11 1.3 6.3A2.8 2.8 0 0 1 6 2.5a2.8 2.8 0 0 1 4.7 3.8Z"); }
.hero-bit-star { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.hero-bit-paper { width: 6px; height: 10px; margin: -5px 0 0 -3px; border-radius: 1px; }
@keyframes hero-fly { 0% { transform: translate(0, 0) rotate(0deg) scale(.4); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--rot, 0deg)) scale(1); opacity: 0; } }
/* ≤959px: 말풍선은 그림 하단 띠(한 줄 문구·링크·×, 높이 44px) — 아기 얼굴과 그림 가운데(누르는 자리)를 덮지 않고 그림 밖(아래 제목)으로도 나가지 않는다 */
@media (max-width: 959px) {
  .hero-bubble { top: auto; right: 8px; bottom: 4px; left: 8px; display: flex; align-items: center; gap: var(--s2); width: auto; max-width: none; height: 44px; padding: 0 44px 0 12px; border-radius: var(--r); font-size: var(--f1); white-space: nowrap; }
  .hero-bubble p { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero-bubble a { flex: none; }
}

/* 홈: 시기 칩 줄(.saju-toc 모양 공유, sticky 아님) → 시기 묶음 5개. 묶음마다 전폭 한 줄, 임신 중·출생 직후 묶음은 가로형 compact 카드 */
.period-nav { margin: var(--s3) 0 0; padding: var(--s2) 0 0; border-bottom: 1px solid var(--line); }
.period-nav .toc-link { display: inline-flex; align-items: center; }
.periods { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--s6); }
.period { min-width: 0; scroll-margin-top: calc(var(--hdr-h) + var(--s3)); }
/* 묶음 제목은 막대 없는 작은 라벨(묶음마다 색을 바꾸지 않는다) */
.period-title { margin: var(--s2) 0 var(--s1); font-size: var(--f2); font-weight: 700; color: var(--muted); }
/* 홈 첫 화면: 출생일 띠 → 시기 이동 → 도구 목록(카드 없이 hairline 행, 화살표는 호버 기기만), 오늘은 생활 날짜 묶음 바로 위 */
.home-start { margin-top: calc(-1 * var(--s3)); }
.home-start h1 { margin: 0 0 var(--s3); font-size: var(--f4); }
.home-start .warn { margin: var(--s1) 0 0; }
.home-start .btn { margin-top: var(--s3); }
.home-start .hint { margin: var(--s2) 0 0; font-size: var(--f1); }
.trust { margin: var(--s1) 0 0; font-size: var(--f1); font-weight: 700; color: var(--fg-2); }
.today { padding: var(--s4) 0; border-bottom: 1px solid var(--ink-line); }
.today-k { margin: 0; font-size: var(--f1); font-weight: 700; color: var(--muted); }
.today-big { min-height: 1.2em; margin: 0 0 var(--s2); font-size: var(--f5); font-weight: 900; letter-spacing: -0.03em; line-height: 1.2; }
.dlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dlist li { border-bottom: 1px solid var(--line); }
.dlist a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s3); align-items: center; min-height: 44px; padding: var(--s1) 0; text-decoration: none; }
.dl-name { font-size: var(--f2); font-weight: 700; }
.dl-date { grid-column: 1; font-size: var(--f1); color: var(--muted); }
.dlist strong { grid-column: 2; grid-row: 1 / span 2; font-size: var(--f4); font-weight: 900; color: var(--accent); }
.periods .period-title { margin-top: var(--s4); }
.ilist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink-line); }
.ilist li { border-bottom: 1px solid var(--line); }
.ilist a { display: grid; grid-template-columns: 20px 2.2em minmax(0, 1fr); grid-template-areas: "i n t" "i n d"; column-gap: var(--s2); align-items: baseline; min-height: 60px; padding: var(--s3) 0; text-decoration: none; }
.ilist .n { grid-area: n; font-size: var(--f1); font-weight: 700; color: var(--muted); }
.ilist .t { grid-area: t; font-size: var(--f3); font-weight: 800; }
.ilist .d { grid-area: d; font-size: var(--f2); line-height: 1.45; color: var(--muted); }
.ilist .ic { grid-area: i; align-self: start; margin-top: calc((var(--f3) * 1.6 - 20px) / 2); }
.ilist a, .dlist a, .guide-list a { transition: background-color 120ms ease-out; }
.ilist a:active, .dlist a:active, .guide-list a:active, .btn-secondary:active, .btn-soft:active { background: var(--band); }

/* 홈: 도구 카드 2단 — 대표(.tool-lg, 돌잔치 플래너 1개) / 소형(나머지). 표면은 모든 카드 같은 흰 배경 + 1px 테두리, 아이콘은 컨테이너 없는 선 한 색. 대표 카드만 테두리 2px */
.tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.period-solo .tools { grid-template-columns: minmax(0, 1fr); }
.tools > li:nth-child(2) { transition-delay: 70ms; }
.tools > li:nth-child(3) { transition-delay: 140ms; }
.tool { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "art" "title" "desc"; gap: 2px var(--s2); align-items: start; align-content: start; height: 100%; min-height: 88px; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--fg); text-decoration: none; transition: transform .18s ease, background-color .15s ease; -webkit-tap-highlight-color: transparent; }
.tool:active { transform: scale(.98); background: var(--band); }
.tool > div { display: contents; }
.tool-art { grid-area: art; display: grid; place-items: center; width: 40px; height: 40px; background: none; border-radius: 0; }
.ic-tool { display: block; width: 100%; height: 100%; color: var(--fg); transition: transform .2s ease; }
.tool h3 { grid-area: title; margin: 0; font-size: var(--f3); }
.tool p { grid-area: desc; align-self: start; margin: 0; font-size: var(--f1); line-height: 1.45; color: var(--muted); }
.tool-go { display: none; }
.tool:not(.tool-lg) { padding: var(--s2) var(--s3); }
.tool:not(.tool-lg) .tool-art { width: 28px; height: 28px; }
.tool-lg { grid-column: 1 / -1; grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "art title" "art desc"; gap: var(--s1) var(--s3); align-items: center; border-width: 2px; }
/* 격자 칸은 <li> 라 대표 카드 칸을 li 에서 2열 전폭으로 연다(a 의 grid-column 은 격자에 안 먹는다) */
.tools > .tool-wide { grid-column: 1 / -1; }
.tool-lg .tool-art { width: 56px; height: 56px; }
.tool-lg h3 { align-self: end; font-size: var(--f4); }
.tool-lg p { font-size: var(--f2); }
.period-solo .tool:not(.tool-lg) { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "art title" "art desc"; gap: 2px var(--s3); align-items: center; align-content: center; min-height: 64px; }
.ic-go { display: block; width: 100%; height: 100%; }
.tool:active .ic-tool { transform: translateY(1px) scale(.96); }
.tool:focus-visible { outline: 2px solid var(--ink-line); outline-offset: 3px; transform: translateY(-3px); }
.tool:focus-visible .ic-tool { transform: translateY(-4px) scale(1.04); }
/* 320~374: 소형 카드는 좌우 여백 8px·제목 15px 로 제목 1줄. 대표 카드는 아이콘 40px·설명 13px 로 설명 2줄 이내 */
@media (max-width: 374px) {
  .tool { padding: var(--s2); }
  .tool:not(.tool-lg) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "art" "title" "desc"; align-items: start; padding: var(--s2); }
  .tool:not(.tool-lg) h3 { font-size: var(--f2); }
  .tool-lg { grid-template-columns: 40px minmax(0, 1fr); }
  .tool-lg .tool-art { width: 40px; height: 40px; }
  .tool-lg p { font-size: var(--f1); }
}

/* 홈: 가이드 미리보기 2편(전체 보기는 제목 줄 오른쪽 글자 링크) */
.home-guides-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--s3); margin-top: var(--s5); }
.home-guides h2 { margin: 0; font-size: var(--f3); }
.home-guides-h a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--f1); font-weight: 600; }
.guide-list-compact { margin: 0 0 var(--s2); padding: 0; list-style: none; }
/* 가이드 목록(/guide/·홈·/name/): 링크 전체가 눌리는 행(44px 이상), 제목 1줄 + 설명 1줄, 밑줄은 제목에만 */
ul.guide-list { margin: 0; padding: 0; list-style: none; line-height: 1.4; border-top: 1px solid var(--line); }
.guide-list li { margin: 0; border-bottom: 1px solid var(--line); }
.guide-list a { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 44px; padding: var(--s2) 0; color: var(--fg); text-decoration: none; }
.guide-list strong { font-weight: 600; color: var(--fg); }
.guide-list a:focus-visible strong { font-weight: 800; }
.guide-list span { font-size: var(--f1); color: var(--muted); }
.guide-group h2 { margin: var(--s5) 0 var(--s1); font-size: var(--f2); font-weight: 700; color: var(--muted); }
/* 가이드 글 접힌 목차(details.toc.saju-more, JS 없음): 열기 표식은 .saju-more, 항목은 .toc-link 규칙을 그대로 쓴다. 목차로 옮겨 간 절 제목은 헤더 높이만큼 띄운다 */
.saju-more.toc { margin: var(--s3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toc ol { margin: 0 0 var(--s2); padding: 0 0 0 1.6em; list-style: decimal; }
.toc li::marker { color: var(--muted); }
.toc[open] .i-open, .toc:not([open]) .i-shut { display: none; }
.toc li { margin: 0; }
.toc .toc-link { display: flex; align-items: center; padding: 0; color: var(--fg); line-height: 1.4; font-weight: 400; text-decoration: underline 1px currentColor; text-underline-offset: 3px; }
.prose h2[id^="s"] { scroll-margin-top: calc(var(--hdr-h) + var(--s3)); }
/* 대기 움직임: enhance.js 가 화면에 보이는 카드에만 .float 를 붙인다(개별 속성 translate 라 hover 의 transform 과 겹치지 않음) */
@keyframes tool-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -2px; } }
.tool.float .ic-tool { animation: tool-bob 7s ease-in-out infinite; }
.tools > li:nth-child(2) .tool.float .ic-tool { animation-duration: 6s; animation-delay: -2s; }
.tools > li:nth-child(3) .tool.float .ic-tool { animation-duration: 8s; animation-delay: -4s; }
.tools > li:nth-child(4) .tool.float .ic-tool { animation-duration: 6.5s; animation-delay: -1s; }
.tools > li:nth-child(5) .tool.float .ic-tool { animation-duration: 7.5s; animation-delay: -3s; }

/* 자사 광고(talking-baby) 카드 — 작은 가로형, 운영자 서비스·광고 표시 유지 */
.tb-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: var(--s3); align-items: center; margin: var(--s4) 0; padding: var(--s3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tb-media { position: relative; display: block; width: 104px; aspect-ratio: 9 / 16; border-radius: var(--r); overflow: hidden; background: var(--band-2); line-height: 0; }
.tb-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.tb-play { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255, 255, 255, .94); pointer-events: none; }
.tb-play::before { content: ""; position: absolute; left: 19px; top: 14px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent var(--fg); }
.tb-playing .tb-play { display: none; }
.tb-bubble { position: absolute; top: 6px; right: 6px; max-width: calc(100% - 12px); padding: 5px 10px; border: 1px solid var(--ink-line); border-radius: var(--r); background: #fff; color: var(--fg); font-size: 12px; font-weight: 800; line-height: 1.3; text-align: left; white-space: nowrap; pointer-events: none; }
.tb-body { min-width: 0; }
.tb-tag { display: inline-block; margin-bottom: var(--s1); padding: 1px 8px; border: 1px solid var(--fg); border-radius: var(--r); background: var(--bg); color: var(--fg); font-size: var(--f1); font-weight: 800; line-height: 1.5; }
.tb-title { font-size: 16px; margin: 0 0 var(--s1); }
.tb-line { margin: 0 0 var(--s2); font-size: var(--f1); color: var(--muted); }
.tb-buy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s2); }
.tb-price { margin: 0; font-size: var(--f3); font-weight: 800; color: var(--fg); }
.tb-buy .btn { min-height: 44px; padding: 0 var(--s4); font-size: var(--f2); }
/* 홈 광고 카드는 도구보다 가볍게: 64px 정사각 썸네일, 표시·가격은 muted, 부제 1줄, 버튼 대신 작은 글자 링크(모든 너비 공통) */
.tb-card[data-place="home"] { grid-template-columns: 64px minmax(0, 1fr); gap: var(--s3); padding: var(--s2) 0; }
.tb-card[data-place="home"] .tb-media { width: 64px; aspect-ratio: 1 / 1; }
.tb-card[data-place="home"] .tb-bubble { display: none; }
.tb-card[data-place="home"] .tb-play { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.tb-card[data-place="home"] .tb-play::before { left: 11px; top: 8px; border-width: 6px 0 6px 10px; }
.tb-card[data-place="home"] .tb-tag { margin: 0; padding: 0; border: 0; color: var(--muted); font-size: var(--f1); font-weight: 600; }
.tb-card[data-place="home"] .tb-title { margin: 0; font-size: var(--f2); }
.tb-card[data-place="home"] .tb-line { margin: 0; font-size: var(--f1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-card[data-place="home"] .tb-buy { padding-top: 0; border-top: 0; }
.tb-card[data-place="home"] .tb-price { font-size: var(--f1); font-weight: 600; color: var(--muted); }
.tb-card[data-place="home"] .tb-buy .btn { padding: 0; border: 0; background: none; color: var(--fg); font-size: var(--f1); font-weight: 700; text-decoration: underline; }

/* T5 */
.layout { display: grid; gap: var(--s3); }
.summary { position: relative; margin: var(--s3) 0; padding: var(--s4) 0; border-top: 1px solid var(--ink-line); border-bottom: 1px solid var(--ink-line); }
.eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s2); font-size: var(--f2); font-weight: 700; color: var(--muted); }
.eyebrow:not(.crumb) a { color: var(--muted); text-decoration: none; }
.sum-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.sum-main h2 { margin: 0; font-size: 20px; }
/* 칩 배경이 요약 카드 배경과 같아 왼쪽 안쪽 여백이 들여쓰기로 보인다 */
#sum-edd-dday { padding-left: 0; }
.sum-dday { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s2); margin: var(--s2) 0 0; }
.dd-num { font-size: var(--f6); font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; color: var(--accent); }
.dd-cap { font-size: var(--f2); color: var(--muted); }
/* 수능·크리스마스 D 값: 화면에서 가장 큰 글자. 자리표시 날짜는 작게 해 좁은 화면에서도 한 줄이다 — 줄 높이는 h2 글자 크기로 정해져 JS 전후 카드 높이가 같다 */
.sum-main .dd-big { font-size: 44px; font-weight: 800; color: var(--accent); }
.dd-big .nb { font-size: 28px; color: var(--fg); }
.sum-note { margin-bottom: var(--s2); }
.sum-sub { margin: var(--s1) 0 0; }
.period { margin: var(--s2) 0 0; font-size: 16px; font-weight: 700; }
.bar { display: block; width: 100%; height: 10px; margin: var(--s2) 0 var(--s1); border: 0; border-radius: var(--r); background: var(--band-2); overflow: hidden; -webkit-appearance: none; appearance: none; }
.bar::-webkit-progress-bar { background: var(--band-2); border-radius: var(--r); }
.bar::-webkit-progress-value { background: var(--ink-line); border-radius: var(--r); transition: width .4s ease; }
.bar::-moz-progress-bar { background: var(--ink-line); border-radius: var(--r); }
.pct { margin: 0 0 var(--s3); font-size: var(--f1); color: var(--muted); }
.sum-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.sum-actions .btn { flex: 1 1 200px; }
.tl { list-style: none; margin: var(--s3) 0; padding: 0 0 0 var(--s4); border-left: 2px solid var(--line); }
.tl-item { position: relative; margin: 0 0 var(--s3) var(--s3); padding: var(--s3) var(--s4); border: 0; border-bottom: 1px solid var(--line); }
.tl-item::before { content: ""; position: absolute; left: -36px; top: 24px; width: 14px; height: 14px; border: 2px solid var(--ink-line); border-radius: 50%; background: var(--bg); }
.tl-open { background: var(--band); }
.tl-open::before { background: var(--ink-line); }
.tl-past::before { border-color: var(--line-2); background: var(--band-2); }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s1); }
.tl-name { flex: 1 1 auto; font-size: var(--f3); }
.tl-period { margin: 0; font-size: 16px; font-weight: 600; }
.tl-sub { margin: var(--s1) 0 0; font-size: var(--f2); color: var(--muted); }
.tl-start { margin: var(--s1) 0 0; font-size: var(--f2); color: var(--muted); }
.tl-start strong { font-size: var(--f3); color: var(--fg); }
.tl-foot { margin: var(--s2) 0 var(--s4); font-size: var(--f2); color: var(--muted); }
.tl-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--s1); font-size: var(--f2); font-weight: 700; }
.chip-st.chip-past { background: var(--band-2); color: var(--muted); }
.chip-st.chip-open { background: var(--fg); color: #fff; }
.chip-st.chip-upcoming { background: var(--bg); color: var(--fg); border: 1px solid var(--ink-line); }
#tl-more .chip-st { min-width: 10em; }
#tl-more .chip-st { justify-content: center; }
.past { margin: var(--s3) 0; }
.past > summary, .vax > summary { display: flex; align-items: center; min-height: 44px; padding: 0 var(--s4); border-radius: var(--r); background: var(--band-2); color: var(--fg); font-weight: 700; font-size: var(--f2); cursor: pointer; }
.vax { margin: var(--s3) 0; }
.vax[open] > summary { margin-bottom: var(--s2); }
.ics-opt { display: flex; flex: 1 1 100%; align-items: center; gap: var(--s2); min-height: 44px; font-size: var(--f2); font-weight: 600; cursor: pointer; }
.ics-opt input { width: 22px; height: 22px; flex: none; accent-color: var(--fg); }
.fb-card { display: grid; grid-template-columns: 88px 1fr; gap: var(--s4); align-items: center; }
.fb-card img { width: 88px; height: 88px; border-radius: var(--r); }
.fb-card .fb-ic { justify-self: center; width: 56px; height: 56px; color: var(--fg); }
.fb-title { margin: 0; font-size: var(--f4); font-weight: 800; }
.fb-title strong { color: var(--accent); }
.fb-date { margin: 0 0 var(--s3); font-size: var(--f2); color: var(--muted); }
.fb-card .btn { grid-column: 1 / -1; }

/* T8 표준예방접종일정표(정적 표)·자주 묻는 질문·관련 도구 */
.table-wrap { overflow-x: auto; margin: var(--s3) 0; }
.vax-table { width: 100%; border-collapse: collapse; font-size: var(--f2); }
.vax-table th, .vax-table td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.vax-table thead th { border-bottom-color: var(--line-2); font-size: var(--f1); }
/* /ddi/2027/ 날짜 표: 320px 에서 세 열이 감싸개 스크롤 없이 들어가게 좌우 여백만 줄인다 */
@media (max-width: 359px) { .vax-tight th, .vax-tight td { padding-left: var(--s2); padding-right: var(--s2); } }
.faq h3 { margin: var(--s4) 0 var(--s1); }
.related { display: grid; gap: var(--s3); }

/* T1 */
.t1-summary { margin: var(--s3) 0; padding: var(--s4) 0; border-top: 1px solid var(--ink-line); border-bottom: 1px solid var(--ink-line); }
.t1-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s3); margin: 0 0 var(--s2); }
.t1-line #t1-count { font-size: var(--f3); font-weight: 700; color: var(--muted); }
.t1-prog { display: flex; align-items: center; gap: var(--s3); }
.t1-prog .bar { flex: 1 1 auto; width: auto; margin: 0; }
/* U6 도구 랜딩 상단(눈썹·근거 줄)·예시 미리보기(결과가 나오면 숨김)·결과 아래 설명 / 글 메타 줄·핵심만·다음 할 일 */
.crumb a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.page > .lead { margin: 0 0 var(--s2); }
.basis { display: flex; flex-wrap: wrap; gap: 2px var(--s4); margin: 0 0 var(--s3); font-size: 14px; color: var(--muted); }
.basis > span { white-space: nowrap; }
@media (max-width: 359px) { .basis > span { white-space: normal; } }
.basis b { margin-right: 6px; font-weight: 700; color: var(--fg); }
.preview { color: var(--fg-2); }
.preview h2 { margin: 0 0 var(--s2); font-size: var(--f3); color: var(--fg); }
.pv-tag { display: inline-block; margin-right: var(--s2); padding: 0 8px; border: 1px solid var(--ink-line); border-radius: var(--r); font-size: var(--f1); font-weight: 800; line-height: 1.6; color: var(--fg); vertical-align: 2px; }
.preview .hint { margin: var(--s2) 0 0; }
.pv-steps { margin: 0; padding: 0; list-style: none; }
.pv-steps li { display: flex; justify-content: space-between; gap: var(--s3); padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.pv-steps li span:last-child { flex: none; color: var(--fg); font-weight: 700; font-variant-numeric: tabular-nums; }
.pv-steps li:first-child { flex-wrap: wrap; }
.pv-steps li:first-child > span:last-child { font-size: 20px; font-weight: 800; }
.results:has(> #result:not([hidden])) > .preview { display: none; }
/* t12 달별 표: 상한에 걸린 달은 옅은 앰버 + '상한 적용' 배지. 600 미만은 묶음 한 행 = 제목 줄(개월·금액) + 보조 줄이라 가로로 넘치지 않는다 */
.t12-cap th, .t12-cap td { background: var(--warn-bg); }
.t12-sub { font-size: var(--f1); color: var(--muted); }
@media (max-width: 599px) {
  .t12-table, .t12-table caption, .t12-table tbody { display: block; }
  .t12-table thead { display: none; }
  .t12-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s1) var(--s3); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); }
  .t12-table th, .t12-table td { padding: 0; border-bottom: 0; background: none; }
  .t12-table td { text-align: right; }
  .t12-table .t12-sub { grid-column: 1 / -1; text-align: left; }
  .t12-table .t12-cap { background: var(--warn-bg); }
}
.doc-n { display: inline-flex; align-items: center; justify-content: center; width: 1.6em; height: 1.6em; margin-right: var(--s2); border-radius: 50%; background: var(--band-2); font-size: var(--f2); }
.t1-doc h3 { margin: var(--s4) 0 var(--s1); font-size: var(--f3); }
.pager { display: grid; list-style: none; padding: 0; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s3) 0; }
.pager a { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 44px; padding: var(--s2) 0; border-top: 1px solid var(--ink-line); color: var(--fg); text-decoration: none; }
.pager small { font-size: var(--f1); color: var(--muted); }
.pager .pager-next { grid-column: 2; text-align: right; }
.src-line { margin: var(--s3) 0 var(--s1); font-size: 14px; }
.key { margin: var(--s3) 0; padding: var(--s1) 0 var(--s1) var(--s4); border-left: 3px solid var(--ink-line); }
.key-h { margin: 0 0 var(--s1); font-weight: 800; color: var(--fg); }
.key ul { margin: 0; padding-left: 1.2em; }
.key .key-go { margin: var(--s2) 0 0; }
.key-go a { display: inline-flex; align-items: center; min-height: 44px; }
.next h3 { margin: var(--s4) 0 var(--s1); font-size: var(--f3); }
.timeline { list-style: none; margin: var(--s3) 0; padding: 0; }
.step { position: relative; padding-left: 28px; margin-bottom: var(--s3); }
.step::before { content: ""; position: absolute; left: 8px; top: 0; bottom: calc(-1 * var(--s3)); width: 2px; background: var(--line); }
.step:last-child::before { bottom: auto; height: 36px; }
.step::after { content: ""; position: absolute; left: 2px; top: 30px; width: 14px; height: 14px; border: 2px solid var(--ink-line); border-radius: 50%; background: var(--bg); }
.step-soon::after { background: var(--ink-line); }
.step-overdue::after { border-color: var(--warn); background: var(--warn); }
.step-done::after { border-color: var(--field); background: var(--field); }
.step-label { display: flex; align-items: center; gap: var(--s3); min-height: 60px; padding: var(--s3); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: transform .12s ease; -webkit-tap-highlight-color: transparent; }
.step-label:active { transform: scale(.98); }
.step-soon .step-label { background: var(--band); }
.step-body { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.step-name { font-weight: 700; font-size: var(--f3); }
.step-date { font-size: var(--f2); color: var(--muted); }
.step-note { font-size: var(--f1); color: var(--muted); }
.step-done .step-name { color: var(--muted); }
.badge { flex: none; padding: 4px 10px; border-radius: var(--r); font-size: var(--f1); font-weight: 800; white-space: nowrap; }
.badge-done { background: var(--band-2); color: var(--fg-2); }
.badge-overdue { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.badge-today { background: var(--fg); color: #fff; }
.badge-upcoming { background: var(--band-2); color: var(--fg-2); }
.step-soon .badge-upcoming { background: var(--fg); color: #fff; }
.chk { -webkit-appearance: none; appearance: none; display: grid; place-content: center; flex: none; width: 28px; height: 28px; margin: 0; border: 2px solid var(--field); border-radius: 8px; background: var(--bg); cursor: pointer; }
.chk::before { content: ""; width: 16px; height: 16px; background: #fff; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); transform: scale(0); transition: transform .12s ease; }
.chk:checked { border-color: var(--ink-line); background: var(--ink-line); }
.chk:checked::before { transform: scale(1); }
.step-pop .chk:checked::before { animation: pop .3s ease-out; }
.actions { margin: var(--s4) 0 0; }
.actions-sub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: var(--s2) 0; }
.actions .hint:empty { display: none; }

/* T1 하단 고정 바: 버튼만 떠 있다. 결과 영역이 보이고 #actions 가 아직 아래일 때만 t1.js 가 보여 준다 */
.t1-result { padding-bottom: calc(var(--bar-h) + var(--tab-h) + var(--s4) + env(safe-area-inset-bottom)); }
html { scroll-padding-bottom: calc(var(--bar-h) + var(--s4)); }
.cta-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: 0 var(--s4) var(--s3); pointer-events: none; }
.cta-bar > * { pointer-events: auto; }
.cta-bar .btn { width: 100%; max-width: 480px; min-height: 52px; }
.cta-msg { max-width: 480px; margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); font-size: var(--f2); }
.cta-msg:empty { display: none; }

/* 광고 자리(구글 광고): 광고 판정이 true 이고 수동 광고 단위 ID(config.js ADSENSE_SLOT)가 있을 때만 보인다(HTML 의 hidden 을 common.js 가 푼다). 클릭 유도 요소 없이 라벨·여백만 */
.ad-slot { position: relative; display: flex; align-items: center; justify-content: center; min-height: 90px; margin: var(--s6) 0; padding: var(--s5) var(--s2) var(--s2); border-radius: var(--r); color: var(--muted); font-size: var(--f1); }
.ad-slot::before { content: "광고"; position: absolute; top: var(--s1); left: var(--s3); font-size: var(--f1); color: var(--muted); }
.ad-slot ins.adsbygoogle { display: block; width: 100%; }

/* 애니메이션 */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.45); } 100% { transform: scale(1); } }
.summary, .t1-summary, .tl-item, .step, .fb-card { animation: rise .26s ease-out both; }
.d1 { animation-delay: 0ms; } .d2 { animation-delay: 40ms; } .d3 { animation-delay: 80ms; } .d4 { animation-delay: 120ms; }
.d5 { animation-delay: 160ms; } .d6 { animation-delay: 200ms; } .d7 { animation-delay: 240ms; } .d8 { animation-delay: 280ms; }
.d9 { animation-delay: 320ms; } .d10 { animation-delay: 360ms; } .d11 { animation-delay: 400ms; } .d12 { animation-delay: 440ms; }
.reveal { transition: opacity .3s ease-out, transform .3s ease-out; }
.reveal.wait { opacity: 0; transform: translateY(16px); }
.reveal.wait.in { opacity: 1; transform: none; }
/* 스크롤 등장: .js 는 enhance.js 가 붙이고, 숨김은 첫 화면 밖 요소의 .wait 뿐이다(JS 가 돌지 않으면 모두 보인다) */
.js .js-reveal { transition: opacity .2s ease-out, transform .2s ease-out; }
.js .js-reveal.wait { opacity: 0; transform: translateY(8px); }

/* 등장: 끝 상태를 남기지 않는다(transform 이 남으면 안쪽 fixed·sticky 기준이 바뀐다) */
@keyframes appear { from { opacity: 0; transform: translateY(8px); } }
#result, .bp { animation: appear .2s ease-out; }

/* 홈 띠 그림: 그림 바탕이 순백이라 띠 색과 곱해 흰 사각형이 보이지 않게 한다 */
.band-main { min-width: 0; }
.band-art { display: block; mix-blend-mode: multiply; }
/* 767 이하: 도구 행을 밀지 않게 그림을 h1 오른쪽에 작게 둔다. h1 두 줄 + 라벨이 그림 높이라 입력 칸에 닿지 않는다. 미리보기가 펼쳐지면 그림을 숨기고 h1 은 전체 폭 */
@media (max-width: 767px) {
  .home-start { position: relative; }
  .band-art { position: absolute; top: var(--s4); right: var(--s4); width: 112px; height: auto; }
  .home-start:not(.pv-open) h1 { min-height: 2.6em; padding-right: 124px; }
  .home-start.pv-open .band-art { display: none; }
  .periods .period-head { margin-top: var(--s2); }
}
.period-head { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); }
.period-head img { flex: none; width: 64px; height: 64px; }
.period-head .period-title { margin: 0; font-weight: 600; color: var(--fg); }

/* 홈 생일 미리보기: 빨강은 결과 숫자에만 */
.bp { margin-top: var(--s3); }
.bp:not([hidden]) ~ .btn { margin-top: var(--s4); }
.bp-day { margin: 0; font-size: var(--f4); font-weight: 800; line-height: 1.2; }
.bp-age { margin: var(--s1) 0 0; font-size: var(--f2); color: var(--fg-2); }
.bp-next { margin: var(--s2) 0 0; padding: 0; list-style: none; font-size: var(--f2); font-weight: 700; }

/* 첫해 타임라인: 눈금 버튼은 막대 위아래로 번갈아 놓는다. 양끝 22px 는 44px 버튼 절반 자리다. 막대 중심은 60px, 위 버튼과 막대 사이 칸은 '오늘' 라벨·말풍선 자리다 */
.tlb { position: relative; height: 110px; margin: var(--s3) 22px 0; }
.tlb-line, .tlb-fill { position: absolute; top: 57px; left: 0; height: 6px; }
.tlb-line { right: 0; background: var(--line); }
.tlb-fill { width: var(--at); background: var(--ink-line); animation: tlb-fill .4s ease-out; }
.tlb-dot { position: absolute; z-index: 1; top: 54px; left: var(--at); width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--accent); pointer-events: none; animation: tlb-go .4s ease-out; }
.tlb-today { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 800; line-height: 1.2; white-space: nowrap; color: var(--accent); }
/* 눈금이 점과 24px 이내일 때의 '오늘': 꼬리 달린 상자. 색은 .tlb-today 의 빨강을 currentColor 로 물려받는다. --push 는 막대 안으로 미는 거리고 꼬리는 그만큼 되돌아 점 위에 남는다 */
.tlb-bubble { bottom: calc(100% + 4px); padding: 1px 4px; border: 1px solid currentColor; border-radius: var(--r); background: var(--bg); transform: translateX(calc(-50% + var(--push))); }
.tlb-bubble::after { content: ""; position: absolute; top: 100%; left: calc(50% - var(--push)); width: 6px; height: 6px; margin: -3px 0 0 -3px; border: solid currentColor; border-width: 0 1px 1px 0; background: var(--bg); transform: rotate(45deg); }
@keyframes tlb-go { from { left: 0; } }
@keyframes tlb-fill { from { width: 0; } }
.tlb-mark { position: absolute; left: var(--at); width: 44px; height: 44px; margin-left: -22px; padding: 0; border: 0; background: none; color: var(--fg); font-size: var(--f1); font-weight: 700; cursor: pointer; }
.tlb-mark::before { content: ""; position: absolute; left: 15px; box-sizing: border-box; width: 14px; height: 14px; border: 2px solid var(--ink-line); border-radius: 50%; background: var(--bg); transition: transform 120ms ease-out; }
.tlb-up { top: 0; }
.tlb-up::before { bottom: -23px; }
.tlb-down { bottom: 0; }
.tlb-down::before { top: -13px; }
.tlb-past { color: var(--muted); }
.tlb-past::before { background: var(--ink-line); }
.tlb-noring::before { display: none; }
.tlb-mark:focus-visible::before { transform: scale(1.4); }
.tlb-mark[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 3px; }
.tlb-say, .tlb-over { margin: var(--s1) 0 0; font-size: var(--f2); font-weight: 700; }
/* 안내·캡션이 같은 한 줄 칸을 쓴다(눌러도 아래가 밀리지 않게). 아래 눈금 버튼의 글자 밑 빈 자리로 10px 올린다: 버튼이 위에 그려져 44px 누름 칸은 그대로다 */
.tlb-say { min-height: 24px; margin-top: -10px; }
.tlb-hint { font-size: var(--f1); font-weight: 400; color: var(--muted); }

/* /t11/ 결과 그림: 값은 SVG 표현 속성으로만 받고 색·크기·움직임은 여기서 준다 */
.fig-sum { display: flex; align-items: center; gap: var(--s5); margin: var(--s3) 0; }
.fig-ring, .fig-blocks { display: block; flex: none; }
.fig-ring-bg { stroke: var(--line); }
.fig-ring-on { stroke: var(--ink-line); animation: fig-ring .4s ease-out; }
.fig-pct { font-size: 22px; font-weight: 800; fill: var(--fg); }
.fig-sub { font-size: 12px; font-weight: 700; fill: var(--muted); }
.fig-over { font-size: var(--f2); font-weight: 800; fill: var(--fg); }
.fig-side { min-width: 0; }
.fig-cell { fill: var(--line); }
.fig-on { fill: var(--ink-line); animation: fig-in .4s ease-out; }
.fig-age { margin: var(--s1) 0 0; font-size: var(--f2); font-weight: 700; }
@keyframes fig-ring { from { stroke-dasharray: 0 100; } }
@keyframes fig-in { from { opacity: 0; } }

/* 기념일 달력 낱장: 정보 요소라 누름 효과가 없다 */
.dcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin: var(--s3) 0; padding: 0; list-style: none; }
.dc { min-width: 0; text-align: center; }
.dc-sheet { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--ink-line); border-radius: var(--r); }
.dc-m { padding: 2px 0; background: var(--ink-line); color: var(--bg); font-size: var(--f1); font-weight: 700; }
.dc-d { font-size: var(--f5); font-weight: 800; line-height: 1.25; }
.dc-w { padding-bottom: var(--s1); font-size: var(--f1); color: var(--fg-2); }
.dc-cap { margin: var(--s1) 0 0; font-size: var(--f2); font-weight: 700; }
.dc-y { margin: 0; font-size: var(--f1); color: var(--muted); }
.dc-past .dc-sheet { border-color: var(--line-2); background: var(--band); }
.dc-past .dc-m { background: var(--line-2); color: var(--fg-2); }
.dc-past .dc-d, .dc-past .dc-w, .dc-past .dc-cap { color: var(--muted); }
.dc-next .dc-sheet { border-color: var(--accent); outline: 1px solid var(--accent); }

/* 함께 볼 일정 간트: 767px 까지 위 줄 이름·아래 줄 트랙, 768px 부터 이름 칸 160px. 트랙 폭이 오늘부터 끝날까지다. 빨강은 오늘선에만 */
.gt { margin: var(--s3) 0 0; }
.gt-axis { display: block; overflow: visible; }
.gt-defs { position: absolute; }
.gt-hatch-bg { fill: var(--bg); }
.gt-hatch-line { stroke: var(--ink-line); stroke-width: 1.5; }
.gt-today, .gt-tick { font-size: 12px; font-weight: 700; }
.gt-today { fill: var(--accent); }
.gt-tick { fill: var(--muted); }
.gt-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; width: 100%; min-height: 44px; padding: 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gt-row[aria-pressed="true"] { background: var(--band); }
.gt-name { padding: var(--s1) var(--s2) 0 0; font-size: 13px; font-weight: 700; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.gt-track { display: block; overflow: visible; }
.gt-grid { stroke: var(--line); stroke-width: 1; }
.gt-bar { stroke-width: 1; transform-box: fill-box; transform-origin: left; animation: gt-in .4s ease-out; }
.gt-vax { fill: var(--sage-line); stroke: var(--ink-line); }
.gt-chk { stroke: var(--ink-line); }
.gt-mark { fill: var(--fg); font-size: var(--f3); }
.gt-date { font-size: 12px; font-weight: 700; fill: var(--fg); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.gt-row[aria-pressed="true"] .gt-date { stroke: var(--band); }
.gt-row[aria-pressed="true"] .gt-plate + .gt-date { stroke: var(--bg); }
.gt-now { fill: var(--accent); }
.gt-say { min-height: 24px; margin: var(--s1) 0 0; font-size: var(--f2); font-weight: 700; }
.gt-hint { font-size: var(--f1); font-weight: 400; color: var(--muted); }
.gt-key { display: flex; gap: var(--s3); margin: var(--s1) 0 0; font-size: var(--f1); color: var(--muted); }
.gt-k-due::before { content: "◆"; margin-right: 2px; color: var(--fg); }
.gt-sw { display: inline-block; margin-right: var(--s1); vertical-align: -1px; }
@keyframes gt-in { from { transform: scaleX(0); } }

/* 계산 규칙 그림·표 */
.how-fig { display: block; width: 100%; max-width: 360px; height: auto; margin: var(--s3) 0; color: var(--ink-line); }
.how-fig text { font-size: 13px; font-weight: 700; fill: var(--fg); }
.how-fig .how-on { fill: var(--bg); }
.how-fig .how-small { font-size: 12px; fill: var(--muted); }
.how-cell { fill: none; stroke: var(--line-2); }
.how-table tbody th { min-width: 96px; }
/* 767px 까지 행마다 카드로 쌓는다. 표 구조는 HTML 그대로, 줄 머리는 td 의 data-label. 셋째 열 머리글은 예시 출생일이라 남긴다 */
@media (max-width: 767px) {
  .how-table, .how-table thead, .how-table tbody, .how-table tr, .how-table th, .how-table td { display: block; }
  .how-table thead th { padding: 0 0 var(--s2); border: 0; }
  .how-table thead th:not(:last-child) { display: none; }
  .how-table tbody tr { margin-bottom: var(--s2); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r); }
  .how-table tbody th { min-width: 0; padding: 0 0 var(--s1); border: 0; font-size: var(--f2); font-weight: 700; }
  .how-table td { padding: 0; border: 0; }
  .how-table td::before { content: attr(data-label) " "; font-weight: 700; }
}

/* 좁은 화면(≤379): 광고 카드 썸네일을 96px 로 줄여 글 폭 확보 */
@media (max-width: 379px) {
  .tb-card { grid-template-columns: 96px minmax(0, 1fr); }
  .tb-media { width: 96px; }
}

/* 좁은 화면(≤479): 메뉴 4개가 한 줄에 들어가도록 항목 안쪽 여백만 줄인다(터치 높이 44px 유지) */
@media (max-width: 479px) {
  .site-header nav { gap: 0; margin-right: calc(-1 * var(--s2)); }
  .site-header nav a { padding: 0 var(--s2); }
}

@media (max-width: 389px) {
  .site-header nav a { padding: 0 6px; }
}

/* 아주 좁은 화면(≤319): 바닥글 링크 3+3 배치, '수정·추가 요청'은 한 줄 전체 */
@media (max-width: 319px) {
  .site-footer nav { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; }
  .site-footer a::before { content: none; }
  .site-footer a.req { grid-column: 1 / -1; }
}

/* 600~959: 카드 2열(첫 카드는 두 칸을 차지하는 가로형 — 카드 5개가 1+2+2 로 채워져 홀로 남는 카드가 없다) */
@media (min-width: 600px) {
  .periods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
  .period-solo .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-lg { grid-column: auto; grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "art go" "title title" "desc desc"; }
  .tools > .tool-wide { grid-column: auto; }
  .related { grid-template-columns: 1fr 1fr; }
  .tb-card { grid-template-columns: 160px minmax(0, 1fr); gap: var(--s5); max-width: 760px; margin: var(--s5) auto; padding: var(--s4) 0; }
  .tb-media { width: 160px; }
  .tb-bubble { top: 8px; right: 8px; padding: 5px 10px; font-size: var(--f1); }
  .tb-tag { margin-bottom: var(--s2); font-size: var(--f2); }
  .tb-title { margin-bottom: var(--s2); font-size: var(--f5); }
  .tb-line { margin-bottom: var(--s3); font-size: var(--f3); }
  .tb-buy { padding-top: var(--s3); border-top: 1px dashed var(--line); }
  .tb-price { font-size: var(--f5); }
  .tb-buy .btn { padding: 0 var(--s5); }
  .hero { flex-direction: row; align-items: center; gap: var(--s5); }
  .hero-art { flex: 0 0 280px; width: 280px; }
  .hero img { width: 100%; height: auto; }
  .hero-cta { display: flex; }
  .hero .lead-more { display: inline; }
  .t1-result { padding-bottom: 0; }
  html { scroll-padding-bottom: 0; }
  .cta-bar { display: none; }
}

/* 768+: 하단 탭 없음. 메뉴 패널을 머리글 한 줄에 가로로 펼친다(짧은 이름 + 가이드·사주·이름, 나머지는 바닥글·도구 안 링크).
   닫힌 details 내용을 CSS 로 여는 ::details-content 를 못 쓰는 브라우저는 768+ 에서도 메뉴 버튼으로 연다. */
@media (min-width: 768px) {
  .dcards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gt-axis { width: calc(100% - 160px); margin-left: 160px; }
  .gt-row { grid-template-columns: 160px minmax(0, 1fr); }
  .gt-name { padding-top: 0; }
  .nav-s { display: inline; }
  .nav-l { display: none; }
  .tabbar { display: none; }
  body { padding-bottom: 0; }
  form.panel { margin-left: 0; margin-right: 0; }
  .site-header .menu-h, .site-header .menu-map { display: none; }
  @supports selector(::details-content) {
    .site-menu > summary { display: none; }
    .site-menu::details-content { content-visibility: visible; }
    .menu-panel { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); margin-right: calc(-1 * var(--s3)); }
    .site-header .menu-panel nav { margin: 0; }
  }
}

/* 960+: 입력 sticky + 결과 2단, 히어로는 배경 그림 위에 글 */
@media (min-width: 960px) {
  h1, .hero h1 { font-size: var(--f6); }
  .layout { grid-template-columns: 340px minmax(0, 1fr); gap: var(--s6); align-items: start; }
  .layout > .panel-col { position: sticky; top: var(--s4); }
  .layout .panel { margin-top: 0; }
  .hero { display: flex; align-items: center; min-height: 560px; overflow: hidden; }
  .hero-art { position: absolute; inset: 0; flex: none; width: 100%; }
  .hero picture { height: 100%; border-radius: 0; -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%); mask-image: linear-gradient(to right, transparent 0%, #000 30%); }
  .hero img { width: 100%; height: 100%; object-position: 100% 60%; }
  .hero-copy { position: relative; z-index: 1; width: 46%; padding: var(--s6) 0 var(--s6) 48px; }
  .hero-play { border-radius: 0; }
  .hero-bubble { top: var(--s2); right: var(--s2); max-width: 240px; }
}

/* 홈 띠: 768 이상은 그림이 오른쪽 칸 */
@media (min-width: 768px) {
  .home-start { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 var(--s6); align-items: center; }
  .band-art { width: 100%; height: auto; margin: 0; }
}

/* 호버는 데스크톱 포인터에서만 */
@media (hover: hover) {
  .btn-primary:hover { background: #000; }
  .btn-secondary:hover { background: var(--band); }
  .btn-soft:hover { background: var(--band); }
  .btn-text:hover { color: #000; }
  .saju-toc .toc-link:hover, .period-nav .toc-link:hover, .nh-tab:hover { color: var(--fg); }
  .period-nav .toc-link:hover { border-bottom-color: var(--ink-line); }
  .ilist a:hover, .dlist a:hover { background: var(--band); }
  .ilist a { position: relative; padding-right: var(--s5); }
  .ilist a::after { content: "→"; content: "→" / ""; position: absolute; top: var(--s3); right: var(--s1); color: var(--muted); transition: transform 120ms ease-out; }
  .ilist a:hover::after { transform: translateX(4px); }
  .tlb-mark:hover::before { transform: scale(1.4); }
  .tool:hover { transform: perspective(700px) translateY(-3px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
  .tool:hover:active { transform: perspective(700px) scale(.98); }
  .tool:hover .ic-tool { transform: translateY(-4px) scale(1.04); }
  /* 기울기: enhance.js 가 포인터 위치를 5단계(data-tx·data-ty = -2..2)로 알려 주고, 각도는 여기서만 정한다(작은 카드라 최대 2°) */
  .tool[data-tx="-2"] { --ry: -2deg; } .tool[data-tx="-1"] { --ry: -1deg; } .tool[data-tx="1"] { --ry: 1deg; } .tool[data-tx="2"] { --ry: 2deg; }
  .tool[data-ty="-2"] { --rx: 2deg; } .tool[data-ty="-1"] { --rx: 1deg; } .tool[data-ty="1"] { --rx: -1deg; } .tool[data-ty="2"] { --rx: -2deg; }
  .site-header nav a:hover { background: var(--band); }
  .site-footer a:hover { color: var(--fg); }
  .guide-list a:hover strong { font-weight: 800; }
  @media (prefers-reduced-motion: reduce) {
    .tool:hover, .tool:hover:active, .tool:hover .ic-tool, .tlb-mark:hover::before { transform: none !important; }
    .ilist a:hover::after { transform: none !important; transition: none !important; }
  }
}

/* 움직임 줄이기: 모든 애니메이션·전환 끔(영상 자동재생은 enhance.js 가 끈다) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal.wait { opacity: 1; transform: none; }
  .js .js-reveal.wait { opacity: 1; transform: none; }
  .js .js-reveal, .ilist a, .dlist a, .guide-list a { transition: none !important; }
  #result, .bp, .tlb-dot, .tlb-fill { animation: none !important; }
  .fig-ring-on, .fig-on, .gt-bar { animation: none !important; }
  .tools > li { transition-delay: 0s !important; }
  .tool.float .ic-tool { animation: none !important; }
  .tool[data-tx], .tool[data-ty] { --rx: 0deg; --ry: 0deg; }
  /* 카드·아이콘의 이동·확대·기울기·눌림만 끈다. 포커스 테두리·hover 배경은 그대로(마우스 올림 쪽은 위 hover 블록 안) */
  .tool:focus-visible, .tool:active, .tool:focus-visible .ic-tool, .tool:active .ic-tool, .tlb-mark:focus-visible::before { transform: none !important; }
  /* 히어로 그림: 기울기·튕김·조각·반짝임 모두 끔(hero.js 도 기울기·조각을 만들지 않는다 — 누르면 말풍선만) */
  .hero-art picture, .hero-art img { transform: none !important; animation: none !important; transition: none !important; }
  .hero-bit, .hero-spark { display: none !important; animation: none !important; }
}

/* 홈 방문 통계 한 줄(stats.js 가 숫자를 채워 연다). 페이지 맨 아래 갱신일 바로 위, 작은 글자. 자리는 처음부터 차지하고(visibility) 높이를 글줄 높이로 고정해 응답 전후 레이아웃이 같다(CLS 0) */
.visit-stats { margin: var(--s4) 0 0; font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.6; min-height: 1.6em; }
.visit-stats[hidden] { display: block !important; visibility: hidden; }
/* 좁은 화면은 숫자가 6자리면 두 줄이 될 수 있어 두 줄 높이를 미리 잡는다(CLS 0) */
@media (max-width: 389px) { .visit-stats { min-height: 3.2em; } }
/* /request/ 폼: 접수 결과 안내는 303 주소의 #ok·#full 일 때만 보인다(JS 없이) */
.req-msg { display: none; padding: var(--s3); border-radius: var(--r); background: var(--bg); border: 1px solid var(--ink-line); font-weight: 700; }
.req-msg:target { display: block; }
.req-msg-bad { border-color: var(--bad); }
.req-form fieldset { margin: 0 0 var(--s3); padding: 0; border: 0; }
.req-form legend, .req-form > label { display: block; margin: var(--s3) 0 var(--s2); font-weight: 700; }
.req-form fieldset label { display: flex; align-items: center; gap: var(--s2); min-height: 44px; }
.req-form textarea { font: inherit; width: 100%; padding: var(--s2) var(--s3); border: 1px solid var(--field); border-radius: var(--r-ctl); background: var(--bg); color: var(--fg); }
.req-form .btn { margin-top: var(--s4); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* 아기사주 첫장(/saju/) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.saju-badges { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: var(--s2) 0 var(--s3); padding: 0; }
.saju-badges li { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 var(--s2); border-radius: var(--r); background: var(--band); color: var(--fg); font-size: var(--f1); font-weight: 700; }
.saju fieldset { margin: var(--s3) 0 0; padding: 0; border: 0; }
.saju legend { display: block; margin: 0 0 var(--s1); padding: 0; font-weight: 700; }
.saju-time-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.panel .saju-check, .saju-check { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; min-width: 44px; margin: 0; padding-right: var(--s2); font-weight: 600; cursor: pointer; }
.saju-check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--fg); }
.saju-more { margin: var(--s3) 0 0; }
.saju-more summary { min-height: 44px; display: flex; align-items: center; gap: var(--s2); list-style: none; font-weight: 700; color: var(--fg); cursor: pointer; }
.saju-more summary::-webkit-details-marker { display: none; }
.saju-more summary::before { content: ""; flex: none; border-style: solid; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent currentColor; transition: transform .15s; }
.saju-more[open] summary::before { transform: rotate(90deg); }
/* 이름 도구 FAQ: 질문이 두 줄이어도 표식은 첫 줄 가운데(위아래 여백 9px + 첫 줄 높이 1.6em 의 절반). 한 줄이면 지금과 같은 자리 */
.name-faq .saju-more summary { align-items: flex-start; padding: 9px 0; }
.name-faq .saju-more summary::before { margin-top: calc(.8em - 6px); }
.saju-type-head { display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s2); }
.saju-char { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 72px; height: 72px; border-radius: 50%; background: var(--band); color: var(--fg); font-size: 40px; font-weight: 800; }
.saju-bars { display: block; width: 100%; max-width: 420px; height: auto; margin: var(--s2) 0; }
.saju-bars .bar-label, .saju-bars .bar-num { font-size: 14px; font-weight: 700; fill: var(--fg); }
.saju-bars .bar-track { fill: var(--band-2); stroke: var(--field); stroke-width: 1.5; }
.saju-toc ol, .period-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.toc-link { min-height: 44px; padding: 0 var(--s2); border: 0; background: none; color: var(--fg); font: inherit; font-weight: 600; text-align: left; text-decoration: underline; cursor: pointer; }
.chapter { margin: var(--s4) 0; scroll-margin-top: calc(var(--bar-h) + var(--s3)); }
.chapter-action { padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--band); color: var(--fg); font-weight: 600; }
.saju-result .chapter-action { font-weight: 400; }
.chapter-action-k { font-weight: 800; }
.saju-card { display: block; width: 100%; max-width: 360px; height: auto; margin: var(--s3) 0; border-radius: var(--r); }
.saju-share-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.saju-type-page .saju-char { width: 88px; height: 88px; font-size: 48px; }
.saju-stem { display: flex; flex-direction: column; margin: 0; line-height: 1.3; }
.saju-stem strong { font-size: var(--f5); font-weight: 800; color: var(--fg); }
.saju-stem span { font-size: var(--f2); color: var(--muted); }
.saju-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: var(--s3) 0 0; padding: 0; }
.saju-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px; border-radius: var(--r); background: var(--band-2); color: var(--fg); font-size: var(--f1); line-height: 1.3; }
.saju-chip .chip-k { color: var(--muted); font-weight: 600; }
.saju-chip .chip-v { font-weight: 800; }
.el-wood { --el: var(--el-wood); --el-t: var(--el-wood-text); }
.el-fire { --el: var(--el-fire); --el-t: var(--el-fire-text); }
.el-earth { --el: var(--el-earth); --el-t: var(--el-earth-text); }
.el-metal { --el: var(--el-metal); --el-t: var(--el-metal-text); }
.el-water { --el: var(--el-water); --el-t: var(--el-water-text); }
.pillars { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; margin: var(--s2) 0; }
.pillars th { padding: var(--s1) 2px; font-size: var(--f1); font-weight: 700; color: var(--fg); vertical-align: bottom; }
.pillars th span { display: block; }
.pillars .pc-sub { font-weight: 500; color: var(--muted); }
.pillars .pc-badge { display: inline-block; margin-top: 2px; padding: 0 8px; border-radius: var(--r); background: var(--fg); color: var(--bg); }
.pillars th.is-day, .pillars td.is-day { background: var(--pillar-day); border-radius: var(--r); }
.pillars td { padding: var(--s2); text-align: center; vertical-align: middle; background: var(--bg); border-left: 3px solid var(--el-t, var(--line)); border-radius: var(--r); }
.pillars td.is-day { background: var(--pillar-day); }
.pillars .pc-hanja { display: block; font-size: 28px; line-height: 1.2; font-weight: 700; color: var(--fg); font-family: serif; }
.pillars .pc-read { display: block; font-size: 13px; color: var(--muted); }
.pillars .pc-el { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--el-t); }
.pillars .pc-el::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--el); }
.pillars td.pc-unknown { border: 2px dashed var(--field); background: var(--band-2); }
.pillars .pc-unknown-t { font-size: var(--f1); font-weight: 700; color: var(--muted); }
.pillars-note { font-size: var(--f1); color: var(--muted); }
.saju-bars .bar-legend { font-size: 18px; fill: var(--muted); } /* 차트는 폭에 맞춰 줄어든다(320px 화면에서 288/420배) — 화면 글자 12px 이상 */
.saju-bars .bar-tick { stroke: var(--bg); stroke-width: 1.5; }
.saju-toc { position: sticky; top: 0; z-index: 5; margin: var(--s3) calc(-1 * var(--s2)); padding: var(--s2); border-bottom: 1px solid var(--line); background: var(--bg); }
.saju-toc ol, .period-nav ol { display: flex; gap: 0; overflow-x: auto; flex-wrap: nowrap; padding: 2px 32px 6px 2px; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.saju-toc ol::-webkit-scrollbar, .period-nav ol::-webkit-scrollbar { display: none; }
.saju-toc .toc-link, .period-nav .toc-link { white-space: nowrap; min-height: 44px; padding: 0 var(--s3); border-bottom: 2px solid transparent; color: var(--muted); font-size: var(--f2); font-weight: 700; text-decoration: none; }
.toc-link[aria-current] { color: var(--fg); border-bottom-color: var(--ink-line); }
/* 홈 시기 이동 줄: 한 줄 가로 스크롤(스크롤바·끝 흐림 없음), 좌우는 본문 글자선에 맞춘다. 평소엔 글자만, hover·focus 에 아래 2px 먹선 */
.period-nav ol { flex-wrap: nowrap; gap: var(--s4); padding: 0; overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
.period-nav .toc-link { justify-content: center; min-width: 44px; padding: 0; color: var(--fg-2); }
.period-nav .toc-link:focus-visible { border-bottom-color: var(--ink-line); outline-offset: -2px; }
/* 홈 시기 줄: 끝 페이드로 '더 있음'을 보이고, 끝까지 밀면 마지막 항목은 페이드 밖에 선다 */
.home-start + .period-nav { position: relative; }
.home-start + .period-nav::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 24px; background: linear-gradient(to right, transparent, var(--bg)); pointer-events: none; }
.home-start + .period-nav ol { padding-right: 24px; }
@media (max-width: 359px) {
  .pillars { border-spacing: 2px; }
  .pillars td { padding: var(--s2) 2px; }
  .pillars .pc-hanja { font-size: 24px; }
}
/* 이름 풀이(/name/) — 요약 블록 연한 배경, 항목 카드 테두리, 칩 좋음(진한 테두리)·보통(기본)·아쉬움(chip-warn) */
#nj-sum-card { padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--band); }
#nj-sum-card p { margin: 0; }
#nj-sum-card p + p { margin-top: var(--s2); }
#nj-cards .nj-card { margin: var(--s3) 0 0; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r); }
.chip.nj-good { border: 1px solid var(--ink-line); background: var(--bg); color: var(--fg); }
/* 한글 이름 소리 오행·음양(/name/) — 오행 색은 /saju/ 의 .el-* 변수(텍스트용 어두운 변형)를 쓰고 글자 라벨을 함께 둔다 */
.ns-choices { display: flex; flex-wrap: wrap; gap: 0 var(--s2); }
/* 글자별 표: 320px 에서 다섯 열이 가로 스크롤 없이 들어가게(칸 여백 최소·머리 줄바꿈 없음). 넘치면 오른쪽 페이드(TOC 방식) — 페이드는 오른쪽 여백 위라 안 넘칠 땐 글자를 가리지 않는다. 아래 여백은 스크롤바 자리 */
.ns-table-wrap { padding: 0 var(--s4) var(--s2) 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--s4)), transparent); mask-image: linear-gradient(to right, #000 calc(100% - var(--s4)), transparent); }
.ns-table { border-collapse: collapse; }
.ns-table th, .ns-table td { padding: 6px 4px; line-height: 1.25; }
.ns-table thead th { white-space: nowrap; vertical-align: bottom; }
.ns-table tbody th, .ns-table tbody td { height: 50px; vertical-align: middle; }
.ns-table th[scope="row"] { white-space: nowrap; font-size: var(--f3); }
.ns-cho { font-size: var(--f3); font-weight: 700; color: var(--fg); }
.ns-el { color: var(--el-t); font-weight: 700; white-space: nowrap; }
.ns-han { font-weight: 800; }
.ns-diff { background: var(--warn-bg); }
@media (max-width: 379px) {
  .ns-table-wrap { margin-left: calc(-1 * var(--s2)); margin-right: calc(-1 * var(--s4)); }
  .ns-table th, .ns-table td { padding: 6px 3px; }
}
/* 인명용 한자 여부·획수·부수(/name/hanja/) — 글자 단추·탭은 44px 이상 */
.nh-tabs { display: flex; gap: var(--s2); margin: var(--s3) 0 0; border-bottom: 1px solid var(--line); }
.nh-tab { flex: 1 1 0; min-height: 44px; padding: 0 var(--s3); border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-size: var(--f2); font-weight: 700; cursor: pointer; }
.nh-tab[aria-selected="true"] { border-bottom-color: var(--ink-line); color: var(--fg); }
.nh-group { margin: var(--s4) 0 0; }
.nh-group-t { margin: 0 0 var(--s2); font-size: var(--f3); }
.nh-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.nh-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; min-height: 52px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; }
.nh-pick[aria-pressed="true"] { border: 2px solid var(--ink-line); background: var(--band); }
.nh-pick-h { font-size: 24px; line-height: 1.1; }
.nh-pick-s { font-size: var(--f1); color: var(--muted); line-height: 1.2; }
.nh-more { margin-top: var(--s2); }
.nh-dueum { margin: var(--s3) 0 0; }
.nh-detail { margin: var(--s3) 0 0; padding: var(--s3); border-radius: var(--r); background: var(--band-2); }
.nh-detail-h { margin: 0; }
.nh-big { font-size: var(--f6); line-height: 1.2; }
.nh-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--s3); margin: var(--s2) 0 0; }
.nh-dl dt { font-weight: 700; color: var(--muted); }
.nh-dl dd { margin: 0; }
.nh-yes { font-weight: 700; }
.nh-unknown { font-weight: 700; }
.nh-ext { color: var(--muted); font-size: var(--f1); }
.nh-rows { list-style: none; margin: 0; padding: 0; }
.nh-name { margin: var(--s2) 0; font-size: var(--f6); font-weight: 700; letter-spacing: .1em; }
.nh-sum-list { margin: 0 0 var(--s3); padding-left: var(--s5); }
.nh-copy-box { width: 100%; margin-top: var(--s2); font-size: var(--f4); }
.nh-form { font-size: var(--f4); }
.nh-sources { margin: var(--s4) 0 0; }
