/* 향지한의원 — 흰 벽·먹색 간판·붉은 낙관(香芝)에서 가져온 색 */
:root {
  --paper: #ffffff;
  --mist: #eff2ee;
  --line: #d9dfda;
  --ink: #262b28;
  --ink-soft: #5b625e;
  --pine: #2d4a3f;
  --pine-deep: #20352d;
  --seal: #c4432f;
  --serif: "Gowun Batang", "Noto Serif KR", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.75 var(--sans); word-break: keep-all; overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; }
.skip:focus { top: 8px; }

/* 버튼 */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: 0.95rem; font-weight: 600; text-decoration: none; transition: background-color .2s, color .2s;
}
.btn-solid { background: #fff; border-color: #fff; color: var(--pine); }
.btn-solid:hover { background: var(--mist); }
.btn-ghost { color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.btn-line { color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--pine); color: var(--pine); }

/* 로고 — 낙관·캘리그래피 원본(photos/design_ci/logo)을 줄여 images/logo에 둠. 글씨는 마스크로 글자색을 따른다 */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.seal { display: block; width: auto; height: 32px; }
.logo-calli {
  display: block; width: 95px; height: 26px; background: currentColor;
  -webkit-mask: url(/images/logo/calligraphy.webp) center / contain no-repeat; mask: url(/images/logo/calligraphy.webp) center / contain no-repeat;
}
.logo-name small { display: block; margin-top: 3px; font: 500 0.66rem/1 var(--sans); letter-spacing: 0.04em; opacity: .75; }

/* 헤더: 히어로 위에서는 투명, 지나면 흰 배경 */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; gap: 32px; padding: 0 var(--gutter);
  color: #fff; transition: background-color .25s, color .25s, box-shadow .25s;
}
.site-header.solid, .site-header.open { background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.gnb { display: flex; gap: 4px; margin-left: auto; }
.gnb a { padding: 8px 14px; font-size: 0.97rem; font-weight: 500; text-decoration: none; border-radius: 6px; }
.gnb a:hover { background: rgba(127, 127, 127, .14); }
.gnb-group { position: relative; }
.gnb-group > a { display: block; }
.sub {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); display: none; min-width: 200px; padding: 8px;
  background: var(--paper); color: var(--ink); border-radius: 12px; box-shadow: 0 10px 28px rgba(20, 30, 26, .16);
}
.sub::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.sub a { display: block; white-space: nowrap; padding: 9px 14px; font-size: .93rem; }
.sub a:hover { background: var(--mist); color: var(--pine); }
@media (min-width: 961px) { .gnb-group:hover .sub, .gnb-group:focus-within .sub { display: block; } }
.header-tel { font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; letter-spacing: .01em; }
.menu-btn { display: none; }

/* 히어로 */
.hero { position: relative; min-height: max(560px, 100svh); display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: var(--pine-deep); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.6s ease; }
.hero-bg.on { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 30, 26, .82), rgba(20, 30, 26, .2) 55%, rgba(20, 30, 26, .55));
}
.hero-inner { position: relative; z-index: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(56px, 11vh, 120px); }
.hero h1 { font-weight: 400; font-size: clamp(2.3rem, 1.2rem + 4.4vw, 4.4rem); line-height: 1.25; letter-spacing: -0.02em; }
.hero p { margin-top: 22px; font-size: clamp(1rem, .95rem + .3vw, 1.15rem); opacity: .92; }
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-inner > p { animation-delay: .15s; }
  .hero-inner > .actions { animation-delay: .3s; }
  /* 켄 번스: 보이는 동안(on + 사라지는 중인 prev) 장마다 확대·이동·축소를 번갈아 */
  .hero-bg:is(.on, .prev) { animation: kb-in 8s linear both; }
  .hero-bg:nth-of-type(3n+2):is(.on, .prev) { animation-name: kb-pan; }
  .hero-bg:nth-of-type(3n):is(.on, .prev) { animation-name: kb-out; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes kb-in { from { transform: scale(1.02); } to { transform: scale(1.12); } }
@keyframes kb-pan { from { transform: scale(1.1) translateX(-2.5%); } to { transform: scale(1.1) translateX(2.5%); } }
@keyframes kb-out { from { transform: scale(1.12); } to { transform: scale(1.02); } }

/* 스크롤 등장 — JS가 .reveal을 붙이고 화면에 들어오면 .in (동작 줄이기 설정이면 붙이지 않음) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(min(var(--i, 0), 6) * 80ms); }
.reveal.in { opacity: 1; transform: none; }

/* 공통 섹션 */
.about, .clinics, .departments, .facility, .visit { padding: clamp(80px, 11vw, 140px) var(--gutter); }
.section-head { max-width: 640px; margin: 0 auto clamp(40px, 5vw, 56px); text-align: center; }
.section-head p { margin-top: 14px; color: var(--ink-soft); }

/* 소개 */
.about { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: clamp(32px, 5vw, 72px); max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }
.about-text p { margin-top: 20px; color: var(--ink-soft); max-width: 34em; }
.about-text h2 + p { margin-top: 28px; }
.about-photo { display: grid; }
.about-photo img { grid-area: 1 / 1; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; opacity: 0; transition: opacity 1.5s ease; }
.about-photo img.on { opacity: 1; }
/* 원장 서명 — 얼굴 사진 대신 이름과 낙관 */
.about-text .sign { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 28px; max-width: 34em; color: var(--ink-soft); font: 400 1rem/1 var(--serif); }
.sign b { color: var(--ink); font-size: 1.35rem; letter-spacing: .08em; }
.sign .seal { height: 30px; transform: rotate(-4deg); }
/* 상세 패널 아래 진료 의료인 표기 */
.byline { margin-top: 14px; font-size: .85rem; color: var(--ink-soft); }
.byline a { color: var(--pine); text-underline-offset: 3px; }

/* 클리닉 카드 — 한자 한 글자가 이 페이지의 표정 */
.clinics { background: var(--mist); }
.clinic-grid, .dept-list { scroll-margin-top: 24px; }
.clinic-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; max-width: var(--max); margin: 0 auto; }
.clinic-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  width: 100%; aspect-ratio: 3 / 4.4; padding: 20px; overflow: hidden; text-align: left;
  background: var(--paper); color: var(--ink); border: 0; border-radius: 18px; cursor: pointer;
  font: inherit; transition: background-color .25s, color .25s;
}
.clinic-art { flex: 1 1 0; min-height: 0; width: 100%; height: 0; margin: 0 0 10px; object-fit: contain; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.clinic-card .seal { position: absolute; z-index: 1; top: 12px; left: 12px; height: 30px; }
.clinic-name { position: relative; font: 700 1.12rem/1.35 var(--serif); font-size: min(1.12rem, 11.3cqi); letter-spacing: -.02em; white-space: nowrap; }  /* 가장 긴 이름(비만·다이어트 클리닉)이 한 줄에 들어가는 크기로 통일 */
.clinic-card { container-type: inline-size; }
.more { position: relative; font-size: .85rem; color: var(--ink-soft); }
.clinic-card:hover .clinic-art, .clinic-card:focus-visible .clinic-art { transform: scale(1.05); }
.clinic-card:hover, .clinic-card:focus-visible { box-shadow: inset 0 0 0 1px var(--line); }
.clinic-card[aria-expanded="true"] { background: #d9e5dc; box-shadow: none; }
.clinic-card[aria-expanded="true"] .clinic-name, .clinic-card[aria-expanded="true"] .more { color: var(--pine); }

/* 상세 내용 — 홈 펼침 패널(클리닉·진료과목)과 상세 페이지 공용 */
.lightbox::backdrop { background: rgba(10, 14, 12, .88); }
.panel {
  position: relative; max-width: var(--max); margin: 16px auto 0; padding: clamp(28px, 5vw, 56px); overflow: hidden;
  background: var(--paper); border-radius: 20px; scroll-margin-top: 16px;
}
.panel > :not(.diagram) { position: relative; max-width: 720px; }
.detail h3 { font-size: 1.75rem; }
.detail .lead { margin-top: 14px; font-size: 1.05rem; }
.detail .kicker { font-size: .85rem; font-weight: 700; letter-spacing: .02em; color: var(--seal); }
.detail .kicker + h3 { margin-top: 6px; }
.panel-more { margin-top: 24px; }

/* 상세 페이지 (tools/pages.py가 만든 /clinic/*, /dept/*) */
.h1-pre { display: block; margin-bottom: .5em; font: 600 .8rem/1.2 var(--sans); letter-spacing: .12em; opacity: .85; }
.hero .h1-pre { font-size: clamp(.8rem, .7rem + .3vw, .95rem); }
.sub-page main { padding-top: var(--header-h); }
.page-hero { display: grid; grid-template-columns: 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; padding: clamp(40px, 6vw, 80px) max(var(--gutter), (100% - var(--max)) / 2); background: var(--mist); }
.page-hero.has-art { grid-template-columns: 1.3fr 1fr; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--ink-soft); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--pine); }
.crumbs > :not(:last-child)::after { content: "›"; margin-left: 6px; opacity: .6; }
.page-hero .kicker { margin-top: 28px; font-size: .9rem; font-weight: 700; color: var(--seal); }
.page-hero h1 { margin-top: 28px; font-size: clamp(2rem, 1.3rem + 2.6vw, 3.2rem); }
.page-hero .kicker + h1 { margin-top: 10px; }
.page-hero .h1-pre { color: var(--pine); }
.page-hero .lead { margin-top: 18px; max-width: 34em; font-size: 1.08rem; color: var(--ink-soft); }
.btn-pine { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn-pine:hover { background: var(--pine-deep); }
.page-art { position: relative; display: flex; align-items: center; justify-content: center; height: clamp(280px, 34vw, 440px); }
.page-art img { width: 100%; height: 100%; object-fit: contain; }
.page-art .seal { position: absolute; top: 0; right: 0; width: auto; height: 48px; }  /* 낙관: 그림 칸의 오른쪽 위, 클리닉마다 같은 자리 */
.page-body { max-width: 880px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--gutter) 0; }
.page-body > h4:first-child, .page-body > .diagram:first-child { margin-top: 0; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; padding: 0; list-style: none; }
.detail .steps li { counter-increment: step; margin: 0; padding: 16px; border-radius: 12px; background: var(--mist); font-size: .9rem; }
.detail .steps li::before { content: counter(step, decimal-leading-zero); position: static; display: block; width: auto; height: auto; background: none; font: 600 .75rem/1 var(--sans); letter-spacing: .14em; color: var(--seal); }
.steps b { display: block; margin: 8px 0 4px; color: var(--ink); }
/* 자주 묻는 질문 — 눌러서 펼침(<details>), 구조화 데이터는 tools/pages.py가 같은 내용으로 FAQPage를 만든다 */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; padding: 16px 4px;
  font-weight: 600; color: var(--ink); cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; font: 700 1.05rem/1 var(--serif); color: var(--seal); }
.faq summary::after { content: "+"; font: 300 1.4rem/1 var(--sans); color: var(--pine); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--pine); }
.faq details p { margin: -4px 0 0; padding: 0 4px 18px calc(4px + 1.05rem + 12px); color: var(--ink-soft); }
.siblings { max-width: 880px; margin: clamp(48px, 6vw, 72px) auto 0; padding: 0 var(--gutter); }
.siblings h2 { font: 700 1rem/1.4 var(--sans); color: var(--ink-soft); }
.siblings ul { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.siblings a { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: .92rem; text-decoration: none; }
.siblings a:hover { border-color: var(--pine); color: var(--pine); }
.siblings a[aria-current] { background: var(--pine); border-color: var(--pine); color: #fff; }
.page-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 40px; margin-top: clamp(56px, 7vw, 88px); padding: clamp(40px, 5vw, 56px) max(var(--gutter), (100% - var(--max)) / 2); background: var(--pine); color: #fff; }
.page-cta p { max-width: 36em; opacity: .9; }
.page-cta .big-tel { margin-top: 0; }
.lightbox .diagram { width: auto; max-width: 94vw; margin: 0; cursor: default; }
.lightbox .diagram svg { width: auto; height: calc(92vh - 110px); max-width: 100%; margin: 0 auto; }
.lightbox .diagram figcaption { margin-top: 0; color: var(--ink); text-align: left; font-size: .95rem; }
.detail > p:not([class]) { margin-top: 12px; color: var(--ink-soft); }
.detail h4 { margin-top: 30px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 1rem; color: var(--pine); }
.detail ul { margin-top: 12px; }
.detail li { position: relative; padding-left: 16px; margin-top: 6px; color: var(--ink-soft); }
.detail li::before { content: ""; position: absolute; left: 2px; top: .8em; width: 5px; height: 5px; border-radius: 50%; background: var(--pine); }
.detail .note { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-soft); }
/* 패널 도판 — 의학 도판 스타일 SVG (tools/plates.py로 생성). 모션은 .in(화면 진입) 이후, 동작 줄이기 설정이면 정지 */
.dg-defs { position: absolute; }
.diagram {
  --ochre: #b08a3e; --vein: #4a6680;
  max-width: 400px; margin: 28px auto 0; padding: 14px 16px 18px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper) radial-gradient(rgba(45, 74, 63, .09) 1px, transparent 1.2px) 0 0 / 14px 14px;
}
.dg-cap { display: flex; gap: 10px; align-items: baseline; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--ink); }
.dg-cap span { flex: none; font-size: .68rem; letter-spacing: .14em; color: var(--seal); }
.diagram svg { display: block; width: 100%; height: auto; overflow: visible; }
.diagram svg * { transform-box: fill-box; transform-origin: center; }

/* 선·면 */
.dg-line, .dg-thin, .dg-dash, .dg-hair, .dg-grid, .dg-lead, .dg-icon, .dg-seal-line, .dg-seal-thin,
.dg-attack, .dg-up, .dg-air, .dg-artery, .dg-vein, .dg-spoke, .dg-smoke, .dg-heat, .dg-fiber, .dg-ring, .dg-ring-on, .dg-pulse, .dg-ping, .dg-ripple
  { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dg-line { stroke: var(--pine); stroke-width: 1.5; }
.dg-thick { stroke-width: 2.4; }
.dg-fine { stroke-width: 1.1; }
.dg-thin { stroke: var(--pine); stroke-width: .9; opacity: .6; }
.dg-dash { stroke: var(--pine); stroke-width: 1; stroke-dasharray: 3 4; opacity: .45; }
.dg-hair { stroke: var(--pine); stroke-width: .7; opacity: .22; }
.dg-grid { stroke: var(--pine); stroke-width: .8; opacity: .14; }
.dg-lead { stroke: var(--ink-soft); stroke-width: .8; opacity: .6; }
.dg-icon { stroke: var(--pine); stroke-width: 1.4; }
.dg-skin { fill: #e7eee9; stroke: none; }
.dg-vert { fill: var(--pine); opacity: .32; }
.dg-node { fill: var(--paper); stroke: var(--pine); stroke-width: 1.4; }
.dg-card { fill: var(--paper); stroke: var(--line); stroke-width: 1; }
.dg-tint { fill: var(--pine); opacity: .08; }
.dg-label-bg { fill: var(--paper); opacity: .92; }
.dg-dot, .dg-badge { fill: var(--seal); }
.dg-mark { fill: var(--paper); stroke: var(--seal); stroke-width: 1.6; }
.dg-ping { stroke: var(--seal); stroke-width: 1.4; opacity: 0; }
.dg-seal-line { stroke: var(--seal); stroke-width: 1.8; }
.dg-seal-thin { stroke: var(--seal); stroke-width: 1; }
.dg-band { fill: var(--pine); opacity: .1; }
.dg-ring { stroke: #dfe7e2; stroke-width: 18; stroke-linecap: butt; }
.dg-ring-on { stroke: var(--pine); stroke-width: 18; stroke-linecap: butt; opacity: 0; }
.dg-orbit-dot { fill: var(--paper); stroke: var(--seal); stroke-width: 2.2; }
.dg-travel, .dg-travel-x { fill: var(--seal); }
.dg-shield { fill: none; stroke: var(--pine); stroke-width: 10; opacity: .08; }
.dg-pulse { stroke: var(--pine); stroke-width: 1.2; opacity: 0; }
.dg-core { fill: #e3ebe6; stroke: var(--pine); stroke-width: 1.5; }
.dg-attack { stroke: var(--seal); stroke-width: 1.6; stroke-dasharray: 5 4; }
.dg-venn { stroke-width: 1.3; }
.dg-v1 { fill: rgba(45, 74, 63, .13); stroke: rgba(45, 74, 63, .7); }
.dg-v2 { fill: rgba(196, 67, 47, .1); stroke: rgba(196, 67, 47, .65); }
.dg-v3 { fill: rgba(176, 138, 62, .14); stroke: rgba(176, 138, 62, .75); }
.dg-epi { fill: #f1e3dc; }
.dg-derm { fill: #f7eee6; }
.dg-hypo { fill: #faf3e6; }
.dg-musc { fill: #efd9d2; }
.dg-fiber { stroke: var(--ochre); stroke-width: .8; opacity: .35; }
.dg-basal { fill: var(--seal); opacity: .25; }
.dg-fat { fill: rgba(176, 138, 62, .16); stroke: rgba(176, 138, 62, .55); stroke-width: .8; }
.dg-bulb { fill: rgba(196, 67, 47, .2); stroke: var(--pine); stroke-width: .9; }
.dg-gland { fill: rgba(176, 138, 62, .35); stroke: var(--ochre); stroke-width: .9; }
.dg-artery { stroke: var(--seal); stroke-width: 2.2; stroke-dasharray: 4 3; }
.dg-vein { stroke: var(--vein); stroke-width: 2.2; stroke-dasharray: 4 3; }
.dg-pill { fill: var(--paper); stroke: var(--pine); stroke-width: 1.1; }
.dg-up { stroke: var(--pine); stroke-width: 1.4; stroke-dasharray: 3 3; }
.dg-moxa { fill: rgba(176, 138, 62, .3); stroke: var(--pine); stroke-width: 1.3; }
.dg-ember { fill: var(--seal); }
.dg-smoke { stroke: var(--ink-soft); stroke-width: 1; opacity: .35; }
.dg-heat { stroke: var(--seal); stroke-width: 1; opacity: 0; }
.dg-glass { fill: rgba(255, 255, 255, .55); stroke: var(--pine); stroke-width: 1.5; }
.dg-shine { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: .9; }
.dg-bulge { fill: rgba(196, 67, 47, .22); stroke: rgba(196, 67, 47, .6); stroke-width: .9; }
.diagram svg .dg-bulge { transform-origin: center bottom; }
.dg-ph1 { fill: rgba(45, 74, 63, .1); } .dg-ph2 { fill: rgba(196, 67, 47, .12); } .dg-ph3 { fill: rgba(176, 138, 62, .2); } .dg-ph4 { fill: rgba(125, 133, 130, .14); }
.dg-sinus { fill: rgba(196, 67, 47, .2); stroke: rgba(196, 67, 47, .55); stroke-width: .9; }
.dg-turb { fill: rgba(45, 74, 63, .08); stroke: var(--pine); stroke-width: 1; opacity: .7; }
.dg-tongue { fill: rgba(196, 67, 47, .12); stroke: rgba(196, 67, 47, .45); stroke-width: .9; }
.dg-air { stroke: var(--pine); stroke-width: 1.6; stroke-dasharray: 2 6; opacity: .7; }
.dg-spoke { stroke: var(--pine); stroke-width: .9; stroke-dasharray: 2 4; opacity: .5; }
.dg-heart { fill: rgba(196, 67, 47, .08); stroke: var(--seal); stroke-width: 1.4; }
.dg-ripple { stroke: var(--seal); stroke-width: 1; opacity: 0; }

/* 글자 (크기는 font-size 속성) */
.dg-t, .dg-s { fill: var(--ink-soft); font-family: var(--sans); font-weight: 500; }
.dg-b { fill: var(--ink); font-family: var(--sans); font-weight: 700; }
.dg-num { fill: var(--seal); font-family: var(--sans); font-weight: 700; letter-spacing: .12em; }
.dg-cap-t { fill: var(--ink-soft); font-family: var(--sans); font-weight: 600; letter-spacing: .14em; }
.dg-rt { fill: var(--seal); font-family: var(--sans); font-weight: 700; }
.dg-badge-t { fill: #fff; font-family: var(--sans); font-weight: 700; }

/* 모션 */
@media (prefers-reduced-motion: no-preference) {
  .diagram:not(.in) .dg-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .diagram:not(.in) :is(.dg-fade, .dg-rise, .dg-pop, .dg-grow) { opacity: 0; }
  .diagram.in .dg-draw { stroke-dasharray: 1; animation: dg-draw 1.6s cubic-bezier(.4, 0, .2, 1) var(--d, 0s) both; }
  .diagram.in .dg-fade { animation: dg-fade .7s ease var(--d, 0s) both; }
  .diagram.in .dg-rise { animation: dg-rise .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) both; }
  .diagram.in .dg-pop { animation: dg-pop .6s cubic-bezier(.3, 1.4, .5, 1) var(--d, 0s) both; }
  .diagram.in .dg-grow { transform-origin: left center; animation: dg-grow .8s cubic-bezier(.4, 0, .2, 1) var(--d, 0s) both; }
  .dg-ping { animation: dg-ping 2.6s ease-out calc(var(--d, 0s) + 1s) infinite; }
  .dg-ring-on { animation: dg-seq 8s linear calc(var(--d, 0s) + 1s) infinite; }
  .diagram svg .dg-orbit { transform-box: view-box; animation: dg-spin 8s linear 1s infinite; }
  .dg-travel { animation: dg-travel-y 4s ease-in-out 1s infinite; }
  .dg-travel-x { animation: dg-travel-x 8s ease-in-out 1s infinite; }
  .dg-pulse { animation: dg-pulse 3s ease-out 1s infinite; }
  .dg-attack, .dg-up, .dg-artery, .dg-air, .dg-spoke { animation: dg-flow 1.1s linear var(--d, 0s) infinite; }
  .dg-vein { animation: dg-flow-rev 1.1s linear infinite; }
  .dg-breathe { animation: dg-breathe 3.2s ease-in-out calc(var(--d, 0s) + 1s) infinite alternate; }
  .dg-bob { animation: dg-bob 2.8s ease-in-out 1s infinite; }
  .dg-smoke { animation: dg-smoke 3s ease-out var(--d, 0s) infinite; }
  .dg-heat { animation: dg-heat 2.7s ease-out var(--d, 0s) infinite; }
  .dg-suck { animation: dg-suck 2.8s ease-in-out 1s infinite; }
  .dg-ember { animation: dg-glow 1.6s ease-in-out infinite alternate; }
  .dg-ripple { animation: dg-ripple 4.2s ease-out var(--d, 0s) infinite; }
}
@keyframes dg-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dg-fade { from { opacity: 0; } }
@keyframes dg-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes dg-pop { from { opacity: 0; transform: scale(.4); } }
@keyframes dg-grow { from { opacity: 0; transform: scaleX(0); } }
@keyframes dg-ping { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(2.8); } }
@keyframes dg-seq { 0%, 25% { opacity: .9; } 27%, 100% { opacity: 0; } }
@keyframes dg-spin { to { transform: rotate(360deg); } }
@keyframes dg-travel-y { 0% { transform: translateY(0); opacity: 0; } 10%, 90% { opacity: 1; } 100% { transform: translateY(var(--dist)); opacity: 0; } }
@keyframes dg-travel-x { 0% { transform: translateX(0); opacity: 0; } 8%, 92% { opacity: 1; } 100% { transform: translateX(var(--dist)); opacity: 0; } }
@keyframes dg-pulse { 0% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18); } }
@keyframes dg-flow { to { stroke-dashoffset: -9; } }
@keyframes dg-flow-rev { to { stroke-dashoffset: 9; } }
@keyframes dg-breathe { to { transform: scale(1.04); } }
@keyframes dg-bob { 0%, 100% { transform: translateY(-14px); } 45%, 60% { transform: translateY(0); } }
@keyframes dg-smoke { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: .45; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes dg-heat { 0% { opacity: .6; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.3); } }
@keyframes dg-suck { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.9); } }
@keyframes dg-glow { from { opacity: .55; } to { opacity: 1; } }
@keyframes dg-ripple { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(3.4); } }
@media (min-width: 1101px) {
  .panel { min-height: 560px; }
  .panel > :not(.diagram) { max-width: calc(100% - 440px); }
  .panel .diagram { position: absolute; top: clamp(28px, 5vw, 56px); right: clamp(28px, 5vw, 56px); width: 390px; margin: 0; }
}
.page-body .diagram { max-width: 640px; margin-top: 0; padding: 20px 24px 26px; cursor: zoom-in; }
.page-body .dg-cap { font-size: .95rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin-top: 24px; padding: 18px 20px; background: var(--mist); border-radius: 12px; }
.facts dt { font-weight: 700; color: var(--pine); }
.facts dd { color: var(--ink-soft); }

/* 진료과목 — 목록을 누르면 아래 패널 교체 (클리닉과 같은 방식) */
.departments { display: grid; grid-template-columns: 1fr 2fr; gap: 24px clamp(32px, 5vw, 72px); max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }
.dept-head p { margin-top: 14px; color: var(--ink-soft); }
.dept-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
.dept-list li { border-top: 1px solid var(--line); }
.dept-item { position: relative; display: block; width: 100%; padding: 20px 32px 20px 0; text-align: left; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.dept-item::after { content: ""; position: absolute; right: 8px; top: 50%; width: 8px; height: 8px; border: solid var(--ink-soft); border-width: 2px 2px 0 0; transform: translateY(-50%) rotate(45deg); transition: transform .2s; }
.dept-item[aria-expanded="true"]::after { transform: translateY(-75%) rotate(135deg); border-color: var(--pine); }
.dept-item strong { display: block; font: 700 1.2rem/1.4 var(--serif); transition: color .2s; }
.dept-item span { font-size: .88rem; color: var(--ink-soft); }
.dept-item:hover strong, .dept-item:focus-visible strong, .dept-item[aria-expanded="true"] strong { color: var(--pine); }
.dept-panel { grid-column: 1 / -1; width: 100%; margin-top: 0; background: var(--mist); }

/* 시설 — 모자이크, 크롭된 칸은 누르면 원본 비율로 */
.facility { border-top: 1px solid var(--line); }
/* 시설 — 공간 투어: 왼쪽 단계가 화면 가운데를 지나면 오른쪽 고정 사진이 교차 */
.tour { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 72px); max-width: var(--max); margin: 0 auto; }
.tour-steps { list-style: none; padding: 12vh 0 18vh; }
.tour-step { min-height: 44vh; display: flex; flex-direction: column; justify-content: center; padding-left: 24px; border-left: 2px solid var(--line); opacity: .35; transition: opacity .5s, border-color .5s; }
.tour-step.on { opacity: 1; border-color: var(--pine); }
.tour-no { font: 600 .8rem/1 var(--sans); letter-spacing: .16em; color: var(--seal); }
.tour-step h3 { margin-top: 10px; font: 700 clamp(1.5rem, 1.1rem + 1.2vw, 2rem)/1.3 var(--serif); }
.tour-step p { margin-top: 10px; max-width: 26em; color: var(--ink-soft); }
.tour-frame {
  position: sticky; top: calc(var(--header-h) + 6vh); align-self: start; height: min(72vh, 600px); padding: 0; border: 0;
  border-radius: 20px; overflow: hidden; background: var(--mist); cursor: zoom-in;
}
.tour-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .9s ease, transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.tour-frame img.on { opacity: 1; transform: none; }
.tour-count { position: absolute; left: 18px; bottom: 16px; padding: 6px 12px; border-radius: 999px; background: rgba(20, 30, 26, .55); color: #fff; font: 500 .82rem/1 var(--sans); letter-spacing: .08em; }
.tour-count b { font-weight: 700; }
.lightbox figcaption { margin-top: 10px; font-size: .95rem; color: var(--ink-soft); }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 95vw; max-height: 95vh; }
.lightbox img { max-width: 95vw; max-height: calc(95vh - 44px); border-radius: 16px; }
.lightbox figcaption { color: #fff; text-align: center; font-size: 1.05rem; }

/* 전화·진료시간 띠 */
.info {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 5vw, 80px);
  padding: clamp(56px, 7vw, 88px) max(var(--gutter), (100% - var(--max)) / 2);
  background: var(--pine); color: #fff;
}
.info h2 { font: 600 1rem/1.4 var(--sans); opacity: .75; }
.big-tel { display: inline-block; margin-top: 8px; font: 400 clamp(2.4rem, 1.6rem + 3vw, 3.6rem)/1.15 var(--serif); font-variant-numeric: tabular-nums; text-decoration: none; }
.info-call p { margin-top: 12px; opacity: .8; }
.info-hours dl { display: grid; grid-template-columns: auto 1fr; margin-top: 16px; }
.info-hours dt, .info-hours dd { padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, .22); }
.info-hours dt { padding-right: 32px; font-weight: 600; }
.info-hours dd { font-variant-numeric: tabular-nums; }

/* 진료일 달력(calendar.js) — 왼쪽 전화·진료시간, 오른쪽 흰 카드 */
.info { grid-template-rows: auto 1fr; }
.info-call { grid-column: 1; grid-row: 1; }
.info-hours { grid-column: 1; grid-row: 2; }
.cal {
  grid-column: 2; grid-row: 1 / span 2; align-self: start; padding: clamp(20px, 2.6vw, 32px);
  border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .45);
}
.info .cal h2 { color: var(--pine); opacity: 1; }
.cal-today { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--mist); color: var(--ink-soft); font-size: .93rem; }
.cal-today b { display: inline-flex; align-items: center; gap: 8px; color: var(--pine); font-size: 1rem; }
.cal-today b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(45, 74, 63, .14); }
.cal-today.is-closed { background: #fbefec; }
.cal-today.is-closed b { color: var(--seal); }
.cal-today.is-closed b::before { box-shadow: 0 0 0 4px rgba(196, 67, 47, .14); }
.cal-head { display: flex; align-items: center; gap: 6px; margin: 22px 0 10px; }
.cal-title { display: flex; margin-right: auto; }
.cal-title select {
  appearance: none; -webkit-appearance: none; field-sizing: content; padding: 4px 22px 4px 8px; border: 0; border-radius: 10px; color: var(--ink); cursor: pointer;
  font: 700 1.35rem/1.3 var(--serif); font-variant-numeric: tabular-nums; transition: background-color .2s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235b625e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 6px center / 10px no-repeat;
}
.cal-title select:hover { background-color: var(--mist); }
.cal-back { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--pine); font: 600 .85rem var(--sans); cursor: pointer; transition: background-color .2s, border-color .2s, opacity .2s; }
.cal-back:hover:not(:disabled) { background: var(--mist); border-color: var(--pine); }
.cal-back:disabled { opacity: 0; pointer-events: none; }
.cal-nav {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0 0 3px; border: 1px solid var(--line); border-radius: 50%;
  background: none; color: var(--ink); font: 400 1.5rem/1 var(--sans); cursor: pointer; transition: background-color .2s, border-color .2s;
}
.cal-nav:hover:not(:disabled) { background: var(--mist); border-color: var(--pine); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { table-layout: fixed; border-collapse: separate; border-spacing: 3px; margin: 0 -3px; width: calc(100% + 6px); }
.cal-grid th { padding: 6px 0; font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.cal-grid th.is-sun { color: var(--seal); }
.cal-grid td { height: 62px; padding: 6px 2px; border-radius: 10px; text-align: center; vertical-align: top; font-variant-numeric: tabular-nums; }
.cal-grid .d { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: .95rem; font-weight: 500; }
.cal-grid small { display: block; margin-top: 1px; overflow: hidden; font-size: .68rem; line-height: 1.3; letter-spacing: -.03em; white-space: nowrap; text-overflow: ellipsis; }
.cal-grid .is-weekend .d { color: #a7aeaa; }
.cal-grid .is-weekend.is-sun .d { color: #d99a8f; }
.cal-grid .is-closed { background: #fbefec; color: var(--seal); }
.cal-grid .is-extra { background: var(--mist); color: var(--pine); }
.cal-grid .is-today .d { background: var(--pine); color: #fff; font-weight: 700; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-size: .8rem; color: var(--ink-soft); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend span::before { content: ""; width: 12px; height: 12px; border-radius: 4px; }
.cal-legend .is-closed::before { background: #fbefec; box-shadow: inset 0 0 0 1px rgba(196, 67, 47, .35); }
.cal-legend .is-extra::before { background: var(--mist); box-shadow: inset 0 0 0 1px rgba(45, 74, 63, .35); }
.cal-legend .is-today::before { border-radius: 50%; background: var(--pine); }
.cal-notes { margin-top: 14px; border-top: 1px solid var(--line); font-size: .92rem; }
.cal-notes li { display: flex; gap: 14px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.cal-notes li span { flex: none; min-width: 4.6em; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--seal); }
.cal-notes .is-extra span { color: var(--pine); }
.cal-notes .is-none { color: var(--ink-soft); }

/* 오시는 길 */
.visit { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(32px, 5vw, 64px); align-items: start; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }
.landmark { margin-top: 24px; font: 700 1.2rem/1.6 var(--serif); }
.visit address { margin-top: 14px; font-style: normal; color: var(--ink-soft); }
#naver-map { width: 100%; height: clamp(320px, 36vw, 440px); border-radius: 20px; overflow: hidden; background: var(--mist); }

/* 주차 안내 — 왼쪽 제목·무료 안내, 오른쪽 3D 안내도(parking3d.js, 지도와 같은 크기) 아래 상세 안내 */
.visit { padding-bottom: clamp(48px, 6vw, 72px); }
.facility + .visit { padding-top: 0; }  /* 시설 안내와 둘 다 흰 바탕이라 여백이 겹치지 않게 */
.parking { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) clamp(80px, 11vw, 140px); }
.parking-text { display: grid; grid-template-columns: 1fr 1.6fr; grid-template-rows: auto auto 1fr; align-items: start; gap: 14px clamp(32px, 5vw, 64px); padding-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.parking-free { grid-column: 1; font: 700 1.35rem/1.5 var(--serif); }
.parking-free b { color: var(--seal); }
.parking-bridge { grid-column: 1; color: var(--ink-soft); }
.parking-bridge b { color: var(--ink); }
.parking-list { grid-column: 2; grid-row: 4; margin-top: 18px; list-style: none; padding: 0; }
.parking-list li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.parking-list li:first-child { padding-top: 0; }
.parking-list b { color: var(--ink); }
.parking-list .pin + b { margin-right: 6px; }
.pin { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--seal); color: #fff; font: 700 .78rem/1 var(--sans); vertical-align: 1px; }
.parking-3d { position: relative; grid-column: 2; grid-row: 1 / span 3; height: clamp(320px, 36vw, 440px); border-radius: 20px; overflow: hidden; background: linear-gradient(#f3f5f2, #e3e9e4); }
.parking-3d canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .8s; }
.parking-3d.ready canvas { opacity: 1; }
.p3d-labels { position: absolute; inset: 0; pointer-events: none; }
.p3d-label { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; padding: 4px 9px; border-radius: 999px; white-space: nowrap; font: 600 .76rem/1.2 var(--sans); color: var(--ink); background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(20, 30, 26, .14); }
.p3d-label.is-bldg { padding: 6px 12px; font: 700 1rem/1 var(--serif); }
.p3d-tag { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); padding: 4px 9px; border-radius: 8px; font: 600 .76rem/1.2 var(--sans); color: #fff; background: #2b5cd6; box-shadow: 0 2px 8px rgba(20, 30, 26, .14); }
.p3d-tag::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: #2b5cd6; }  /* 말풍선 꼬리 */
.p3d-label.is-seal, .p3d-label.is-pin { background: var(--seal); color: #fff; }
.p3d-label.is-park { background: var(--pine); color: #fff; }
.p3d-label.is-bridge { background: #2b5cd6; color: #fff; }
.p3d-label.is-road { background: none; box-shadow: none; color: rgba(255, 255, 255, .95); letter-spacing: .2em; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.p3d-label.is-place { font-weight: 500; font-size: .7rem; color: var(--ink-soft); }
.p3d-label.is-land { background: rgba(38, 43, 40, .78); color: #fff; font-weight: 600; }
.p3d-label.is-green { background: #5d8a62; color: #fff; }
.p3d-label.is-gate { font-size: .68rem; padding: 3px 7px; color: var(--seal); border: 1px solid rgba(196, 67, 47, .35); }

/* 푸터 */
.site-footer {
  display: grid; grid-template-columns: auto 1fr; gap: 24px 64px; align-items: start;
  padding: 56px max(var(--gutter), (100% - var(--max)) / 2) 40px; background: var(--pine-deep); color: rgba(255, 255, 255, .92);
}
.footer-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; font-size: .92rem; }
.footer-info dt { opacity: .6; }
.footer-info a { text-decoration: none; }
.copy { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .85rem; opacity: .6; }

/* 빠른 연결: 데스크톱은 오른쪽 세로, 모바일은 하단 막대 */
.quick {
  position: fixed; right: 20px; top: 50%; z-index: 40; transform: translateY(-50%);
  display: flex; flex-direction: column; background: var(--paper); border-radius: 16px; box-shadow: 0 4px 20px rgba(20, 30, 26, .14); overflow: hidden;
}
.quick a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 12px; font-size: .78rem; font-weight: 600; text-decoration: none; color: var(--ink); }
.quick a + a { border-top: 1px solid var(--line); }
.quick a:hover { color: var(--pine); background: var(--mist); }
.quick svg { width: 22px; height: 22px; fill: var(--pine); }

/* ---------- 반응형 ---------- */
@media (min-width: 961px) and (max-width: 1399px) { .quick { display: none; } }

@media (max-width: 1100px) {
  .clinic-grid { grid-template-columns: repeat(3, 1fr); }
  .clinic-card { aspect-ratio: 4 / 3.6; }
}

@media (max-width: 960px) {
  .parking-text { grid-template-columns: 1fr; }
  .parking-list { grid-column: 1; grid-row: auto; margin-top: 8px; }
  .parking-3d { grid-column: 1; grid-row: auto; margin-top: 8px; }
  .p3d-label { font-size: .68rem; padding: 3px 7px; }
  .p3d-label.is-place, .p3d-label.is-minor { display: none; }
  .tour { grid-template-columns: 1fr; gap: 0; }
  .tour-frame { order: -1; top: var(--header-h); z-index: 2; height: auto; aspect-ratio: 3 / 2; margin: 0 calc(-1 * var(--gutter)); border-radius: 0; }
  .tour-steps { padding: 4vh 0 10vh; }
  .tour-step { min-height: 40vh; }
  .header-tel { display: none; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; margin-left: auto; min-height: 44px; padding: 0 4px;
    background: none; border: 0; color: inherit; font: 600 .95rem var(--sans); cursor: pointer;
  }
  .menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; transition: transform .2s; }
  .menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
  .menu-btn span::before { top: -6px; }
  .menu-btn span::after { top: 6px; }
  .open .menu-btn span { background: transparent; }
  .open .menu-btn span::before { transform: translateY(6px) rotate(45deg); }
  .open .menu-btn span::after { transform: translateY(-6px) rotate(-45deg); }
  .gnb {
    position: absolute; top: var(--header-h); left: 0; right: 0; display: none; flex-direction: column; gap: 0;
    padding: 8px var(--gutter) 20px; background: var(--paper); box-shadow: 0 8px 16px rgba(20, 30, 26, .08);
  }
  .open .gnb { display: flex; }
  .gnb a { padding: 14px 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1.05rem; }
  .gnb { max-height: calc(100svh - var(--header-h)); overflow-y: auto; }
  .gnb-group > a { display: block; padding-bottom: 6px; border-bottom: 0; }
  .sub { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; min-width: 0; padding: 4px 0 10px 12px; transform: none; background: none; box-shadow: none; border-bottom: 1px solid var(--line); border-radius: 0; }
  .sub::before { display: none; }
  .sub a { padding: 8px 0; border-bottom: 0; font-size: .93rem; color: var(--ink-soft); white-space: normal; }

  .about, .departments, .visit, .info, .page-hero.has-art { grid-template-columns: 1fr; }
  .info-call, .info-hours, .cal { grid-column: auto; grid-row: auto; }
  .page-art { height: 240px; }
  .page-art .seal { height: 36px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .about-photo { order: -1; }
  body { padding-bottom: 64px; }
  .quick {
    top: auto; bottom: 0; left: 0; right: 0; transform: none; flex-direction: row;
    border-radius: 0; background: var(--pine); box-shadow: 0 -2px 12px rgba(20, 30, 26, .2);
  }
  .quick a { flex: 1; justify-content: center; gap: 3px; height: 64px; padding: 0; font-size: .78rem; color: #fff; }  /* 4칸이라 아이콘 위·글자 아래 */
  .quick a + a { border-top: 0; border-left: 1px solid rgba(255, 255, 255, .2); }
  .quick a:hover { color: #fff; background: var(--pine-deep); }
  .quick svg { fill: #fff; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  .logo-calli { width: 84px; height: 23px; }
  .seal { height: 28px; }
  .clinic-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .clinic-card { aspect-ratio: 1 / 1.25; padding: 16px; }
  .clinic-art { margin: 0 0 8px; }
  .dept-list { grid-template-columns: 1fr; }
  .page-body .diagram { margin: 0 calc(-1 * var(--gutter)); padding: 12px 10px 14px; border-width: 1px 0; border-radius: 0; }
  .panel { padding: 26px 18px; }
  .panel .diagram { margin: 24px -18px 0; padding: 12px 10px 14px; border-width: 1px 0; border-radius: 0; }
  .site-footer { grid-template-columns: 1fr; }
  .cal { padding: 20px 14px; }
  .cal-grid td { height: 54px; padding: 4px 0; border-radius: 8px; }
  .cal-grid .d { width: 28px; height: 28px; font-size: .88rem; }
  .cal-grid small { font-size: .6rem; letter-spacing: -.06em; }
  .cal-title select { padding-left: 4px; font-size: 1.15rem; }
  .cal-back { padding: 0 10px; }
  .cal-nav { width: 36px; height: 36px; }
}
