/* 이음표 행정사사무소 — N18 고정 목차 + 긴 안내서 */
:root {
  --paper: #F7F5EF;
  --sheet: #FFFEFA;
  --ink: #1F242C;
  --sub: #5A5F66;
  --rule: #DAD5C8;
  --soft: #EEEAE0;
  --red: #A23A2C;
  --serif: 'Nanum Myeongjo', serif;
  --sans: 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.8 var(--sans); word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 800; letter-spacing: -0.4px; }

.mhead { display: none; }

/* ── 책 골격: 왼쪽 고정 목차 | 본문 ── */
.book { display: grid; grid-template-columns: 284px minmax(0, 1fr); }

.toc { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 36px 28px 74px; border-right: 1px solid var(--rule); background: var(--paper); }
.toc__brand { display: block; font-family: var(--serif); font-size: 30px; font-weight: 800; line-height: 1.15; text-decoration: none; letter-spacing: -0.6px; }
.toc__brand span { font-size: 17px; font-weight: 700; color: var(--sub); letter-spacing: 0; }
.toc__ed { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--ink); font-size: 12.5px; color: var(--sub); }
.toc__label { margin: 30px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--red); }
.toc__list { list-style: none; margin: 0; padding: 0; }
.toc__list li { border-bottom: 1px solid var(--rule); }
.toc__list a { position: relative; display: flex; align-items: baseline; gap: 12px; padding: 9px 0 9px 2px; font-size: 15px; color: var(--sub); text-decoration: none; transition: color .15s, padding .15s; }
.toc__list a b { width: 18px; font-family: var(--serif); font-size: 17px; font-weight: 800; color: #B3AC9C; transition: color .15s; }
.toc__list a:hover { color: var(--ink); }
.toc__list a.is-on { color: var(--ink); font-weight: 600; padding-left: 12px; }
.toc__list a.is-on::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; background: var(--red); }
.toc__list a.is-on b { color: var(--red); }
.toc__last { margin-top: 14px; border-top: 1px solid var(--ink); border-bottom: 0 !important; }
.toc__last a { color: var(--ink); font-weight: 600; }
.toc__last a b { color: var(--red); }
.toc__card { margin-top: auto; padding: 16px 16px 14px; background: var(--sheet); border: 1px solid var(--rule); font-size: 13px; line-height: 1.65; color: var(--sub); }
.toc__tel { display: block; font-family: var(--serif); font-size: 22px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: 0; }
.toc__card p { margin: 6px 0 8px; }
.toc__map { font-weight: 600; color: var(--red); text-decoration: none; border-bottom: 1px solid currentColor; }

/* ── 본문 문서 ── */
.doc { min-width: 0; padding: 64px 120px 40px 72px; }
.doc > * { max-width: 720px; }
.chap { padding: 56px 0 60px; border-top: 1px solid var(--rule); scroll-margin-top: 8px; }
.chap > p { margin: 0 0 18px; color: #333840; }
.chap h2 { display: flex; align-items: baseline; gap: 16px; margin: 0 0 22px; font-size: 32px; line-height: 1.3; }
.chap h2 b { font-size: 46px; line-height: 1; color: var(--red); }
.chap h3 { margin: 30px 0 10px; font-size: 19px; }

.cover { padding: 0 0 56px; }
.eyebrow { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 22px; font-size: 13px; font-weight: 600; color: var(--red); }
.eyebrow span { padding-left: 14px; border-left: 1px solid var(--rule); color: var(--sub); font-weight: 500; }
.cover h1 { margin: 0 0 22px; font-size: 37px; line-height: 1.38; letter-spacing: -1px; }
.lead { margin: 0 0 30px; font-size: 17px; color: #333840; }
.facts { width: 100%; border-collapse: collapse; margin: 0 0 34px; font-size: 15px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.facts caption { caption-side: top; text-align: left; padding-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--sub); }
.facts th, .facts td { padding: 11px 0; border-top: 1px solid var(--rule); text-align: left; vertical-align: top; }
.facts tr:first-of-type th, .facts tr:first-of-type td { border-top: 0; }
.facts th { width: 104px; font-weight: 600; color: var(--sub); }
.facts a { color: var(--ink); font-weight: 600; text-decoration-color: var(--red); text-underline-offset: 3px; }

.fig { margin: 0; }
.fig img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--soft); }
.fig figcaption { margin-top: 10px; font-size: 13.5px; color: var(--sub); }
.fig figcaption b { margin-right: 8px; color: var(--ink); }
.fig--side { margin: 30px 0 0; }

.dash { margin: 0; padding: 0; list-style: none; }
.dash li { position: relative; padding: 5px 0 5px 22px; }
.dash li::before { content: ''; position: absolute; left: 2px; top: 19px; width: 10px; height: 1px; background: var(--ink); }

.act { margin: 28px 0 0 !important; }
.btn { display: inline-flex; align-items: center; min-height: 46px; padding: 10px 20px; border: 1px solid var(--ink); background: var(--sheet); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.btn:hover { background: var(--ink); color: var(--sheet); }
.btn--ink { background: var(--ink); color: var(--sheet); }
.btn--ink:hover { background: var(--red); border-color: var(--red); }

/* 요금표 */
.fees { width: 100%; border-collapse: collapse; font-size: 15px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.fees th { padding: 10px 12px 10px 0; font-size: 13px; font-weight: 600; color: var(--sub); text-align: left; border-bottom: 1px solid var(--ink); }
.fees td { padding: 12px 12px 12px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.fees td:nth-child(2) { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fees td:nth-child(3) { color: var(--sub); }
.note { margin: 14px 0 0 !important; padding-left: 12px; border-left: 2px solid var(--red); font-size: 14px; color: var(--sub) !important; }

/* 절차 */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); padding: 16px 0; border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before { content: '3.' counter(s); grid-row: span 2; font-family: var(--serif); font-size: 20px; font-weight: 800; color: var(--red); line-height: 1.5; }
.steps b { font-size: 17px; }
.steps span { color: var(--sub); font-size: 15px; }

/* 준비 서류 */
.papers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.papers h3 { margin-top: 18px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 17px; }
.check { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.check li { position: relative; padding: 6px 0 6px 26px; border-bottom: 1px dashed var(--rule); line-height: 1.6; }
.check li::before { content: ''; position: absolute; left: 0; top: 11px; width: 13px; height: 13px; border: 1.5px solid var(--ink); background: var(--sheet); }

/* 질문 */
details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { position: relative; padding: 16px 40px 16px 0; font-weight: 600; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; right: 4px; top: 12px; font-family: var(--serif); font-size: 24px; color: var(--red); }
details[open] summary::after { content: '−'; }
details p { margin: 0 0 18px; color: var(--sub); }

/* 알림 */
.log { margin: 0; padding: 0; list-style: none; }
.log li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-top: 1px solid var(--rule); font-size: 15px; }
.log li:first-child { border-top: 2px solid var(--ink); }
.log time { font-weight: 600; color: var(--red); font-variant-numeric: tabular-nums; }

/* 오시는 길 */
.visit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.info { margin: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); font-size: 15px; border-top: 2px solid var(--ink); }
.info dt, .info dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.info dt { font-weight: 600; color: var(--sub); }
.info dd a { font-weight: 600; text-decoration-color: var(--red); text-underline-offset: 3px; }
.info small { color: var(--sub); font-size: 13.5px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }

.foot { padding: 28px 0 20px; border-top: 2px solid var(--ink); font-size: 13px; line-height: 1.7; color: var(--sub); }
.foot p { margin: 0 0 4px; }
.foot b { color: var(--ink); }
.foot .nw { white-space: nowrap; }

/* ── 퀵메뉴: PC 오른쪽 세로 ── */
.quick { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 60; display: flex; flex-direction: column; width: 82px; background: var(--sheet); border: 1px solid var(--ink); }
.quick a { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; text-decoration: none; border-top: 1px solid var(--rule); text-align: center; line-height: 1.3; }
.quick a:first-child { border-top: 0; background: var(--ink); color: var(--sheet); }
.quick a:hover { background: var(--soft); }
.quick a:first-child:hover { background: var(--red); }
.quick b { font-size: 13.5px; font-weight: 700; }
.quick span { font-size: 10.5px; letter-spacing: -0.2px; opacity: .8; }

@media (max-width: 1100px) {
  .doc { padding: 52px 124px 40px 48px; }
  .papers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ── 모바일: 목차가 상단 가로 칩 바로 접힘 ── */
@media (max-width: 860px) {
  .mhead { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--paper); }
  .mhead__brand { font-family: var(--serif); font-size: 21px; font-weight: 800; text-decoration: none; }
  .mhead__brand span { font-size: 14px; color: var(--sub); }
  .mhead__tel { font-size: 14px; font-weight: 600; color: var(--red); text-decoration: none; border-bottom: 1px solid currentColor; }
  .book { display: block; }
  .toc { z-index: 50; height: auto; overflow: visible; padding: 0; border-right: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
  .toc__head, .toc__label, .toc__card { display: none; }
  .toc__list { display: flex; gap: 6px; padding: 9px 16px; overflow-x: auto; scrollbar-width: none; }
  .toc__list::-webkit-scrollbar { display: none; }
  .toc__list li, .toc__last { flex: none; margin: 0; border: 0 !important; }
  .toc__list a, .toc__list a.is-on { gap: 5px; padding: 5px 12px; border: 1px solid var(--rule); border-radius: 99px; background: var(--sheet); font-size: 13.5px; white-space: nowrap; }
  .toc__list a b { width: auto; font-size: 13px; }
  .toc__list a.is-on { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
  .toc__list a.is-on::before { display: none; }
  .toc__list a.is-on b { color: #E7A79B; }
  .toc__last a { border-color: var(--red) !important; color: var(--red); }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .doc { padding: 30px 16px 28px; }
  .chap { padding: 40px 0 44px; scroll-margin-top: 54px; }
  .cover { padding-bottom: 40px; }
  .cover h1 { font-size: 27px; line-height: 1.42; letter-spacing: -0.6px; }
  .cover h1 br { display: none; }
  .lead { font-size: 16px; }
  .facts { font-size: 14.5px; }
  .facts th { width: 74px; }
  .chap h2 { font-size: 25px; gap: 12px; }
  .chap h2 b { font-size: 36px; }
  .fees thead { display: none; }
  .fees, .fees tbody, .fees tr, .fees td { display: block; }
  .fees tr { padding: 12px 0; border-top: 1px solid var(--rule); }
  .fees tr:first-child { border-top: 0; }
  .fees td { padding: 0; border: 0; }
  .fees td:first-child { font-weight: 600; }
  .fees td:nth-child(2) { white-space: normal; color: var(--red); }
  .fees td:nth-child(3) { font-size: 14px; }
  .steps li { grid-template-columns: 48px minmax(0, 1fr); }
  .papers { grid-template-columns: 1fr; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .visit { grid-template-columns: 1fr; gap: 22px; }
  .cta-row .btn { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .quick { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: auto; flex-direction: row; border: 0; border-top: 1px solid var(--ink); padding-bottom: env(safe-area-inset-bottom); }
  .quick a { flex: 1; min-height: 56px; justify-content: center; border-top: 0; border-left: 1px solid var(--rule); }
  .quick a:first-child { border-left: 0; }
  .quick .quick__top { display: none; }
}
