/* 에미뜨 DM 자료 페이지 — 베이지 + 남색, 고딕(Pretendard) 하나로 통일. 노란색은 카톡 버튼에만
   모바일 우선(인스타 앱 안 브라우저), 데스크톱은 가운데 560px 열 */
:root {
  --navy-900: #1B2640;
  --navy-800: #24345A;
  --navy-600: #4A5878;
  --beige: #EFE6D8;
  --sand: #E3D3BC;
  --tan: #7E6547;
  --cream: #F3ECE2;
  --ivory: #FAF7F2;
  --paper: #FFFFFF;
  --ink: #1F2430;
  --muted: #62697A;
  --line: #E6DCCF;
  --gutter: #ECE4D8;
  --kakao: #FEE500;
  --kakao-ink: #191919;
  --warn-bg: #FFF4C2;
  --warn-ink: #7A5B00;
  --cta-h: 76px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; }
html.big { font-size: 121%; }
body {
  margin: 0;
  background: var(--gutter);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  line-height: 1.78;
  word-break: keep-all;
  overflow-wrap: break-word;
}
h1, h2, h3, blockquote { text-wrap: balance; }
a { color: var(--navy-800); }
:focus-visible { outline: 2px solid var(--navy-800); outline-offset: 3px; border-radius: 6px; }
svg { flex: none; }

.app {
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--ivory);
  padding-bottom: calc(var(--cta-h) + env(safe-area-inset-bottom));
}
@media (min-width: 600px) {
  .app { box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(81, 61, 50, .10); }
}

/* 공통 글자 장치 */
.eyebrow { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.en { font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow .en { color: var(--tan); font-size: .72rem; line-height: 1; }
.kw { display: inline-block; padding: 3px 11px; border-radius: 999px; background: var(--beige); color: var(--navy-800); font-size: .8rem; font-weight: 700; line-height: 1.6; }

/* 머리 */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 16px 20px;
  background: var(--ivory);
}
.brand { display: block; line-height: 0; }
.brand img { width: auto; height: 28px; }
.fontsize {
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--navy-900); font: inherit; font-size: .8rem; font-weight: 600;
}

/* 탭 */
.tabs {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--ivory); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tabs a {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 6px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap;
}
.tabs a[aria-selected="true"] { color: var(--navy-900); font-weight: 800; }
.tabs a[aria-selected="true"]::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; background: var(--navy-800); }

.panel { padding: 24px 20px 40px; }

/* 받은 자료 */
.doc-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 26px; }
.list-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px 0 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  color: var(--navy-900); font-weight: 700; font-size: .88rem; text-decoration: none;
}
.list-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--navy-800); stroke-width: 2; stroke-linecap: round; }
.headline { margin: 0; color: var(--navy-900); font-size: 1.62rem; font-weight: 800; line-height: 1.45; letter-spacing: -.02em; }
.lead { margin: 12px 0 0; color: var(--muted); }
.rule { height: 1px; margin: 24px 0 8px; border: 0; background: linear-gradient(90deg, var(--tan) 0 44px, var(--line) 44px); }

.body p { margin: .85em 0; }
.body h2 { margin: 2.2em 0 .5em; color: var(--navy-900); font-size: 1.14rem; font-weight: 800; line-height: 1.5; }
.body strong { color: var(--navy-900); }
.body ol, .body ul { margin: .6em 0; padding-left: 1.4em; }
.body li { margin: .5em 0; padding-left: .15em; }
.body ol > li::marker { color: var(--tan); font-weight: 800; }
.body ul > li::marker { color: var(--tan); }
.body ul.todo { list-style: none; padding-left: 0; }
.body ul.todo li { display: flex; gap: 10px; }
.box {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-top: .27em; border: 1.5px solid var(--tan); border-radius: 6px;
  color: var(--navy-800); font-size: .8rem; font-weight: 800;
}
.body blockquote { margin: 1.1em 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--tan); color: var(--navy-800); }
.body hr { margin: 1.8em 0; border: 0; border-top: 1px solid var(--line); }
.body figure { margin: 1.3em 0; }
.body img { display: block; max-width: 100%; height: auto; border-radius: 14px; }
.body figcaption { margin-top: 6px; color: var(--muted); font-size: .85rem; }
.body code { padding: 1px 5px; border-radius: 5px; background: var(--cream); font-size: .9em; }
.callout { display: flex; gap: 10px; margin: 1em 0; padding: 14px 16px; border-radius: 14px; background: var(--cream); }
.callout > div > :first-child { margin-top: 0; }
.callout > div > :last-child { margin-bottom: 0; }
.body details { margin: 1.3em 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.body summary { padding: 14px 16px; color: var(--navy-900); font-weight: 700; cursor: pointer; }
.body details > :not(summary) { margin-left: 16px; margin-right: 16px; }
.body details[open] { padding-bottom: 6px; }

.table-wrap { margin: 1em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .94rem; line-height: 1.6; }
.table-wrap th, .table-wrap td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap tr:last-child > * { border-bottom: 0; }
.table-wrap th { background: var(--cream); color: var(--navy-900); font-weight: 700; }

.cmp { display: grid; gap: 12px; margin: 1.1em 0; }
.cmp-card { padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.cmp-card h3 { margin: 0 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--navy-900); font-size: 1.16rem; font-weight: 800; }
.cmp-card dl { margin: 0; }
.cmp-card dt { margin-top: 12px; color: var(--tan); font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.cmp-card dd { margin: 2px 0 0; line-height: 1.68; }
.cmp.rows .cmp-card dt:first-child { margin-top: 0; }

/* 병원 안내 (아래 20%) */
.clinic-card { position: relative; margin-top: 44px; padding: 26px 22px 22px; border-radius: 20px; background: var(--navy-900); color: #EFE6DD; overflow: hidden; }
.clinic-card .hg { position: absolute; top: 20px; right: 22px; width: 22px; height: 31px; fill: none; stroke: var(--sand); stroke-width: 1.2; opacity: .55; }
.clinic-card .en { margin: 0 0 8px; color: var(--sand); font-size: .72rem; }
.clinic-card h2 { margin: 0 0 10px; color: #fff; font-size: 1.28rem; font-weight: 800; line-height: 1.5; }
.clinic-card p { margin: 0; }
.clinic-card .benefit { margin-top: 18px; padding: 16px; border: 1px solid rgba(238, 220, 209, .3); border-radius: 14px; }
.clinic-card .label { margin-bottom: 4px; color: var(--sand); font-size: .8rem; font-weight: 700; }
.clinic-card .coupon { margin-top: 8px; font-size: .9rem; }
.clinic-card .coupon b { color: #fff; }
.btn.ghost {
  display: flex; align-items: center; justify-content: center; min-height: 46px; margin-top: 10px;
  border: 1px solid rgba(238, 220, 209, .6); border-radius: 12px; color: #fff; font-weight: 700; text-decoration: none;
}
.clinic-card .mini { margin-top: 16px; color: rgba(239, 230, 221, .78); font-size: .82rem; }
.note { margin: 22px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.65; }
.todo-mark { padding: 1px 6px; border-radius: 6px; background: var(--warn-bg); color: var(--warn-ink); font-size: .82em; font-weight: 700; white-space: nowrap; }

/* 자료 목록 */
.items { display: grid; gap: 10px; margin-top: 20px; }
.item {
  position: relative; display: grid; gap: 5px; justify-items: start;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper);
  color: inherit; text-decoration: none;
}
.item strong { color: var(--navy-900); font-size: 1.04rem; line-height: 1.45; }
.item .meta { color: var(--muted); font-size: .84rem; }
.item.current { border: 1.5px solid var(--navy-800); background: var(--beige); }
.item.current .kw { background: var(--paper); }
.item .now { position: absolute; top: 15px; right: 16px; color: var(--navy-800); font-size: .78rem; font-weight: 700; }
.item:active { background: var(--cream); }
.empty { margin-top: 18px; color: var(--muted); }

dialog#list {
  width: 100%; max-width: 560px; height: 100%; max-height: 100%;
  margin: 0 auto; padding: 0 0 40px; border: 0; background: var(--ivory); color: var(--ink);
  overflow-y: auto; overscroll-behavior: contain;
}
dialog#list::backdrop { background: rgba(27, 59, 47, .45); }
.sheet-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 20px; background: var(--ivory); border-bottom: 1px solid var(--line);
  color: var(--navy-900); font-size: 1.08rem;
}
.close { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--navy-900); font-size: 1rem; }
.sheet-sub { margin: 14px 20px 0; color: var(--muted); font-size: .88rem; }
dialog#list .items { padding: 0 20px; }

/* 진료 과정 */
.doctor { margin: 0; overflow: hidden; border-radius: 20px; background: #F6F6F6; }
.doctor img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.doctor .ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1 / 1; color: var(--muted); text-align: center; line-height: 1.5; }
.doctor figcaption { padding: 18px 20px 20px; background: var(--navy-900); color: rgba(239, 230, 221, .85); }
.doctor .who { margin: 0 0 4px; color: var(--sand); font-size: .9rem; }
.doctor .who strong { margin-right: 8px; color: #fff; font-size: 1.42rem; font-weight: 800; }
.doctor figcaption p:last-child { margin: 0; font-size: .9rem; line-height: 1.6; }
.block { margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--line); }
.philo blockquote { margin: 0 0 14px; color: var(--navy-900); font-size: 1.5rem; font-weight: 800; line-height: 1.5; }
.philo blockquote::before { content: ""; display: block; width: 28px; height: 3px; margin-bottom: 14px; border-radius: 2px; background: var(--tan); }
.philo p { margin: .7em 0; }
.flow { margin: 8px 0 0; padding: 0; list-style: none; }
.flow li { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding-bottom: 24px; }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 38px; bottom: 6px; width: 1px; background: var(--line); }
.flow .n { color: var(--tan); font-size: 1.3rem; font-weight: 800; line-height: 1.3; letter-spacing: .02em; }
.flow .en { margin: 0; color: var(--navy-600); font-size: .7rem; line-height: 1.6; }
.flow strong { display: block; margin-top: 2px; color: var(--navy-900); font-size: 1.1rem; font-weight: 800; line-height: 1.5; }
.flow p:last-child { margin: 4px 0 0; color: var(--muted); }
.cred { margin: 8px 0 0; padding: 0; list-style: none; }
.cred li { position: relative; margin: 6px 0; padding-left: 16px; }
.cred li::before { content: ""; position: absolute; left: 0; top: .78em; width: 5px; height: 5px; border-radius: 50%; background: var(--tan); }
.more { margin-top: 12px; border-top: 1px dashed var(--line); }
.more summary { padding: 12px 0 2px; color: var(--navy-800); font-size: .9rem; font-weight: 700; cursor: pointer; }
.more .cred li { color: var(--muted); font-size: .93rem; }
.story { margin-top: 40px; padding: 30px 22px 24px; border-radius: 20px; background: var(--cream); text-align: center; }
.story .hg { width: 20px; height: 28px; fill: none; stroke: var(--tan); stroke-width: 1.3; }
.story .word { margin: 10px 0 8px; color: var(--navy-900); font-size: 1.35rem; font-weight: 800; letter-spacing: .12em; line-height: 1.3; }
.story .tag { margin: 0 0 18px; color: var(--navy-800); font-size: 1.04rem; font-weight: 700; line-height: 1.6; }
.values { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; text-align: left; }
.values li { padding: 13px 16px; border-radius: 12px; background: var(--paper); }
.values strong { display: block; color: var(--navy-900); font-size: .98rem; }
.values span { color: var(--muted); font-size: .88rem; }

/* 방문 안내 */
.panel-title { margin: 0 0 8px; color: var(--navy-900); font-size: 1.6rem; font-weight: 800; }
.card { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.card .label { margin: 0 0 4px; color: var(--tan); font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.card p { margin: 0; }
.addr { color: var(--navy-900); font-size: 1.08rem; font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; }
.hours th { width: 40%; color: var(--muted); font-weight: 600; }
.hours td { color: var(--navy-900); font-weight: 700; }
.small { margin-top: 10px !important; color: var(--muted); font-size: .84rem; }
.btn.line {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 12px;
  border: 1px solid var(--navy-800); border-radius: 12px; color: var(--navy-800); font-size: .92rem; font-weight: 700; text-decoration: none;
}

.foot { padding: 30px 20px 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; line-height: 1.7; text-align: center; }
.foot-logo { width: auto; height: 22px; opacity: .8; }
.foot p { margin: 10px 0 6px; }
.foot a { color: var(--navy-800); font-weight: 600; }

/* 하단 고정 버튼 */
.cta {
  position: fixed; bottom: 0; left: 50%; z-index: 20; transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  width: 100%; max-width: 560px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--ivory); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 20px rgba(81, 61, 50, .06);
}
.cta .btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; border-radius: 14px; font-size: 1rem; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.cta .book { background: var(--navy-800); color: #fff; }
.cta .book svg { width: 15px; height: 15px; fill: #fff; }
.cta .kakao { background: var(--kakao); color: var(--kakao-ink); }
.cta .kakao svg { width: 20px; height: 20px; fill: var(--kakao-ink); }
.cta [data-missing] { outline: 2px dashed #E0B400; outline-offset: -5px; }

/* 노션 북마크 · 단 나누기 */
.bookmark { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: .8em 0; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--navy-900); text-decoration: none; }
.bookmark .bm-host { font-weight: 800; }
.bookmark .bm-go { color: var(--tan); font-size: .88rem; font-weight: 700; }
.column_list { display: grid; gap: 4px; margin: 1em 0; }
.column_list .column > :first-child { margin-top: 0; }
.column_list .column figure img { max-width: 280px; margin: 0 auto; }
@media (min-width: 520px) { .column_list { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 14px; } }
