/* 인생2막 제도달력 — 디자인 시스템
   원칙: 흰 바탕 · 짙은 남색 제목 · 본문 19px · 큰 버튼 · 카드형
         중요한 날짜는 색 + 아이콘 + 글자를 함께 쓴다(색만으로 구분 금지)
         외부 폰트·CDN 없음(시스템 글꼴) */

:root {
  --ink: #1a1a1a;          /* 본문 (흰 바탕 대비 약 17:1) */
  --ink-soft: #3d3d3d;     /* 보조 글자 (약 11:1) */
  --navy: #16244a;         /* 제목·브랜드 (약 15:1) */
  --navy-2: #24386e;
  --paper: #ffffff;
  --paper-2: #f6f4ef;      /* 달력 종이 느낌의 옅은 미색 */
  --line: #c9c4b8;
  --line-strong: #8a8578;
  --urgent: #b3261e;       /* 기한 임박 — 적색 (약 6.5:1) */
  --urgent-bg: #fdecea;
  --soon: #9a4a00;         /* 곧 다가옴 — 짙은 주황 (약 6:1) */
  --soon-bg: #fff1e0;
  --ok: #1d5e2b;
  --ok-bg: #e7f3ea;
  --check: #5a3d00;
  --check-bg: #fff6d6;
  --focus: #0b57d0;
  --accent: #9c3f0c;       /* 강조(황토·주황) — 핵심 버튼·아이콘에만 (흰 바탕 약 6.7:1) */
  --accent-2: #7f330a;
  --warm: #fbf3e4;         /* 따뜻한 미색 배경 (남색 글자 약 13.7:1) */
  --warm-line: #ecd9b8;
  --radius: 10px;
  --fs-body: 1.1875rem;    /* 19px */
  --fs-small: 1.0625rem;   /* 17px — 이보다 작게 쓰지 않는다 */
  --fs-h1: 2rem;
  --fs-h2: 1.5rem;
  --fs-h3: 1.3125rem;
  --tap: 3.5rem;           /* 버튼 최소 높이 56px */
  --wrap: 46rem;
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* 글자 크기 선택(모든 크기를 rem 으로 쓰므로 기준만 바꾸면 전체가 커진다) */
html[data-size="l"] { font-size: 112.5%; }
html[data-size="xl"] { font-size: 125%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word; /* anywhere 는 표 칸을 좁혀 단어가 끊긴다 */
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }

h1, h2, h3 { color: var(--navy); line-height: 1.35; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); margin: 1.5rem 0 1rem; letter-spacing: -0.025em; }
h2 { font-size: var(--fs-h2); margin: 2.75rem 0 0.9rem; letter-spacing: -0.02em; }
h3 { font-size: var(--fs-h3); margin: 1.5rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
/* 본문 링크: 얇고 옅은 밑줄(색만으로 구분하지 않도록 밑줄은 유지), 올리면 강조색 */
a { color: var(--navy-2); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: rgba(36, 56, 110, 0.4); text-underline-offset: 0.25em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
small, .small { font-size: var(--fs-small); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--paper); padding: 0.5rem 1rem; }

.wrap.wide { max-width: 72rem; }

/* ── 맨 위 안내 띠 + 글자 크기 ── */
.util-bar { background: var(--paper-2); border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.util-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.25rem 1rem; padding-top: 0.35rem; padding-bottom: 0.35rem; }

/* ── 머리말: 로고 줄 + 넓은 메뉴 막대 ── */
.site-header { background: var(--paper); border-bottom: 3px solid var(--navy); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--navy); text-decoration: none; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.brand-mark { width: 2.75rem; height: 2.75rem; color: var(--accent); }
.site-menu { border-top: 1px solid var(--line); }
.site-menu > .wrap { display: flex; align-items: center; }
.site-nav { flex: 1; }
.site-nav ul { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.site-nav li { flex: 1 1 auto; }
.site-nav a {
  display: flex; align-items: center; justify-content: center; min-height: 3.75rem; padding: 0.5rem 1rem;
  font-size: 1.2rem; font-weight: 800; text-decoration: none; color: var(--navy); text-align: center;
}
.site-nav a:hover { background: var(--warm); color: var(--navy); }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -4px 0 var(--accent); }
.text-size.text-size-menu { display: none; }

/* 글자 크기 */
.text-size { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.text-size-label { font-size: var(--fs-small); font-weight: 700; color: var(--ink-soft); margin-right: 0.15rem; }
.text-size button {
  display: inline-flex; align-items: baseline; gap: 0.3rem; min-height: 2.5rem; padding: 0.2rem 0.75rem;
  font: inherit; font-size: var(--fs-small); font-weight: 700; color: var(--navy);
  background: var(--paper); border: 2px solid var(--line-strong); border-radius: 999px; cursor: pointer;
}
.text-size button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.text-size .ts { font-weight: 800; line-height: 1; }
.text-size .ts-m { font-size: 0.95em; } .text-size .ts-l { font-size: 1.15em; } .text-size .ts-xl { font-size: 1.35em; }

/* 휴대폰: 로고 + 메뉴 버튼 한 줄, 글자 크기는 메뉴 안으로 (자바스크립트가 꺼져 있으면 메뉴를 그대로 펼쳐 둔다) */
.menu-toggle { display: none; }
@media (max-width: 48rem) {
  .site-nav a { font-size: 1.1rem; padding: 0.5rem 0.6rem; }
}
@media (max-width: 40rem) {
  .util-bar { display: none; } /* 휴대폰은 글자 크기를 메뉴 안에서 바꾼다 */
  .header-inner { padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .brand { font-size: 1.2rem; }
  .brand-mark { width: 2.2rem; height: 2.2rem; }
  .js .menu-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); padding: 0.5rem 1rem;
    font: inherit; font-weight: 800; color: var(--navy); background: var(--paper);
    border: 2px solid var(--navy); border-radius: var(--radius); cursor: pointer;
  }
  .menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 1.25rem; height: 3px; background: currentColor; border-radius: 2px; position: relative; }
  .menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
  .menu-bars::before { top: -7px; } .menu-bars::after { top: 7px; }
  .js .menu-toggle[aria-expanded="true"] { background: var(--navy); color: #fff; }
  .js .site-menu { display: none; }
  .js .site-menu.is-open { display: block; padding-bottom: 0.75rem; }
  .site-menu > .wrap { display: block; }
  .js .site-nav ul { flex-direction: column; }
  .js .site-nav li + li { border-top: 1px solid var(--line); }
  .js .site-nav a { justify-content: flex-start; min-height: var(--tap); padding: 0.5rem 0.25rem; font-size: 1.25rem; }
  .js .site-nav a[aria-current="page"] { box-shadow: none; background: var(--warm); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
  .js .text-size.text-size-menu { display: flex; margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
}

/* ── 꼬리말: 짙은 남색 · 브랜드 + 링크 열 + 안내 상자 ── */
.site-footer { margin-top: 5rem; padding: 3.25rem 0 2.5rem; background: var(--navy); color: #d9dfee; font-size: var(--fs-small); }
.site-footer p { margin: 0 0 0.6rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #ffd9a8; text-decoration: underline; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2.6fr); gap: 2.5rem; padding-bottom: 2.25rem; border-bottom: 1px solid #33426b; }
.footer-logo { display: inline-block; margin-bottom: 0.75rem; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.footer-brand p { color: #b9c2da; line-height: 1.7; }
.footer-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1.5rem; }
.footer-col-title { font-weight: 800; color: #fff; letter-spacing: 0.02em; margin-bottom: 0.75rem !important; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.footer-col a { display: inline-flex; align-items: center; min-height: 2.5rem; color: #d9dfee; }
.footer-notice { margin-top: 1.75rem; padding: 1.25rem 1.5rem; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid #33426b; }
.footer-notice p:last-child { margin-bottom: 0; }
.disclaimer { font-weight: 700; color: #fff; }
.not-gov, .input-notice, .ref-date { color: #b9c2da; }
@media (max-width: 48rem) { .footer-top { grid-template-columns: 1fr; gap: 1.75rem; } }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--tap); padding: 0.75rem 1.5rem;
  font: inherit; font-weight: 700; line-height: 1.3;
  border: 2px solid var(--navy); border-radius: var(--radius);
  background: var(--navy); color: #fff; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--navy-2); color: #fff; }
.btn-ghost { background: var(--paper); color: var(--navy); }
.btn-ghost:hover { background: var(--paper-2); color: var(--navy); }
.btn-block { display: flex; width: 100%; }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn[disabled], .btn[aria-disabled="true"] { background: #e4e2dc; border-color: #b9b5aa; color: #4a4a4a; cursor: not-allowed; }

/* 한 화면 한 질문 */
.question { border: 0; padding: 0; margin: 0; min-width: 0; }
.question legend, .question .q-title { float: left; width: 100%; padding: 0; margin: 0 0 0.5rem; font-size: 1.45rem; font-weight: 800; color: var(--navy); line-height: 1.4; letter-spacing: -0.02em; }
.question legend + * { clear: both; }
.question .q-help { color: var(--ink-soft); margin-bottom: 0.75rem; }
.choices { display: grid; gap: 0.75rem; margin: 1rem 0 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice label {
  display: flex; align-items: center; gap: 0.75rem; min-height: var(--tap);
  padding: 0.75rem 1rem; border: 2px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; font-weight: 700;
}
.choice label::before { content: ""; flex: none; width: 1.4rem; height: 1.4rem; border: 2px solid var(--navy); border-radius: 50%; }
.choice input:checked + label { border-color: var(--navy); background: #eef1f8; }
.choice input:checked + label::before { background: radial-gradient(var(--navy) 45%, transparent 50%); }
.choice input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }
.field { display: grid; gap: 0.4rem; margin: 1rem 0; }
.field label { font-weight: 700; }
.field input, .field select {
  font: inherit; min-height: var(--tap); padding: 0.5rem 0.75rem;
  border: 2px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--ink);
}

/* ── 제도 카드 ── */
/* 서식(문서) 모양: 각진 모서리 · 위 제목 띠 · 줄 친 표 · 아래 출처 띠 */
.card {
  position: relative; margin: 1.25rem 0; padding: 0;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 3px;
}
.card > * { margin-left: 1.25rem; margin-right: 1.25rem; }
.card > h3 {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem;
  margin: 0; padding: 0.85rem 1.25rem; background: var(--paper-2); border-bottom: 1px solid var(--line-strong);
}
.card > .when { margin-top: 1rem; }
.card-meta { display: grid; grid-template-columns: 7.5rem 1fr; margin-top: 1rem; margin-bottom: 1rem; border-top: 1px solid var(--line); }
.card-meta dt, .card-meta dd { margin: 0; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
.card-meta dt { white-space: nowrap; font-weight: 700; color: var(--navy); background: #faf9f6; border-right: 1px solid var(--line); }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.25rem; margin-bottom: 1rem; }
.card > details.basis { margin-top: 0; margin-bottom: 1rem; }
.card-source {
  margin: 0; padding: 0.6rem 1.25rem; font-size: var(--fs-small); color: var(--ink-soft);
  background: var(--paper-2); border-top: 1px solid var(--line);
}
.card > .card-source { margin-left: 0; margin-right: 0; }
.card.is-done { opacity: 0.75; }
.card.is-done h3 { text-decoration: line-through; }

@media (max-width: 30rem) {
  .card > * { margin-left: 0.9rem; margin-right: 0.9rem; }
  .card > h3, .card-source { padding-left: 0.9rem; padding-right: 0.9rem; }
  .card-meta { grid-template-columns: 1fr; }
  .card-meta dt { border-right: 0; border-bottom: 0; padding-bottom: 0.15rem; background: none; }
  .card-meta dd { padding-top: 0; }
}

/* ── 배지: 색 + 아이콘 + 글자 ── */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.1rem 0.6rem; border: 2px solid currentColor; border-radius: 999px;
  font-size: var(--fs-small); font-weight: 800; line-height: 1.6; white-space: nowrap;
}
.badge .icon { font-size: 1em; }
.badge-urgent { color: var(--urgent); background: var(--urgent-bg); }
.badge-soon { color: var(--soon); background: var(--soon-bg); }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-check { color: var(--check); background: var(--check-bg); }
.badge-review { color: var(--check); background: var(--check-bg); border-style: dashed; }
.badge-neutral { color: var(--ink-soft); background: var(--paper-2); }

/* 중요한 날짜: 달력 칸 모양 + 글자 표시 */
.date-chip {
  display: inline-grid; grid-template-rows: auto auto; text-align: center; min-width: 5.5rem;
  border: 2px solid var(--navy); border-radius: 8px; overflow: hidden; vertical-align: middle;
}
.date-chip .m { background: var(--navy); color: #fff; font-size: var(--fs-small); font-weight: 700; padding: 0 0.5rem; }
.date-chip .d { font-size: 1.5rem; font-weight: 800; color: var(--navy); padding: 0 0.5rem; }
.date-chip.is-urgent { border-color: var(--urgent); }
.date-chip.is-urgent .m { background: var(--urgent); }
.date-chip.is-urgent .d { color: var(--urgent); }

/* 쉬운 설명 — 행정 용어 옆에 */
.term { font-weight: 700; }
.term-easy { color: var(--ink-soft); font-weight: 400; }
.term-easy::before { content: "("; } .term-easy::after { content: ")"; }

/* 안내 상자 */
.notice { padding: 1rem 1.25rem; border-radius: var(--radius); border: 2px solid var(--line-strong); background: var(--paper-2); margin: 1.25rem 0; }
.notice-check { border-color: var(--check); background: var(--check-bg); }
.notice-urgent { border-color: var(--urgent); background: var(--urgent-bg); }
.notice > :last-child { margin-bottom: 0; }

/* 결과 판정 (가능 / 불가 / 확인 필요) */
.verdict { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; padding: 1rem; border: 2px solid var(--line); border-radius: var(--radius); margin: 0.75rem 0; }

/* 표 */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-small); }
th, td { border: 1px solid var(--line-strong); padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; }
th { background: var(--paper-2); color: var(--navy); }

/* 계산 근거 보기 */
details.basis { margin: 0.75rem 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1rem; }
details.basis > summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 700; cursor: pointer; color: var(--navy); }

/* ── 메인 화면: 넓은 배치, 질문 상자만 읽기 좋은 폭으로 ── */
.tool-timeline main.wrap { max-width: 72rem; }
.sec-title { font-size: 1.75rem; margin: 3rem 0 0.5rem; padding: 0; border: 0; }
.sec-lead { color: var(--ink-soft); margin-bottom: 1.25rem; }
.tool-timeline main > h2 { font-size: 1.75rem; border: 0; padding: 0; margin-top: 3rem; }

/* 첫 화면: 왼쪽 소개 + 오른쪽 첫 질문(출생연도·다음)이 스크롤 없이 보이게 */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); align-items: center; gap: 2.5rem;
  margin: 1.25rem 0 0; padding: 2.25rem 2.5rem;
  border-radius: 16px; border: 1px solid var(--warm-line);
  background: linear-gradient(115deg, #fdf6ea 0%, #f8ecd8 45%, #eef1f8 100%);
}
.hero:has(.hero-form[hidden]) { grid-template-columns: 1fr; }
.hero-kicker { display: inline-block; margin: 0 0 0.75rem; padding: 0.15rem 0.85rem; border-radius: 999px; background: #fff; border: 1px solid var(--warm-line); font-weight: 800; color: var(--accent); font-size: var(--fs-small); }
.hero h1 { margin: 0 0 1rem; font-size: 2.6rem; line-height: 1.3; letter-spacing: -0.03em; font-weight: 800; }
.hero h1 em { white-space: nowrap; font-style: normal; color: var(--accent); background: linear-gradient(transparent 68%, #f6d9b8 68%); }
.hero .lead { font-size: var(--fs-body); color: var(--ink); line-height: 1.7; margin: 0; }
.hero-form .input-notice-inline { margin: 0.75rem 0 0; }
@media (max-width: 56rem) { .hero { grid-template-columns: 1fr; gap: 1.25rem; } .hero h1 { font-size: 2.1rem; } }
@media (max-width: 40rem) {
  .hero { gap: 0.75rem; margin-top: 0.75rem; padding: 1rem 0.9rem 0.9rem; border-radius: 12px; }
  .hero-kicker { display: none; }
  .hero h1 { font-size: 1.6rem; margin-bottom: 0.4rem; }
  .hero .lead { line-height: 1.6; }
  .hero-form .question .q-help { margin-bottom: 0.25rem; }
  .hero-form .field { margin: 0.5rem 0; }
  .hero-form .step-nav { margin-top: 0.75rem; }
}

/* 자주 찾는 도구: 아이콘 위 + 이름 아래 */
.quick { margin-top: 1.5rem; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.75rem; list-style: none; margin: 1rem 0 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.quick-grid a { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; min-height: 8rem; padding: 1rem 0.5rem; border-radius: 12px; text-align: center; text-decoration: none; color: var(--navy); font-weight: 800; line-height: 1.4; }
.quick-grid a:hover { background: var(--warm); }
.quick-icon { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; background: var(--warm); border: 2px solid var(--warm-line); color: var(--accent); }
.quick-icon .icon-svg { width: 2.2rem; height: 2.2rem; }
@media (max-width: 40rem) { .quick-grid { grid-template-columns: repeat(2, 1fr); padding: 0.75rem; } .quick-grid a { min-height: 7rem; } }

/* 상황별 질문 카드 */
.situation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 1rem; }
.situation { display: flex; flex-direction: column; padding: 1.25rem; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); }
.situation-head { display: flex; align-items: center; justify-content: space-between; }
.situation-tag { font-weight: 800; color: var(--ink-soft); font-size: var(--fs-small); }
.situation-icon { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 12px; background: #fff; color: var(--accent); border: 2px solid var(--warm-line); }
.situation-icon .icon-svg { width: 1.9rem; height: 1.9rem; }
.situation-q { margin: 0.75rem 0 1rem; font-size: 1.3rem; line-height: 1.45; }

/* 분류별 제도 묶음 */
.topic-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); margin: 1rem 0; }
.topic { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.topic-title { display: flex; align-items: center; gap: 0.75rem; margin: 0; padding: 0.85rem 1rem; background: var(--warm); border-bottom: 1px solid var(--warm-line); font-size: var(--fs-h3); }
.topic-icon { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: #fff; color: var(--accent); border: 2px solid var(--warm-line); }
.topic-icon .icon-svg { width: 1.6rem; height: 1.6rem; }
.topic-links { list-style: none; margin: 0; padding: 0; }
.topic-links li + li { border-top: 1px solid var(--line); }
.topic-links a { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: var(--tap); padding: 0.5rem 1rem; font-weight: 700; text-decoration: none; color: var(--navy); }
.topic-links a::after { content: "›"; font-size: 1.6rem; line-height: 1; color: var(--accent); }
.topic-links a:hover { background: var(--paper-2); }

/* 도구 카드: 카드 전체가 누르는 곳 */
.tool-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); margin: 1.25rem 0; }
.tool-card {
  display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
a.tool-card:hover { border-color: var(--accent); background: var(--warm); color: var(--ink); }
a.tool-card:hover .tool-go { text-decoration: underline; }
.tool-icon { display: grid; place-items: center; flex: none; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--warm); color: var(--accent); border: 2px solid var(--warm-line); }
.tool-icon .icon-svg { width: 2rem; height: 2rem; }
.tool-body { display: grid; gap: 0.35rem; }
.tool-name { font-size: var(--fs-h3); font-weight: 800; color: var(--navy); line-height: 1.35; }
.tool-desc { line-height: 1.6; }
.tool-go { margin-top: 0.25rem; font-weight: 800; color: var(--accent); }
.tool-card.is-off { background: var(--paper-2); }
.tool-card.is-off .tool-icon { color: var(--ink-soft); background: var(--paper); border-color: var(--line); }
.empty { padding: 1.5rem; border: 2px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-soft); background: var(--paper-2); }

/* 인쇄: 핵심만, 링크 주소 표시 */
@media print {
  :root { --fs-body: 12pt; }
  .site-header nav, .menu-toggle, .text-size, .card-actions, .no-print, .skip { display: none !important; }
  .util-bar, .quick, .situations { display: none !important; }
  .hero { background: none; border: 0; padding: 0; }
  .site-footer, .site-footer a, .disclaimer, .not-gov { color: #000; }
  .site-footer { background: none; margin-top: 1rem; }
  .card { break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── 도구 화면 ── */
.progress { display: flex; align-items: center; gap: 0.9rem; margin: 0 0 1.25rem; font-weight: 700; color: var(--ink-soft); font-size: var(--fs-small); }
.progress-text { white-space: nowrap; color: var(--accent); }
.progress-bar { flex: 1; height: 6px; border-radius: 999px; background: #ece6da; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.25s ease; }
.step-nav { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; margin-top: 1.25rem; }
.step-nav .btn:last-child { flex: 1 1 12rem; }
.error { color: var(--urgent); font-weight: 800; margin: 0.75rem 0 0; }
.input-notice-inline { color: var(--ink-soft); }
.result-title { margin-top: 1.5rem; }
.when { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.25rem 0 0.5rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0 1.5rem; }
.check { display: flex; align-items: center; gap: 0.75rem; min-height: var(--tap); }
.check input { width: 1.6rem; height: 1.6rem; accent-color: var(--navy); flex: none; }
.check label { cursor: pointer; }
.check.is-done label { text-decoration: line-through; color: var(--ink-soft); }
.checklist { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 0.5rem 1rem; margin: 0.75rem 0; }
.checklist legend { font-weight: 800; color: var(--navy); padding: 0 0.25rem; }
.h3 { font-size: var(--fs-h3); border: 0; padding: 0; margin: 0 0 0.5rem; }
.tool-card p { margin: 0; }
.terms dt { margin-top: 0.75rem; }
.terms dd { margin: 0 0 0.25rem; }
ul.todo { list-style: none; padding-left: 0.25rem; }
.guide-list li { margin-bottom: 0.75rem; }

/* 그래프 (SVG) — 선 색 + 선 모양 + 글자 라벨 */
.chart { margin: 1rem 0; }
.chart svg { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.chart figcaption { font-size: var(--fs-small); margin-top: 0.5rem; }
.bars { display: grid; gap: 0.75rem; margin: 1rem 0; }
.bar-row { display: grid; grid-template-columns: 7rem 1fr auto; align-items: center; gap: 0.75rem; }
.bar { display: block; height: 1.6rem; border-radius: 4px; }
.bar-in { background: var(--navy); }
.bar-out { background: repeating-linear-gradient(45deg, var(--urgent), var(--urgent) 6px, #d9625b 6px, #d9625b 12px); }
.bar-v { font-weight: 700; white-space: nowrap; }
@media (max-width: 30rem) { .bar-row { grid-template-columns: 1fr auto; } .bar { grid-column: 1 / -1; grid-row: 2; } }

@media print {
  .wizard, .toolbar, .step-nav { display: none !important; }
  details.basis { display: block; }
  details > summary { list-style: none; }
}

/* ── 하위 페이지 머리 띠: 구역 이름 · 큰 제목 · 소개 (화면 끝까지 옅은 배경) ── */
.page-head {
  position: relative; margin: 0 0 2.5rem; padding: 2.75rem 0 2.25rem;
  background: #f8f3ea; box-shadow: 0 0 0 100vmax #f8f3ea; clip-path: inset(0 -100vmax);
}
.page-kicker { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; font-size: var(--fs-small); font-weight: 800; color: var(--accent); letter-spacing: 0.04em; }
.page-kicker::before { content: ""; width: 1.5rem; height: 2px; background: var(--accent); }
.page-head h1 { margin: 0 0 0.75rem; font-size: 2.4rem; line-height: 1.3; }
.page-head .lead { margin: 0; max-width: 40rem; font-size: 1.2rem; color: var(--ink-soft); line-height: 1.7; }
@media (max-width: 40rem) { .page-head { padding: 1.75rem 0 1.5rem; margin-bottom: 1.75rem; } .page-head h1 { font-size: 1.85rem; } .page-head .lead { font-size: var(--fs-body); } }

/* ── 도구 패널: 입력은 흰 패널 안에 ── */
.wizard {
  margin: 0 0 1rem; padding: 2rem 2.25rem 2.25rem;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(22, 36, 74, 0.04), 0 12px 32px rgba(22, 36, 74, 0.07);
}
.wizard .field label { font-size: var(--fs-small); color: var(--ink-soft); }
.wizard .field input, .wizard .field select { background: #fcfbf8; }
.wizard .field input:focus, .wizard .field select:focus { border-color: var(--navy); background: #fff; }
.wizard .step-nav { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid #eee8dc; }
.page-tool .input-notice-inline { margin: 0 0 0 0.25rem; }
.page-tool > h2, .page-info > h2 { padding-top: 2rem; border-top: 1px solid var(--line); }
@media (max-width: 40rem) { .wizard { padding: 1.25rem 1rem 1.25rem; border-radius: 12px; } .question legend { font-size: 1.3rem; } }

/* ── 문서 페이지(소개·정책): 읽기 좋은 글 ── */
.page-doc { max-width: 42rem; }
.page-doc h2 { font-size: 1.3rem; margin: 2.5rem 0 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.page-doc > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.page-doc p, .page-doc li { line-height: 1.85; }
.page-doc ul:not(.todo):not(.link-list):not(.source-list):not(.guide-list):not(.cat-list) { list-style: none; padding: 0; }
.page-doc ul:not(.todo):not(.link-list):not(.source-list):not(.guide-list):not(.cat-list) > li { position: relative; padding-left: 1.4rem; margin-bottom: 0.5rem; }
.page-doc ul:not(.todo):not(.link-list):not(.source-list):not(.guide-list):not(.cat-list) > li::before { content: ""; position: absolute; left: 0.2rem; top: 0.8em; width: 0.45rem; height: 0.45rem; border-radius: 2px; background: var(--accent); }
.page-doc .notice { margin-top: 1.5rem; }

/* ── 안내 글 ── */
.guide > p:first-child { padding: 1.1rem 1.35rem; font-size: 1.2rem; line-height: 1.75; background: var(--warm); border: 1px solid var(--warm-line); border-radius: 12px; }
.guide > p:first-child strong { color: var(--accent); }
.guide ol { padding-left: 1.5rem; }
.guide ol > li { margin-bottom: 0.5rem; }
.guide .todo { padding: 1rem 1.25rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; }
.guide .todo li { display: flex; gap: 0.6rem; margin-bottom: 0.4rem; }
.guide .todo li:last-child { margin-bottom: 0; }
.guide .table-wrap { font-size: var(--fs-body); }
.guide table { font-size: inherit; }
/* 안내 글 목록 */
.guide-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.guide-list li { margin: 0; padding: 1.1rem 1.35rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.guide-list li:hover { border-color: var(--accent); background: var(--warm); }
.guide-list a { font-size: var(--fs-h3); font-weight: 800; color: var(--navy); text-decoration: none; }
.guide-list a:hover { text-decoration: underline; }
.guide-list .small { color: var(--ink-soft); }

/* ── 링크 ── */
/* 다른 사이트로 나가는 링크 표시 */
@media screen {
  main a[href^="http"]:not(.btn)::after { content: "\00a0↗"; font-size: 0.85em; color: var(--accent); }
}
/* 관련 링크 행 */
.link-list { list-style: none; margin: 0.75rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.link-list li { margin: 0; border-bottom: 1px solid var(--line); }
.link-list a { position: relative; display: grid; gap: 0.15rem; min-height: var(--tap); align-content: center; padding: 0.75rem 2.25rem 0.75rem 0.25rem; color: var(--navy); text-decoration: none; }
.link-list a::after { content: "→"; position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 800; transition: right 0.15s ease; }
.link-list a:hover { background: var(--warm); color: var(--navy); }
.link-list a:hover::after { right: 0.2rem; }
.ll-title { font-weight: 800; }
.ll-desc { font-size: var(--fs-small); color: var(--ink-soft); line-height: 1.6; }
/* 출처 */
.source-list { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: var(--fs-small); }
.source-list li { padding: 0.5rem 0; border-bottom: 1px solid #eee8dc; }
.source-list li:last-child { border-bottom: 0; }
.src-date { display: block; color: var(--ink-soft); }
/* 목록으로 돌아가기 */
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); margin-top: 1rem; font-weight: 700; color: var(--navy); text-decoration: none; }
.back-link::before { content: "←"; color: var(--accent); font-weight: 800; }
.back-link:hover { text-decoration: underline; }
.page-tool > h2:first-child, .page-info > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ── 줄바꿈: 제목은 줄 길이를 맞추고, 문단은 한두 글자만 남지 않게 ── */
h1, h2, h3, legend, .btn, .ll-title, .tool-name, .quick-name, .situation-q, .topic-title { text-wrap: balance; }
p, li, dd, td, .lead, .tool-desc, .ll-desc { text-wrap: pretty; }
.date-chip .m, .badge, .progress-text { white-space: nowrap; }
/* 스크립트가 커서만 옮겨 주는 제목에는 테두리를 그리지 않는다 */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

/* 글 속 표: 휴대폰에서는 행을 카드로 쌓는다 */
@media (max-width: 40rem) {
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table-stack tr { margin-bottom: 0.6rem; padding: 0.65rem 0.9rem; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; }
  .table-stack td { display: grid; grid-template-columns: minmax(0, 6.5em) minmax(0, 1fr); gap: 0.6rem; padding: 0.55rem 0; border: 0; }
  /* 카드 안 항목 사이에 점선(운영자 요청) */
  .table-stack td + td { border-top: 1px dashed var(--line); }
  .table-stack td:first-child + td { border-top: 0; }
  .table-stack td::before { content: attr(data-label); font-size: var(--fs-small); font-weight: 700; color: var(--ink-soft); }
  /* 카드 머리: 옅은 바탕으로 본문 항목과 구분, 위에 원래 열 이름(작은 강조색 글씨) */
  .table-stack tr { overflow: hidden; }
  .table-stack td:first-child { display: block; margin: -0.65rem -0.9rem 0.3rem; padding: 0.65rem 0.9rem 0.6rem; width: auto; background: var(--paper-2); border-bottom: 1px solid var(--line); font-weight: 800; color: var(--navy); }
  /* 카드 제목 위에 원래 열 이름을 작게(예: '평균임금(하루)' → 10만원). 열 이름이 비어 있으면 표시 안 함 */
  .table-stack td:first-child::before { content: attr(data-label); display: block; margin-bottom: 0.1rem; font-size: 0.85rem; font-weight: 700; color: var(--accent-2); letter-spacing: 0; }
  .table-stack td:first-child[data-label=""]::before { content: none; }
}

/* ── 보강 ── */
/* 안내 글 카드: 카드 전체를 누를 수 있게 */
.guide-list li { position: relative; }
.guide-list a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.home-guides .guide-list { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); margin-top: 1rem; }
@media (max-width: 40rem) { .home-guides .guide-list { grid-template-columns: 1fr; } }
.more-link { display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); font-weight: 800; color: var(--navy); text-decoration: none; }
.more-link::after { content: "→"; color: var(--accent); }
.more-link:hover { text-decoration: underline; }
.home-guides .guide-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 40rem) {
  .home-guides .guide-list { grid-template-columns: 1fr; }
  /* 휴대폰 결과 버튼: 2칸, 홀수면 마지막은 한 줄 전체 */
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .toolbar .btn { padding: 0.6rem 0.5rem; font-size: var(--fs-small); }
  .toolbar .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ── 결과 화면: 가장 먼저 할 일 하나 + 그다음 목록 ── */
body.has-result main > :not(#result):not(:has(#result)), body.has-result .page-tool > :not(#result) { display: none; }
.result-title { font-size: 1.6rem; margin: 1.5rem 0 0.25rem; }
.result-note { color: var(--ink-soft); font-size: var(--fs-small); margin: 0 0 1rem; }
.tone-urgent strong, .tone-urgent span { color: var(--urgent); }
.tone-soon strong, .tone-soon span { color: var(--soon); }

.next-up { margin: 1.25rem 0 2.25rem; padding: 1.5rem 1.6rem 0.5rem; background: var(--warm); border: 1px solid var(--warm-line); border-radius: var(--radius); }
.next-up > p, .next-up > h3 { margin: 0; }
.next-kicker { font-size: var(--fs-small); font-weight: 500; color: var(--ink-soft); }
.next-when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.75rem; margin-top: 0.35rem !important; color: var(--navy); }
.next-when strong { font-size: 1.75rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.025em; }
.next-when span { font-size: 1.125rem; font-weight: 500; }
.next-up > .next-title { margin-top: 1rem; font-size: 1.3125rem; line-height: 1.4; color: var(--navy); }
.next-action { margin-top: 0.4rem !important; line-height: 1.65; }
.next-where { margin-top: 0.4rem !important; color: var(--ink-soft); font-size: var(--fs-small); }
.next-more { margin-top: 0.75rem; border-top: 1px solid var(--warm-line); }
.next-more > summary { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); font-weight: 600; color: var(--navy); cursor: pointer; list-style: none; }

.ag-section { margin: 2rem 0; }
.ag-section > h3 { margin: 0 0 0.5rem; font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; color: var(--ink-soft); }
.ag-list { border-top: 1px solid var(--line); }
.ag-row { border-bottom: 1px solid var(--line); }
.ag-row > summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto) 1rem; align-items: center; gap: 0.2rem 1.5rem; min-height: var(--tap); padding: 1.1rem 0; cursor: pointer; list-style: none; }
.ag-row > summary:hover .ag-title { text-decoration: underline; text-underline-offset: 0.2em; }
.ag-title { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; color: var(--navy); line-height: 1.45; }
.ag-when { display: flex; flex-direction: column; align-items: flex-end; text-align: right; max-width: 19rem; line-height: 1.45; }
.ag-when strong { font-weight: 500; color: var(--ink); }
.ag-when span { font-size: var(--fs-small); color: var(--ink-soft); }
.ag-when.tone-urgent strong, .ag-when.tone-urgent span { color: var(--urgent); }
.ag-when.tone-soon strong, .ag-when.tone-soon span { color: var(--soon); }
.ag-row > summary::after, .next-more > summary::after { content: ""; width: 0.55rem; height: 0.55rem; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg) translate(-2px, -2px); justify-self: end; }
.ag-row[open] > summary::after, .next-more[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.ag-row > summary::-webkit-details-marker, .next-more > summary::-webkit-details-marker { display: none; }

.ag-fold { margin: 1.25rem 0; }
.ag-fold > summary { display: flex; align-items: center; min-height: var(--tap); font-weight: 700; color: var(--ink-soft); cursor: pointer; }

/* 펼친 내용: 할 일이 먼저, 나머지는 작고 조용하게 */
.ag-row[open] { border-bottom-color: transparent; }
.ag-body { margin: 0 0 1rem; padding: 1.35rem 1.5rem 1.25rem; background: var(--paper-2); border-radius: var(--radius); }
.next-more .pd-action, .next-more .pd-miss { max-width: 40em; }
.pd-action { margin: 0 0 0.75rem; max-width: 40em; line-height: 1.7; color: var(--ink); }
.pd-miss { margin: 0 0 1.1rem; max-width: 40em; line-height: 1.65; color: var(--ink); }
.pd-miss strong { margin-right: 0.6em; font-weight: 600; color: var(--urgent); }
.pd-facts { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 0.4rem 1rem; margin: 0 0 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: var(--fs-small); line-height: 1.6; color: var(--ink-soft); }
.pd-facts dt { font-weight: 600; }
.pd-facts dd { margin: 0; max-width: 38em; }
.pd-links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: 0; }
.pd-links a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.pd-source { margin: 0.25rem 0 0; font-size: var(--fs-small); line-height: 1.6; color: var(--ink-soft); }
.pd-source a { color: inherit; text-underline-offset: 0.2em; }
#result details.basis { margin: 0; padding: 0; border: 0; }
#result details.basis > summary { display: inline-flex; min-height: 2.75rem; font-size: var(--fs-small); font-weight: 500; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 0.25em; }
#result details.basis ol { margin: 0 0 0.75rem; padding-left: 1.25rem; font-size: var(--fs-small); line-height: 1.6; color: var(--ink-soft); }
.next-more { padding-bottom: 0.25rem; }
.next-more[open] { padding-bottom: 1rem; }

.toolbar { margin: 2rem 0 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
#again { margin-bottom: 0.5rem; }

@media (max-width: 40rem) {
  .next-up { padding: 1.15rem 1.1rem 0.25rem; }
  .next-when strong { font-size: 1.5rem; }
  .ag-row > summary { grid-template-columns: minmax(0, 1fr) 1rem; gap: 0.15rem 0.75rem; }
  .ag-title { grid-column: 1; }
  .ag-when { grid-column: 1; grid-row: 2; align-items: flex-start; text-align: left; max-width: none; }
  .ag-row > summary::after { grid-column: 2; grid-row: 1 / span 2; }
  .ag-body { padding: 1.1rem 1.1rem 1rem; }
  .pd-facts { grid-template-columns: 1fr; gap: 0; }
  .pd-facts dd { margin-bottom: 0.6rem; }
}
@media print {
  .ag-row, .next-up { break-inside: avoid; }
  .next-more > summary, .ag-row > summary::after { display: none; }
  .next-up { background: none; }
}

/* ── 상황별 기본 흐름도 ── */
.situation-grid { grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); }
.flow { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.flow > li { position: relative; padding: 0 0 1rem 1.5rem; line-height: 1.45; }
.flow > li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--navy); }
.flow > li::after { content: ""; position: absolute; left: calc(0.35rem - 0.5px); top: 0.45em; bottom: -0.45em; width: 1px; background: var(--line-strong); }
.flow > li:last-child { padding-bottom: 0; }
.flow > li:last-child::after { display: none; }
.flow-start::before { background: var(--paper) !important; border: 2px solid var(--navy); z-index: 1; }
.flow-when { display: block; font-size: var(--fs-small); color: var(--ink-soft); }
.flow-name { display: block; font-weight: 700; color: var(--navy); }
a.flow-name { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; }
a.flow-name:hover { color: var(--accent); text-decoration-color: currentColor; }
.situation-cta { margin-top: auto; }
.flow-box { margin: 2rem 0; padding: 1.25rem 1.5rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.flow-box > h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.flow-box > .small { margin: 1rem 0 0; color: var(--ink-soft); }

/* 결과 화면 폭은 모든 도구에서 같게(메인은 넓은 화면이라 결과일 때만 좁힌다) */
body.has-result.tool-timeline main.wrap { max-width: var(--wrap); }

/* 이어 보기 · 결과 아래 버튼 */
.resume-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; margin: 0 0 1rem; padding: 0.75rem 1rem; background: var(--warm); border: 1px solid var(--warm-line); border-radius: var(--radius); font-size: var(--fs-small); }
.resume-bar a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 700; color: var(--navy); }
.again-row { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.again-row #again { margin-bottom: 0; }

/* 묶음 제목과 하위 목록: 제목은 크게 + 굵은 선, 목록은 한 단계 가볍게 */
.page-info > h2:has(+ .link-list) { margin: 3.5rem 0 0.75rem; padding-top: 0; border-top: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.page-info > h2:first-child:has(+ .link-list) { margin-top: 0; }
.page-info > h2 + .link-list { margin-top: 0; border-top: 2px solid var(--navy); }
.page-info > h2 + .link-list li:last-child { border-bottom: 0; }
.page-info > h2 + .link-list a { padding-top: 0.95rem; padding-bottom: 0.95rem; padding-left: 0; }
.page-info > h2 + .link-list .ll-title { font-size: 1.125rem; font-weight: 600; }

/* 결과 목록도 묶음 제목과 하위 목록을 같은 방식으로 구분 */
.ag-section { margin-top: 2.75rem; }
.ag-section > h3 { margin: 0 0 0.75rem; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--navy); }
.ag-section > .ag-list { border-top: 2px solid var(--navy); }
.ag-section .ag-row:last-child:not([open]) { border-bottom: 0; }

/* 접힌 묶음: 제목은 "그다음 할 일"과 같게, 오른쪽에 펼치기 표시 */
.ag-fold { margin: 2.75rem 0 0; }
.ag-fold > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.15rem 1rem; min-height: var(--tap); padding: 0 0 0.75rem; border-bottom: 2px solid var(--navy); color: var(--navy); cursor: pointer; list-style: none; }
.ag-fold > summary::-webkit-details-marker { display: none; }
.ag-fold-title { grid-column: 1; font-size: 1.5rem; font-weight: 800; line-height: 1.35; letter-spacing: -0.02em; }
.ag-count { font-weight: 500; color: var(--ink-soft); }
.ag-fold-note { grid-column: 1; font-size: var(--fs-small); font-weight: 400; color: var(--ink-soft); }
.ag-fold > summary::after { content: "펼쳐 보기 ▾"; grid-column: 2; grid-row: 1; white-space: pre; font-size: var(--fs-small); font-weight: 600; color: var(--navy); }
.ag-fold[open] > summary::after { content: "접기 ▴"; }
.ag-fold > summary:hover::after { color: var(--accent); text-decoration: underline; text-underline-offset: 0.25em; }
.ag-fold > .ag-list { border-top: 0; }
.ag-fold .ag-row:last-child:not([open]) { border-bottom: 0; }
@media print { .ag-fold > summary::after { display: none; } }
.ag-fold:not([open]) + .toolbar { border-top: 0; padding-top: 0; }

/* 메인 다듬기 */
.hero { align-items: center; }
.hero h1 { font-size: 3rem; line-height: 1.25; margin-bottom: 1.25rem; }
.hero h1 em { display: block; background: none; }
.hero .lead { font-size: 1.25rem; line-height: 1.65; }
.hero-form .input-notice-inline { text-align: center; text-wrap: balance; }
.situation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.situation-head { gap: 1rem; margin-bottom: 1.1rem; }
.situation-q { margin: 0; }
.situation-body { display: flex; flex: 1; flex-direction: column; }
a.flow-name { font-weight: 600; text-decoration: none; }
a.flow-name::after { content: " ›"; color: var(--accent); }
a.flow-name:hover { text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 56rem) {
  .hero h1 { font-size: 2.1rem; }
}
@media (max-width: 40rem) {
  .hero h1 { font-size: 1.6rem; margin-bottom: 0.4rem; }
  .hero .lead { font-size: var(--fs-body); }
  .situation-grid { grid-template-columns: 1fr; gap: 0.6rem; }
  .situation { padding: 0.5rem 1rem; }
  .situation-head { min-height: var(--tap); margin: 0; }
  .situation-q { flex: 1; font-size: 1.1875rem; }
  .situation-icon { order: -1; flex: none; width: 2.5rem; height: 2.5rem; border-width: 1px; }
  .situation-icon .icon-svg { width: 1.5rem; height: 1.5rem; }
  html.js .situation-head { cursor: pointer; }
  html.js .situation-head::after { content: ""; flex: none; width: 0.55rem; height: 0.55rem; margin-right: 0.2rem; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg) translate(-2px, -2px); }
  html.js .situation.is-open .situation-head::after { transform: rotate(-135deg) translate(-2px, -2px); }
  html.js .situation:not(.is-open) .situation-body { display: none; }
  .situation-body { padding: 0.75rem 0 0.5rem; }
}

/* 안내 글 끝의 묶음(관련 제도·도구, 다음 글, 출처)과 출처 묶음도 같은 구분을 쓴다 */
.guide > h2:has(+ .link-list), .guide > h2:has(+ .source-list), .page-info > h2:has(+ .source-list) { margin: 3.5rem 0 0.75rem; padding-top: 0; border-top: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.guide > h2 + .link-list, .guide > h2 + .source-list, .page-info > h2 + .source-list { margin-top: 0; padding-top: 0.75rem; border-top: 2px solid var(--navy); }
.guide > h2 + .link-list { padding-top: 0; }
.guide > h2 + .link-list li:last-child { border-bottom: 0; }
.guide > h2 + .link-list a { padding-top: 0.95rem; padding-bottom: 0.95rem; padding-left: 0; }
.guide > h2 + .link-list .ll-title { font-size: 1.125rem; font-weight: 600; }

/* 메인 첫 화면: 제목과 입력칸을 가운데로 */
.hero { display: block; padding: 2.5rem 2rem 2rem; text-align: center; background: linear-gradient(180deg, #fdf8ef 0%, #fbf3e4 100%); }
.hero-text { margin-bottom: 1.5rem; }
.hero h1 { font-size: 2.6rem; margin-bottom: 0.6rem; }
.hero .lead { font-size: 1.25rem; color: var(--ink-soft); }
.hero-form { max-width: 37.5rem; margin: 0 auto; text-align: left; }
.hero-form .input-notice-inline { margin: 1rem 0 0; }
.hero-trust { margin: 0.15rem 0 0; font-size: var(--fs-small); color: var(--ink-soft); text-align: center; }
@media (max-width: 56rem) { .hero h1 { font-size: 2.1rem; } }
@media (max-width: 40rem) {
  .hero { padding: 1.25rem 0.9rem 1rem; }
  .hero-text { margin-bottom: 0.9rem; }
  .hero h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
  .hero .lead { font-size: var(--fs-body); }
}

/* 넓은 화면에서도 첫 화면 안에 "다음" 버튼까지 들어오게 */
@media (min-width: 56.01rem) {
  .hero { padding: 1.5rem 2rem 1.25rem; }
  .hero h1 { font-size: 2.4rem; margin-bottom: 0.25rem; }
  .hero h1 em { display: inline; }
  .hero .lead { font-size: 1.125rem; }
  .hero-text { margin-bottom: 1rem; }
  .hero-form .question .q-help { margin-bottom: 0.25rem; }
  .hero-form .field { margin: 0.5rem 0; }
  .hero-form .step-nav { margin-top: 0.75rem; }
  .hero-form .input-notice-inline { margin-top: 0.75rem; }
}

/* 메인 첫 질문: 상황 버튼 4개가 폭을 채운다 */
.hero-form { max-width: 64rem; }
.hero-form .question { max-width: 40rem; margin: 0 auto; }
.hero-form .question[data-step="status"] { max-width: none; }
.hero-form .question[data-step="status"] legend { text-align: center; }
.choice-buttons { clear: both; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; padding-top: 0.5rem; }
.choice-button { min-height: 6rem; padding: 0.75rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); color: var(--navy); font: inherit; font-size: 1.3125rem; font-weight: 700; line-height: 1.35; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.choice-button:hover { background: var(--warm); border-color: var(--navy); }
.choice-button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.hero-alt { margin: 1rem 0 0; text-align: center; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 40rem) {
  .choice-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .choice-button { min-height: 5rem; font-size: 1.1875rem; }
}
.hero-form .progress { max-width: 40rem; margin-left: auto; margin-right: auto; }

/* 연금저축·IRP 결과 */
.choice-buttons { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.acct-rows { border-top: 2px solid var(--navy); }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.acct-label small { display: block; margin-top: 0.1rem; font-size: var(--fs-small); color: var(--accent); }
.acct-row strong { flex: none; font-weight: 700; color: var(--navy); text-align: right; }
.acct-notes { margin: 1rem 0 0; padding-left: 1.25rem; font-size: var(--fs-small); line-height: 1.7; color: var(--ink-soft); }
.acct-notes li { margin-bottom: 0.4rem; }
#result .next-up { padding-bottom: 1.5rem; }
#result > .notice { margin-top: 2.5rem; }
@media (max-width: 40rem) { .choice-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 금액 입력칸 */
.money-box { display: flex; align-items: stretch; min-height: var(--tap); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.money-box:focus-within { border-color: var(--navy); outline: 2px solid var(--focus); outline-offset: 1px; }
.money-box input, .wizard .field .money-box input { flex: 1; width: 100%; min-width: 0; min-height: 0; padding: 0.5rem 0.75rem; border: 0; border-radius: 0; outline: 0; background: none; font-size: 1.3125rem; text-align: right; font-variant-numeric: tabular-nums; }
.money-unit { display: flex; flex: none; align-items: center; padding: 0 0.85rem; color: var(--ink-soft); }
.money-read { display: block; min-height: 1.6em; margin-top: 0.25rem; font-size: var(--fs-small); font-weight: 700; color: var(--navy); text-align: right; }
@media (max-width: 40rem) { .field-row:has(.money-field) { grid-template-columns: 1fr; } }

/* 휴대폰: 각 페이지 첫 질문의 선택지가 스크롤 없이 한눈에 보이게 */
@media (max-width: 40rem) {
  .util-inner { padding-top: 0.25rem; padding-bottom: 0.25rem; }
  .header-inner { padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .js .menu-toggle { min-height: 2.75rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
  .q-help { font-size: var(--fs-small); }
  .page-head { margin-bottom: 0.9rem; padding: 0.9rem 0 0.8rem; }
  .page-kicker { display: none; }
  .page-kicker.has-link { display: inline-flex; margin-bottom: 0.35rem; }
  .page-head h1 { margin-bottom: 0.25rem; font-size: 1.5rem; }
  .page-head .lead { font-size: var(--fs-small); line-height: 1.55; }
  .wizard { padding: 0.9rem 0.9rem 1rem; }
  .wizard .progress { margin-bottom: 0.6rem; }
  .question legend { margin-bottom: 0.25rem; font-size: 1.2rem; }
  .q-help { margin-bottom: 0.25rem; line-height: 1.5; }
  .choices { gap: 0.5rem; margin-top: 0.6rem; }
  .choice label { min-height: 3rem; padding: 0.5rem 0.85rem; }
  .wizard .step-nav { margin-top: 0.9rem; padding-top: 0.75rem; }
  .wizard .field { margin: 0.5rem 0; }
}

/* 안내 글: 목차와 작은 소제목 */
.guide-toc { margin: 1.5rem 0 0.5rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.guide-toc-title { margin: 0 0 0.4rem; font-size: var(--fs-small); font-weight: 800; color: var(--ink-soft); }
.guide-toc ol { margin: 0; padding-left: 1.4rem; }
.guide-toc li { margin: 0.2rem 0; }
.guide-toc a { color: var(--navy); font-weight: 600; text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }
.guide h2[id] { scroll-margin-top: 1rem; }
.guide h3 { margin: 1.75rem 0 0.5rem; font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.guide h3 + p { margin-top: 0; }
@media (max-width: 40rem) { .guide-toc { padding: 0.85rem 1rem; } }

/* 안내 글 분류 */
.cat-chips ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cat-chips a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0.35rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font-weight: 700; text-decoration: none; }
.cat-chips a:hover { border-color: var(--accent); background: var(--warm); }
.cat-chips a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-n { font-size: 0.85em; font-weight: 600; opacity: 0.75; }
.guide-cat-sec h2 a { color: inherit; text-decoration: none; }
.guide-cat-sec h2 a:hover { text-decoration: underline; }
.page-kicker a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; }
@media print { .cat-chips { display: none; } }

/* ═════════ 결과지(모든 도구 공통) ═════════
   순서: 머리(제목·입력 요약) → 핵심 숫자 칸 → 본문 묶음(표·목록) → 확인해 주세요 → 계산 근거 → 버튼 */
.print-only { display: none; }
body.has-result main.wrap { max-width: 56rem; }
.report { margin: 0.5rem 0 1rem; }
.rp-head { padding-bottom: 1.1rem; border-bottom: 2px solid var(--navy); }
.rp-head .result-title { margin: 0 0 0.6rem; font-size: 1.75rem; line-height: 1.35; color: var(--navy); }
.rp-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; }
.rp-meta li { padding: 0.2rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); font-size: var(--fs-small); color: var(--ink-soft); }

/* 핵심 숫자 칸 */
.rp-kpis { display: grid; gap: 0.75rem; margin: 1.5rem 0 0.5rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.rp-kpi { padding: 1rem 1.15rem 1.05rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.rp-kpi > p { margin: 0; }
.rp-kpi-label { font-size: var(--fs-small); font-weight: 700; color: var(--ink-soft); }
.rp-kpi-value { margin-top: 0.3rem !important; font-size: 1.6rem; font-weight: 800; line-height: 1.3; color: var(--navy); letter-spacing: -0.02em; word-break: keep-all; }
.rp-kpi-sub { margin-top: 0.3rem !important; font-size: var(--fs-small); color: var(--ink-soft); line-height: 1.5; }
.rp-kpi.tone-accent { background: var(--warm); border-color: var(--warm-line); }
.rp-kpi.tone-accent .rp-kpi-value { color: var(--accent-2); }
.rp-kpi.tone-ok { background: var(--ok-bg); border-color: #b9d8c0; }
.rp-kpi.tone-ok .rp-kpi-value { color: var(--ok); }
.rp-kpi.tone-warn { background: var(--urgent-bg); border-color: #f0bdb8; }
.rp-kpi.tone-warn .rp-kpi-value { color: var(--urgent); }

/* 본문 묶음 */
.rp-sec { margin: 2.25rem 0 0; }
.rp-sec > h3 { margin: 0 0 0.5rem; font-size: 1.35rem; font-weight: 800; color: var(--navy); }
.rp-sec-note { margin: 0 0 0.75rem; font-size: var(--fs-small); color: var(--ink-soft); }
.rp-sub { font-size: var(--fs-small); color: var(--ink-soft); }
.rp-sub.tone-warn, dd.tone-warn { color: var(--urgent); font-weight: 700; }
.rp-tag { display: inline-block; margin-left: 0.35rem; padding: 0 0.5rem; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); vertical-align: 0.1em; }
.rp-tag.tone-accent { background: var(--warm); border-color: var(--warm-line); color: var(--accent-2); }
.rp-bullets { margin: 0; padding-left: 1.2rem; }
.rp-bullets li { margin: 0.35rem 0; line-height: 1.7; }
.rp-inline-note { margin: 1rem 0 0; }

/* 표 */
.rp-table-wrap { overflow-x: auto; }
.rp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.rp-table caption { text-align: left; font-weight: 700; padding-bottom: 0.4rem; }
.rp-table th, .rp-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.5; }
.rp-table thead th { border-bottom: 2px solid var(--navy); color: var(--navy); font-weight: 800; white-space: nowrap; background: none; }
.rp-table tbody th { font-weight: 700; color: var(--ink); background: none; }
.rp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-table tr.is-mark > * { background: var(--warm); }
.rp-table tr.is-mark > * { font-weight: 700; }
.rp-table-steps tbody tr:last-child > * { border-top: 2px solid var(--navy); }
.rp-table-compare td { min-width: 10rem; }

/* 선택지 판정(건강보험) */
.rp-option { padding: 1rem 1.15rem; margin: 0 0 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.rp-option.is-possible { border-color: #b9d8c0; }
.rp-option.is-check { border-color: #e3d29a; }
.rp-option.is-impossible { background: var(--paper-2); }
.rp-option.is-impossible .rp-option-head h4 { color: var(--ink-soft); }
.rp-option-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.rp-option-head h4 { margin: 0; font-size: 1.25rem; color: var(--navy); }
.rp-option-note { margin: 0.5rem 0 0; }
.rp-option-link { margin: 0.6rem 0 0; font-weight: 700; }
.rp-dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.35rem 1rem; margin: 0.75rem 0 0; }
.rp-dl dt { font-weight: 700; color: var(--ink-soft); }
.rp-dl dd { margin: 0; }
.rp-dl ul { margin: 0; padding-left: 1.1rem; }
.rp-answers { grid-template-columns: 1fr auto; }
.rp-answers dd { font-weight: 700; text-align: right; }
@media (max-width: 40rem) { .rp-dl { grid-template-columns: 1fr; } .rp-dl dd { margin-bottom: 0.4rem; } .rp-answers dd { text-align: left; } }

/* 확인해 주세요 · 근거 · 버튼 */
.rp-notes { margin: 2.25rem 0 0; padding: 1rem 1.25rem; border: 1px solid #e3d29a; border-radius: var(--radius); background: var(--check-bg); }
.rp-notes h3 { margin: 0 0 0.4rem; font-size: 1.1rem; color: var(--check); }
.rp-notes ul { margin: 0; padding-left: 1.2rem; }
.rp-notes li { margin: 0.25rem 0; line-height: 1.7; }
.report > details.basis { margin-top: 1rem; }
.rp-actions { margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); display: grid; gap: 0.75rem; }
.rp-actions-save, .rp-actions-again { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }
.rp-actions .btn { min-width: 9rem; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; padding: 0; margin: 0; }
.chart-legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.field-stack { display: grid; gap: 0.25rem; }
.quick-fill { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.quick-fill-label { font-size: var(--fs-small); font-weight: 700; color: var(--ink-soft); }
.chip { min-height: 2.75rem; padding: 0.3rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--navy); font: inherit; font-size: var(--fs-small); font-weight: 700; cursor: pointer; }
.chip:hover, .chip[aria-pressed="true"] { border-color: var(--navy); background: var(--warm); }
@media (max-width: 40rem) {
  .rp-head .result-title { font-size: 1.45rem; }
  .rp-kpis { grid-template-columns: 1fr; }
  .rp-kpi-value { font-size: 1.4rem; }
  .rp-actions .btn { flex: 1 1 calc(50% - 0.3rem); min-width: 0; }
  .rp-table th, .rp-table td { padding: 0.6rem 0.45rem; }
}

/* ═════════ 인쇄: A4 결과지 ═════════ */
@page { size: A4; margin: 14mm 13mm 16mm; }
@media print {
  html { font-size: 10.5pt; }
  :root { --fs-body: 10.5pt; --fs-small: 9.5pt; }
  body { background: #fff !important; color: #000; }
  .print-only { display: block; }
  table.print-only { display: table; }
  .screen-only, .no-print, .site-header, .site-footer, .util-bar, .page-head, .skip, .wizard, .input-notice-inline, .resume-bar, .rp-actions, .toolbar { display: none !important; }
  body.has-result main > :not(#result):not(:has(#result)) { display: none !important; }
  main.wrap, body.has-result main.wrap { max-width: none; padding: 0; margin: 0; }
  #result a[href]::after { content: none !important; }
  #result a { color: inherit; text-decoration: none; }
  .report { margin: 0; }
  .rp-brand { margin: 0 0 3mm; font-size: 9pt; color: #444; }
  .rp-head { padding-bottom: 3mm; }
  .rp-head .result-title { font-size: 17pt; margin-bottom: 2mm; }
  .rp-meta li { border-color: #999; background: none; color: #000; padding: 0 2.5mm; font-size: 9pt; }
  .rp-kpis { margin: 4mm 0 0; gap: 3mm; grid-template-columns: repeat(3, 1fr); }
  .rp-kpis-4 { grid-template-columns: repeat(4, 1fr); }
  .rp-kpis-2 { grid-template-columns: repeat(2, 1fr); }
  .rp-kpis-1 { grid-template-columns: 1fr; }
  .rp-kpi { padding: 2.5mm 3mm; border-color: #999; background: none !important; break-inside: avoid; }
  .rp-kpi-value { font-size: 13pt; color: #000 !important; }
  .rp-kpi.tone-accent, .rp-kpi.tone-warn, .rp-kpi.tone-ok { border-width: 1.5pt; border-color: #000; }
  .rp-sec { margin-top: 6mm; }
  .rp-sec > h3 { font-size: 12pt; margin-bottom: 1.5mm; color: #000; break-after: avoid; }
  .rp-table { font-size: 9.5pt; }
  .rp-table th, .rp-table td { padding: 1.6mm 2mm; border-bottom-color: #bbb; }
  .rp-table thead th { border-bottom-color: #000; color: #000; }
  .rp-table thead { display: table-header-group; }
  .rp-table tr { break-inside: avoid; }
  .rp-table tr.is-mark > * { background: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-print-agenda { margin-top: 5mm; }
  .rp-print-agenda .rp-group th { padding-top: 3mm; font-size: 10.5pt; border-bottom: 1.5pt solid #000; }
  .rp-print-agenda .rp-when { width: 30%; }
  .rp-print-agenda td:last-child { width: 22%; }
  .rp-option { padding: 2.5mm 3mm; border-color: #999; break-inside: avoid; background: none; }
  .rp-notes { margin-top: 6mm; padding: 2.5mm 3.5mm; border-color: #999; background: none; break-inside: avoid; }
  .rp-notes h3 { color: #000; font-size: 10.5pt; }
  .report details.basis { break-inside: auto; font-size: 9pt; margin-top: 4mm; }
  .report details.basis > summary { font-weight: 700; text-decoration: none; }
  .chart { break-inside: avoid; }
  .chart svg { max-height: 85mm; }
  .bars { break-inside: avoid; }
  .bar-in, .bar-out { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .checklist { break-inside: avoid; border-color: #999; }
  .notice { border-color: #999; background: none; }
  .rp-foot { margin-top: 6mm; padding-top: 2mm; border-top: 1px solid #999; font-size: 8.5pt; color: #444; }
}
.chart-legend svg { width: 34px; height: 10px; border: 0; border-radius: 0; background: none; flex: none; }
.rp-table thead th { white-space: normal; word-break: keep-all; }
.rp-table-pension th, .rp-table-pension td { padding-left: 0.5rem; padding-right: 0.5rem; }
.rp-table-pension tbody th { white-space: nowrap; }

/* 인쇄 결과지 색: 흑백보다 읽기 쉽게, 화면과 같은 색 체계를 옅게 쓴다 */
@media print {
  .report, .report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-brand { display: flex !important; align-items: center; gap: 2mm; padding: 1.6mm 3mm; margin-bottom: 3mm; background: var(--navy); color: #fff; font-weight: 700; border-radius: 1.5mm; }
  .rp-head { border-bottom: 1.5pt solid var(--navy); }
  .rp-head .result-title { color: var(--navy); }
  .rp-meta li { background: var(--paper-2); border-color: var(--line); color: var(--ink-soft); }
  .rp-kpi { background: #fff !important; border: 1pt solid var(--line); border-top: 2.5pt solid var(--navy); }
  .rp-kpi-value { color: var(--navy) !important; }
  .rp-kpi.tone-accent { background: var(--warm) !important; border-color: var(--warm-line); border-top-color: var(--accent); }
  .rp-kpi.tone-accent .rp-kpi-value { color: var(--accent-2) !important; }
  .rp-kpi.tone-ok { background: var(--ok-bg) !important; border-color: #b9d8c0; border-top-color: var(--ok); }
  .rp-kpi.tone-ok .rp-kpi-value { color: var(--ok) !important; }
  .rp-kpi.tone-warn { background: var(--urgent-bg) !important; border-color: #f0bdb8; border-top-color: var(--urgent); }
  .rp-kpi.tone-warn .rp-kpi-value { color: var(--urgent) !important; }
  .rp-sec > h3 { color: var(--navy); padding-bottom: 1mm; border-bottom: 0.75pt solid var(--warm-line); }
  .rp-table thead th { background: var(--navy); color: #fff; border-bottom-color: var(--navy); }
  .rp-table tbody tr:nth-child(even) > * { background: #faf8f3; }
  .rp-table tr.is-mark > * { background: var(--warm) !important; }
  .rp-tag.tone-accent { background: var(--warm); border-color: var(--warm-line); color: var(--accent-2); }
  .rp-print-agenda .rp-group th { background: var(--warm) !important; color: var(--accent-2); border-bottom: 1pt solid var(--accent); }
  .rp-print-agenda .rp-when strong { color: var(--navy); }
  .rp-sub.tone-warn, dd.tone-warn { color: var(--urgent); }
  .rp-option.is-possible { border-color: #b9d8c0; background: #f6fbf7; }
  .rp-option.is-check { border-color: #e3d29a; background: #fffbea; }
  .rp-option.is-impossible { background: var(--paper-2); }
  .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-notes { background: var(--check-bg); border-color: #e3d29a; }
  .rp-notes h3 { color: var(--check); }
  .notice { background: var(--check-bg); border-color: #e3d29a; }
  .checklist { border-color: var(--line-strong); }
  .rp-foot { color: var(--ink-soft); border-top-color: var(--navy); }
}

/* ═════════ 중제목(운영자 선택 A, 2026-11-10) ═════════
   본문보다 확실히 크게 + 앞에 짧은 주황 세로 막대(글자 앞 표시. 카드 옆 막대가 아님) */
.page-body h2:not(.result-title), .guide-cat-sec h2 {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: 1.65rem; font-weight: 800; line-height: 1.35; color: var(--navy); letter-spacing: -0.02em;
  margin-top: 3rem; padding-top: 0 !important; border-top: 0 !important;
}
.page-body h2:not(.result-title)::before, .guide-cat-sec h2::before {
  content: ""; flex: none; width: 6px; height: 1.05em; margin-top: 0.15em; border-radius: 3px; background: var(--accent);
}
.page-body > h2:first-child, .guide-cat-sec:first-of-type h2 { margin-top: 0; }
.guide h3 { font-size: 1.3rem; margin-top: 2rem; }
@media (max-width: 40rem) {
  .page-body h2:not(.result-title), .guide-cat-sec h2 { font-size: 1.4rem; margin-top: 2.5rem; }
  .guide h3 { font-size: 1.2rem; }
}

/* ═════════ 결과 표: 휴대폰 ═════════
   비교 표는 카드로 쪼개지 않는다. 열을 줄이고(m-hide), 빠진 정보는 칸 안 둘째 줄(m-only)로 옮긴다.
   그래도 넓으면 옆으로 밀어 보게 하고 첫 열을 고정한다. */
.m-only { display: none; }
.rp-swipe { margin: 0 0 0.4rem; font-size: var(--fs-small); font-weight: 700; color: var(--accent-2); text-align: right; }
.rp-table-wrap.is-wide .rp-table tbody th, .rp-table-wrap.is-wide .rp-table thead th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
.rp-table-wrap.is-wide .rp-table tr.is-mark > th { background: var(--warm); }
@media (max-width: 48rem) {
  .m-hide { display: none; }
  .m-no { display: none; }
  .m-only { display: inline; }
  td .m-only, th .m-only.rp-sub { display: block; margin-top: 0.2rem; font-weight: 400; }
  td .m-only.m-inline { display: inline; margin: 0; font-weight: inherit; }
  .rp-table { font-size: 1rem; }
  .rp-table th, .rp-table td { padding: 0.6rem 0.4rem; }
  .rp-table thead th { white-space: normal; }
  .rp-table .num { white-space: nowrap; }
  .rp-table-compare td { min-width: 0; }
  .rp-table-pension tbody th { white-space: normal; }
  .rp-table-compare th, .rp-table-compare td { word-break: keep-all; overflow-wrap: anywhere; }
  .rp-tag { margin-left: 0.2rem; padding: 0 0.35rem; font-size: 0.8rem; }
}
@media print { .m-only { display: none !important; } .m-hide { display: table-cell !important; } .m-no { display: inline !important; } }

/* 안내 글 표: 휴대폰에서도 들어가는 표는 표 그대로(table-fit), 안 들어가는 표만 카드(table-stack) — lib/markdown.mjs 의 fitsPhone 이 정한다 */
@media (max-width: 40rem) {
  .table-fit { font-size: 1rem; }
  .table-fit th, .table-fit td { padding: 0.55rem 0.45rem; word-break: keep-all; overflow-wrap: normal; }
  .table-fit thead th { white-space: normal; }
  .table-fit.cols-4 { font-size: 0.95rem; }
  .table-fit.cols-4 th, .table-fit.cols-4 td { padding: 0.5rem 0.3rem; }
}

/* 금액 입력: 양옆 큰 −/+ 와 자주 쓰는 금액 버튼(운영자 제안, 2026-11-10) */
.money-row { display: flex; align-items: stretch; gap: 0.5rem; }
.money-row .money-box { flex: 1; min-width: 0; }
.money-btn { flex: none; width: var(--tap); min-height: var(--tap); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--navy); font: inherit; font-size: 1.6rem; font-weight: 700; line-height: 1; cursor: pointer; }
.money-btn:hover { background: var(--warm); border-color: var(--navy); }
.money-btn:active { background: var(--warm-line); }
.money-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.6rem; }
.money-preset { min-height: 2.9rem; padding: 0.3rem 0.2rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font: inherit; font-size: var(--fs-small); font-weight: 700; cursor: pointer; }
.money-preset:hover { border-color: var(--navy); background: var(--warm); }
.money-preset[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.money-field + .money-field { margin-top: 1.25rem; }

/* 날짜 입력: 년·월·일 선택칸 3개 + 빠른 버튼(운영자 요청, 2026-11-10) */
.date-label { margin: 0 0 0.4rem; font-size: var(--fs-small); font-weight: 700; color: var(--ink-soft); }
.date-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0.5rem; }
.date-part { display: flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 700; color: var(--navy); }
.date-part select, .wizard .field .date-part select { flex: 1; min-width: 0; min-height: var(--tap); padding: 0.4rem 0.5rem; font-size: 1.25rem; font-weight: 700; text-align: center; text-align-last: center; }
.date-part span { flex: none; }
.date-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.6rem; }
@media (max-width: 40rem) { .date-part select, .wizard .field .date-part select { font-size: 1.1rem; padding: 0.4rem 0.2rem; } .date-quick .money-preset { font-size: 0.95rem; } }

/* 안내 글 목록 카드: 제목과 설명 사이가 줄바꿈 한 줄만큼 벌어지던 문제(운영자 지적) */
.guide-list li { line-height: 1.6; }
.guide-list li > br { display: none; }
.guide-list a { display: block; line-height: 1.4; }
.guide-list .small { display: block; margin-top: 0.45rem; line-height: 1.65; }

/* 글·안내 페이지 머리 띠(휴대폰): 구역 이름·제목·소개가 붙어 답답하던 것 정리(운영자 지적).
   도구 페이지는 첫 질문이 스크롤 없이 보여야 해서 촘촘한 간격을 그대로 둔다. */
@media (max-width: 40rem) {
  body:not(.tool) .page-head { padding: 1.6rem 0 1.5rem; margin-bottom: 1.75rem; }
  body:not(.tool) .page-kicker.has-link, body:not(.tool) .page-kicker { margin-bottom: 0.8rem; }
  body:not(.tool) .page-head h1 { margin-bottom: 0.9rem; font-size: 1.6rem; line-height: 1.4; }
  body:not(.tool) .page-head .lead { font-size: 1.0625rem; line-height: 1.75; }
}

/* 결과 화면 버튼: 인쇄(PDF 저장)를 가장 크게, 아이콘 포함(운영자 요청) */
.rp-ico { width: 1.35em; height: 1.35em; flex: none; }
.rp-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.rp-print-btn { width: 100%; min-height: 4rem; font-size: 1.25rem; font-weight: 800; }
.rp-print-btn > span { display: inline-flex; align-items: center; gap: 0.6rem; }
.rp-print-btn > span.m-only { display: none; }
@media (max-width: 48rem) {
  .rp-print-btn > span.m-no { display: none; }
  .rp-print-btn > span.m-only { display: inline-flex; }
}
@media (max-width: 40rem) {
  .rp-actions-save .btn, .rp-actions-again .btn { white-space: nowrap; padding-left: 0.4rem; padding-right: 0.4rem; gap: 0.35rem; }
  .rp-actions-save .rp-ico { width: 1.15em; height: 1.15em; }
}
