/* 한의원 사이트 공통 스타일. 색은 아래 변수만 고친다. 모서리는 전부 12px 하나로 통일. */
:root {
  --bg: #f6f8f7;
  --surface: #fdfefd;
  --ink: #18221f;
  --muted: #56635e;
  --line: #dbe2df;
  --tint: #e6efeb;
  --accent: #1d4e43;
  --accent-ink: #f4faf7;
  --accent-soft: #2f6b5d;
  --warn: #8a5a00;
  --r: 12px;
  --w: 1120px;
  --prose: 720px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111715;
    --surface: #18201d;
    --ink: #e7eeeb;
    --muted: #a3b1ab;
    --line: #2b3632;
    --tint: #1f2b27;
    --accent: #7fc4ae;
    --accent-ink: #0f1c18;
    --accent-soft: #9fd5c3;
    --warn: #f0c060;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 17px; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
.ic { width: 20px; height: 20px; flex: none; stroke-width: 1.75; vertical-align: -4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 30; background: var(--surface); padding: 8px 12px; border-radius: var(--r); }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 20px; }

.preview-bar { background: #fff3c4; color: #5c4400; font-size: 14px; padding: 8px 20px; text-align: center; }
mark.todo { background: #fff0b3; color: #5c4400; padding: 0 3px; border-radius: 4px; font-weight: 600; }

/* ── 머리 ── */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--w); margin: 0 auto; padding: 0 20px; height: 68px; display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 36px; height: 36px; border-radius: var(--r); background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.logo-t { display: flex; flex-direction: column; line-height: 1.2; }
.logo-t b { font-size: 18px; letter-spacing: -0.02em; }
.logo-t small { font-size: 12px; color: var(--muted); }
.gnb { margin-left: auto; }
.gnb ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.gnb a { display: block; padding: 8px 12px; border-radius: var(--r); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.gnb a:hover { background: var(--tint); }
.gnb a[aria-current] { color: var(--accent); font-weight: 700; }
.top-tel { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--accent-ink);
  padding: 9px 14px; border-radius: var(--r); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; }

/* ── 페이지 머리 ── */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 28px 0 32px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.3; letter-spacing: -0.03em; margin: 0; max-width: 22em; }
.lead { font-size: 18px; color: var(--muted); margin: 14px 0 0; max-width: 40em; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.byline b { color: var(--ink); }
.byline span { margin-left: 8px; }

.page-body { display: grid; grid-template-columns: minmax(0, var(--prose)) 1fr; column-gap: 56px; padding-top: 40px; padding-bottom: 72px; }
.toc { grid-column: 2; grid-row: 1 / span 2; align-self: start; position: sticky; top: 92px; font-size: 14px;
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; background: var(--surface); }
.toc-h { margin: 0 0 8px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 18px; color: var(--muted); }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.prose { grid-column: 1; min-width: 0; }
.related { grid-column: 1; }

/* ── 본문 ── */
.prose h2 { font-size: 25px; line-height: 1.4; letter-spacing: -0.02em; margin: 52px 0 14px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose strong { font-weight: 700; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15.5px; line-height: 1.6;
  background: var(--surface); border-radius: var(--r); overflow: hidden; outline: 1px solid var(--line); }
.prose th, .prose td { text-align: left; padding: 11px 14px; vertical-align: top; }
.prose thead th { background: var(--tint); font-weight: 700; }
.prose tbody tr + tr td, .prose tbody tr + tr th { border-top: 1px solid var(--line); }
.prose .tbl { overflow-x: auto; }
.prose .note { background: var(--tint); border-radius: var(--r); padding: 16px 20px; margin: 20px 0; }
.prose .note p:first-child { margin-top: 0; }
.prose .note p:last-child { margin-bottom: 0; }
.prose .alert { border: 1px solid color-mix(in srgb, #b54708 45%, var(--line)); border-radius: var(--r); padding: 16px 20px; margin: 20px 0; }
.prose .alert > p:first-child { font-weight: 700; margin-top: 0; }
.prose .faq h3 { font-size: 18px; }
.prose .faq h3::before { content: "Q. "; color: var(--accent); }
.fine { font-size: 14px; color: var(--muted); }

/* ── 카드 목록(허브) ── */
.cards { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cards a { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; column-gap: 12px; height: 100%;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.cards a:hover { border-color: var(--accent-soft); transform: translateY(-1px); }
.card-t { font-weight: 700; font-size: 17.5px; }
.card-s { grid-column: 1; font-size: 15px; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.card-go { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); }

.related { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.related-h { font-size: 20px; margin: 0 0 12px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related a { display: block; padding: 12px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.related a:hover { border-color: var(--accent-soft); }
.related b { display: block; }
.related span { font-size: 14px; color: var(--muted); }

/* ── 방문 상자 ── */
.visit { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 20px 0; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface); overflow: hidden; }
.visit > div { padding: 20px 22px; }
.visit-where { border-left: 1px solid var(--line); }
.visit-h { display: flex; align-items: center; gap: 6px; font-size: 16px; margin: 0 0 10px !important; }
.visit .hours { outline: none; margin: 0; font-size: 15px; background: none; }
.visit .hours th, .visit .hours td { padding: 4px 0; border: 0 !important; }
.visit .hours th { width: 6.5em; font-weight: 600; color: var(--muted); }
.visit-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: var(--r);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--accent); outline: 1px solid var(--line); }
.btn.ghost:hover { outline-color: var(--accent-soft); }
table.hours { width: 100%; border-collapse: collapse; }

/* ── 홈 ── */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero-in { max-width: var(--w); margin: 0 auto; padding: 56px 20px 60px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.22; letter-spacing: -0.035em; margin: 0; }
.hero h1 small { display: block; font-size: .5em; letter-spacing: -0.01em; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.hero p.sub { font-size: 18.5px; color: var(--muted); margin: 18px 0 26px; max-width: 30em; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-btns .btn { padding: 13px 20px; font-size: 16px; }
.today { border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; background: var(--bg); }
.today h2 { font-size: 16px; margin: 0 0 12px; display: flex; gap: 6px; align-items: center; }
.today .hours { font-size: 15.5px; }
.today .hours th { text-align: left; font-weight: 600; color: var(--muted); padding: 5px 0; width: 7em; }
.today .hours td { padding: 5px 0; }
.today .addr { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; display: flex; gap: 6px; }

.sec { padding: 72px 0; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.03em; line-height: 1.3; margin: 0 0 10px; }
.sec .sec-sub { color: var(--muted); margin: 0 0 28px; max-width: 40em; }

.areas { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: auto auto; gap: 12px; list-style: none; padding: 0; margin: 0; }
.areas li:first-child { grid-row: span 2; }
.areas a { display: flex; flex-direction: column; height: 100%; padding: 24px; border-radius: var(--r); text-decoration: none;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.areas a:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.areas li:first-child a { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.areas li:first-child a .area-s { color: color-mix(in srgb, var(--accent-ink) 82%, transparent); }
.area-t { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.area-s { font-size: 15.5px; color: var(--muted); margin-top: 8px; line-height: 1.65; }
.area-k { margin-top: auto; padding-top: 16px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.areas li:first-child .area-t { font-size: 26px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips a { display: inline-block; padding: 10px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 500; }
.chips a:hover { border-color: var(--accent-soft); color: var(--accent); }

.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
.doc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; }
.doc-card .doc-name { font-size: 22px; font-weight: 700; margin: 0; }
.doc-card .doc-role { color: var(--muted); margin: 2px 0 14px; }
.doc-card ul { margin: 0; padding-left: 18px; }

.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); counter-reset: f; }
.flow li { padding: 22px 22px 24px; counter-increment: f; }
.flow li + li { border-left: 1px solid var(--line); }
.flow b { display: block; font-size: 17.5px; margin-bottom: 6px; }
.flow b::before { content: counter(f); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px;
  border-radius: 50%; background: var(--tint); color: var(--accent); font-size: 14px; }
.flow span { font-size: 15px; color: var(--muted); }

.posts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.posts li { border-top: 1px solid var(--line); }
.posts a { display: block; padding: 16px 0; text-decoration: none; color: var(--ink); }
.posts a:hover b { color: var(--accent); }
.posts b { display: block; font-size: 17px; }
.posts span { font-size: 14.5px; color: var(--muted); }

/* ── 바닥 ── */
.foot { background: var(--surface); border-top: 1px solid var(--line); padding: 44px 0 100px; font-size: 14.5px; color: var(--muted); }
.foot-in { max-width: var(--w); margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 0.8fr; gap: 32px; }
.foot-d ul { columns: 2; column-gap: 16px; }
.foot p { margin: 0 0 4px; }
.foot a { color: var(--muted); }
.foot-name, .foot-h { color: var(--ink); font-weight: 700; margin-bottom: 8px !important; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot-hours li { display: flex; gap: 12px; }
.foot-hours li span:first-child { width: 6.5em; white-space: nowrap; }

.foot .foot-note { max-width: var(--w); margin: 28px auto 0; padding: 18px 20px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.dock { display: none; }

/* ── 좁은 화면 ── */
@media (max-width: 960px) {
  .gnb { display: none; }
  .top-tel { margin-left: auto; }
  .page-body { grid-template-columns: minmax(0, 1fr); }
  .toc { grid-column: 1; grid-row: auto; position: static; margin-bottom: 28px; }
  .hero-in, .split { grid-template-columns: 1fr; gap: 32px; }
  .areas { grid-template-columns: 1fr 1fr; }
  .areas li:first-child { grid-column: span 2; grid-row: auto; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li:nth-child(3) { border-left: 0; }
  .flow li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-a { grid-column: span 2; }
  .dock { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .dock a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px; font-size: 13px; color: var(--ink); text-decoration: none; }
  .dock a:first-child { background: var(--accent); color: var(--accent-ink); }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap, .top-in, .hero-in, .foot-in { padding-left: 16px; padding-right: 16px; }
  .top-tel span { display: none; }
  .top-tel { padding: 9px 11px; }
  .logo-t small { display: none; }
  .cards, .posts, .visit, .areas, .flow { grid-template-columns: 1fr; }
  .areas li:first-child { grid-column: auto; }
  .visit-where { border-left: 0; border-top: 1px solid var(--line); }
  .flow li + li { border-left: 0; border-top: 1px solid var(--line); }
  .sec { padding: 52px 0; }
  .prose h2 { font-size: 22px; }
  .hero-in { padding-top: 36px; padding-bottom: 40px; }
  .foot-in { grid-template-columns: 1fr; }
  .foot-a { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.today .fees-link { margin: 10px 0 0; font-size: 15px; font-weight: 600; }

.prose thead th { white-space: nowrap; }
.visit .hours th, .today .hours th { text-align: left; }
.group-h { font-size: 19px; margin: 36px 0 4px; } .group-h a { color: var(--ink); text-decoration: none; } .group-h a:hover { color: var(--accent); }
.all-areas { font-size: 17px; margin: 32px 0 12px; }
