/* fixes.css - loaded after v16's 13 stylesheets. Each rule fixes one visible defect from the 11-28 diagnostics
   (reports/2026-11-28-site-diagnostics.md) with the smallest change. v16's colours, fonts, sizes and spacing are
   otherwise untouched; nothing else belongs in this file. */

/* P1: the contents list was sticky inside the sticky side box and slid over "예약·진료 문의" and the phone button.
   Keep only the side box sticky (as v16 intends); the list scrolls with it. */
body.ds-v2 .side .article-toc{position:static}

/* P2: the phone bottom bar now has three links (오시는 길 · 네이버 예약 · 전화 문의). */
@media(max-width:900px){body.ds-v2 .floating-actions{grid-template-columns:1fr 1fr 1fr}}

/* P4: paper pages broke Korean words mid-word on phones (research-patient-v11.css set word-break:normal). */
body.ds-v2 .r11-section p{word-break:keep-all;overflow-wrap:break-word}

/* P5: fees and hours tables were cut on phones. Below 640 px each row becomes a short stacked block;
   the labels come from the column headings (data-col). */
@media(max-width:640px){
  body.ds-v2 .table-scroll.table-stack{overflow:visible}
  body.ds-v2 .table-stack .data-table{min-width:0}
  body.ds-v2 .table-stack .data-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  body.ds-v2 .table-stack .data-table tr{display:block;border:1px solid var(--ds-line,#dde6ea);border-radius:12px;margin:0 0 8px;padding:8px 0;background:#fff}
  body.ds-v2 .table-stack .data-table tbody th,body.ds-v2 .table-stack .data-table td{display:block;border:0;padding:2px 14px}
  body.ds-v2 .table-stack .data-table td[data-col]::before{content:attr(data-col) " · ";color:#557181}
}

/* P7: the footer's bottom line ran together on phones ("All rights reserved.맨 위로"). Stack it. */
@media(max-width:900px){body.ds-v2 .footer-bottom .top-link{display:flex;margin-top:10px}}

/* N2: on the 404 page the "홈으로 이동" button touched the paragraph above it. */
body.ds-v2[data-page-section="404.html"] .page-banner p + .btn{margin-top:24px}

/* N3: on phones the four shortcut cards sat 12 px from the screen edge while the rest of the page uses 20 px. */
@media(max-width:640px){body.ds-v2 .quick-grid{padding:0 20px}}

/* N4 (owner 11-30): the four shortcut cards sat flush against the hero above and the line below, with no space
   top or bottom. Give the block the same breathing room as the rest of the page. */
body.ds-v2 .quick-links{padding-block:32px;background:#fff}
@media(max-width:640px){body.ds-v2 .quick-links{padding-block:20px}}

/* N5 (owner 12-02): the four shortcut cards are separate rounded cards but touched each other with no gap. */
body.ds-v2 .quick-grid{gap:16px}
@media(max-width:640px){body.ds-v2 .quick-grid{gap:12px}}
/* With the gap each card stands alone, so each needs its own full outline (the old divider rules only drew a right
   edge, plus a left edge on the first card and, on phones, bottom edges on the top row). */
body.ds-v2 .quick-grid>.quick-link{border-width:1px;border-style:solid}

/* Design pass (12-02): faults found by shooting every page at 1440, 1024 and 390 px and comparing sibling styles. */

/* N6: in the four shortcut cards the titles sat at different heights, because a card whose second line wraps
   ("실시간 영상으로 약침·침도 시술") is centred with two lines and the others with one. Reserve two lines for the
   small line in every card so all four titles line up. */
body.ds-v2 .quick-link small{display:block;min-height:3.2em}

/* N7: "진료를 한눈에" has six facts in a four-column grid, leaving two empty slots in the second row on desktop and
   tablet. Three columns give two full rows. */
@media(min-width:641px){body.ds-v2 .guide-home-facts{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* N8: the home FAQ list kept the old divider line on top (site.css), which now touches the first rounded card. */
body.ds-v2 .faq-list{border-top:0}

/* N9: FAQ boxes on condition, treatment and herbal pages are cards (clinic-premium.css) but a later divider-style rule
   (editorial-v13.css) set their side padding to 0, so the ▶ marker and the question touched the card's left edge and
   the question sat high in the box. Same inner spacing as the home FAQ cards. */
body.ds-v2 .patient-faq details{padding:0 21px}
body.ds-v2 .patient-faq summary{padding-block:16px}
body.ds-v2 .patient-faq details p{margin:0 0 18px}
/* ...and the line under the last FAQ card sat 10 px below it. */
body.ds-v2 .patient-faq + .topic-provider{margin-top:22px}

/* N10: the side box on article pages had 48 px of space above "이 페이지 목차" but 28 px below the phone button:
   the contents list kept site.css's 20 px top padding, which belonged to a top border that is no longer drawn. */
body.ds-v2 .side .article-toc{padding-top:0}

/* N11: on the fees and hours tables the rounded scroll box (16 px corners) clipped the last row's outer borders, so
   the table's bottom corners looked cut off. Keep the corners square where the table is shown as a table. */
@media(min-width:641px){body.ds-v2 .table-scroll{border-radius:0}}

/* N12: small headings inside article text (오시는 길 "지하철로 오실 때", 공진단, 침도, 체중관리) had no space above
   and 19 px below, so each sat closer to the paragraph before it than to its own. More space above, less below. */
body.ds-v2 .article-section > h3:not(:first-child):not(h2 + h3){margin-top:30px}
body.ds-v2 .article-section > h3{margin-bottom:10px}

/* N13: on paper cards (연구·논문) the journal name sat 11 px lower than "논문 요약 읽기", because the row aligned
   to the bottom and the link is 44 px tall for tapping. Centre the row. */
body.ds-v2 .r11-index-bottom{align-items:center}

/* N14: search results. Each result is a rounded card (design-system.css) but kept site.css's divider padding
   (25 px top/bottom, 0 at the sides), so text touched the card's left edge; the link inside was also drawn as a second,
   inline card, which showed as a stray line at the bottom left; cards touched each other; the titles took the page's
   35 px h2 size; and the search column started 35 px right of the page's left edge. */
body.ds-v2 .page-search{max-width:none}
body.ds-v2 .search-results{display:grid}
body.ds-v2 .search-result{padding:22px 26px}
body.ds-v2 .search-results .search-result > a{display:block;border:0;border-radius:0;background:none}
body.ds-v2 .search-result h2{font-size:1.23rem;line-height:1.45;letter-spacing:-.01em}

/* N15: tap targets under 44 px on phones: the footer menu links (35 px), "맨 위로" (17 px), the breadcrumb links
   (22 px) and the header logo (41 px). Footer links get 44 px rows; the others get a larger tap area without moving
   anything (padding offset by the same negative margin). */
@media(max-width:900px){
  body.ds-v2 .footer-nav a{padding-block:11.5px}
  body.ds-v2 .footer-bottom .top-link{padding-block:14px;margin-top:-4px;margin-bottom:-14px}
  body.ds-v2 .breadcrumbs a{padding-block:11px;margin-block:-11px}
  body.ds-v2 .site-header a.logo{padding-block:2px;margin-block:-2px}
}

/* N16: with three links in the phone bottom bar (P2), "전화 문의 02-2299-8833" broke inside the number
   ("02-" / "2299-8833"). The phone link takes the width it needs on one line; the other two share the rest. */
@media(max-width:900px){
  body.ds-v2 .floating-actions{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto}
  body.ds-v2 .floating-actions a:last-child{white-space:nowrap;padding-inline:16px}
}

/* N17: headings and short card lines wrapped with one word left alone on the last line (phone: "실시간 초음파 유도
   약침·" / "침도치료"; cards: "목 통증·어깨 결림·팔" / "저림"). Let the browser even out the lines; no words change.
   The hero keeps v16's own wrapping. */
body.ds-v2 main section:not(.hero) h2{text-wrap:balance}
body.ds-v2 .region-grid p,body.ds-v2 .quick-link small,body.ds-v2 .card p,body.ds-v2 .process-grid p,body.ds-v2 .guide-home-facts dd{text-wrap:pretty}

/* Design items (12-02, owner review after lunch): each block below is one design item from the 12-02 design pass
   (design-pass-2026-12-02). Delete a block to undo that item; nothing else depends on it. */

/* N18 (design item 1): one section-label style everywhere. v16 labels its sections five ways: the thin line + blue
   capitals (.eyebrow, the most common: 137 uses), a beige pill and a mint pill (.section-number, home), plain blue
   capitals (.guide-kicker: "CLINIC AT A GLANCE", "FIELDS") and plain dark capitals in the 진료 예약·문의 band. All
   now take the .eyebrow look: same size, weight, letter spacing, colour and the short green line in front. Same text.
   On the two dark-green home bands and the dark guide blocks the capitals keep v16's light mint (#9de1d2) so they
   stay readable. The /detail/ page's top banner (dark, hero-like) is left as v16 has it. */
body.ds-v2 main .section-number,
body.ds-v2 main .home-ultrasound-story .story-feature .section-number,
body.ds-v2 main .research-home .section-number,
body.ds-v2 main .visit-strip .section-number,
body.ds-v2 main .guide-section .guide-kicker,
body.ds-v2 main .guide-home-heading .guide-kicker,
body.ds-v2.clinic-guide-page main .guide-dark .guide-kicker,
body.ds-v2 main .consultation-rail .consultation-rail-inner > div > span:first-child{
  display:block;padding:0;background:none;border-radius:0;
  font-family:inherit;font-size:.76rem;font-weight:800;letter-spacing:.115em;line-height:1.8;text-transform:uppercase;color:#096f90}
body.ds-v2 main .section-number::before,
body.ds-v2 main .guide-section .guide-kicker::before,
body.ds-v2 main .guide-home-heading .guide-kicker::before,
body.ds-v2.clinic-guide-page main .guide-dark .guide-kicker::before,
body.ds-v2 main .consultation-rail .consultation-rail-inner > div > span:first-child::before{
  content:"";display:inline-block;width:22px;height:2px;border-radius:5px;background:#69c7a0;vertical-align:middle;margin-right:10px}
body.ds-v2 main .research-home .section-number,
body.ds-v2 main .visit-strip .section-number,
body.ds-v2.clinic-guide-page main .guide-dark .guide-kicker{color:#9de1d2}

/* N19 (design item 2): one style for "see all" links on the home page. Most section links on the site (33) are the
   underlined text link (.text-link, e.g. "오시는 길 보기 ↗"); two home links were pill buttons instead: "진료 안내 한눈에
   보기 ↗" beside 진료를 한눈에 and "전체 진료 질환 보기 ↗" under the body-area cards. Both now look like the text links,
   left-aligned like the others. (The two "…알아보기 ↗" buttons in the 약침/침도 stories stay buttons: they open one
   treatment page, not a list.) */
body.ds-v2 .directory-action{text-align:left}
body.ds-v2 .guide-home-heading > .btn,
body.ds-v2 .directory-action > .btn{
  display:inline-block;min-height:0;padding:0 0 5px;gap:0;border:0;border-bottom:1px solid #859a8d;border-radius:0;
  background:none;box-shadow:none;transform:none;color:#203c55;
  font-size:.95rem;font-weight:750;line-height:1.8;letter-spacing:-.24px;white-space:nowrap}
body.ds-v2 .guide-home-heading > .btn:hover,
body.ds-v2 .directory-action > .btn:hover{background:none;box-shadow:none;transform:none}
body.ds-v2 .guide-home-heading > .btn{align-self:flex-end}
/* ...on phones they keep a 44 px tap area (they were 46 px buttons): extra space above the text, taken back by the
   margin, so nothing moves. */
@media(max-width:600px){
  body.ds-v2 .guide-home-heading > .btn{padding-top:11px;margin-top:7px}
  body.ds-v2 .directory-action > .btn{padding-top:11px;margin-top:-11px}
}

/* N20 (design item 5): the 진료과목 and 진료 과정 cards on the home page had a rounded top-right corner under a straight
   green top line, so the line curled down at the right. Both top corners are now square (bottom corners as before).
   Phones keep v16's own shape (line on the left). */
@media(min-width:641px){body.ds-v2 .clinical-process .process-grid>div{border-radius:0 0 16px 16px}}

/* N21 (design item 7): lines broke inside "A·B" pairs ("힘줄·" / "인대"), leaving a line that ends or starts with "·".
   The build wraps each such pair in <wj-nb> (build.py keep_dot_pairs, everywhere except the hero), and the pair stays
   on one line. Long pairs and chains (over 10 characters, e.g. "경추성두통·긴장성두통") are kept in pieces that end
   with "·", so they still fit a phone and no line starts with "·". A spaced separator ("2026 · 14권") stays with
   the word before it the same way. A text run with other words beside the pair is
   held in one plain <wj-run>, so menu links and buttons, which lay out their children side by side, keep their
   spaces. Own tag names instead of span, so none of v16's span rules (tag pills, card labels) apply to them.
   No visible text changes. */
body.ds-v2 wj-nb{white-space:nowrap}
/* ...on phones the two body-area card columns used "1fr 1fr" (v16's wider breakpoints use minmax(0,1fr)), so a pair
   kept on one line could widen one column (163 vs 177 px). Same equal columns as at the other widths. */
@media(max-width:460px){body.ds-v2 .region-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* N22 (design item 9) is gone with the block it spaced: the old-site 치료사례 cards on 연구·논문 are off the draft
   (owner 12-02 05:50). */

/* N23 (owner 12-02): 진료과목 merged into "불편한 부위를 선택하세요". The five that aren't body areas sit in a second
   row under the body-area grid, same cards, shorter: 5 across on desktop, 3 + 2 on tablets, one list on phones. */
body.ds-v2 main .region-extra{margin-top:44px}
body.ds-v2 main .region-extra-title{font-size:1.15rem;font-weight:800;letter-spacing:-.02em;margin:0 0 14px}
body.ds-v2 main .region-grid-extra{grid-template-columns:repeat(5,minmax(0,1fr))}
body.ds-v2 main .region-grid-extra .card{min-height:0}
@media(max-width:1120px){body.ds-v2 main .region-grid-extra{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:750px){body.ds-v2 main .region-grid-extra{grid-template-columns:1fr}
 body.ds-v2 main .region-grid-extra .card p{margin-bottom:10px}}

/* N24 (link check 12-02): the home 원인·목적별 진료 cards now open their own line in /detail/'s 진료과목 list
   (#field-03 …). Each line stops below the sticky header and the page's sticky contents bar, as v16's own sections do
   (same 175 px / 150 px on phones as .guide-section). */
body.ds-v2.clinic-guide-page #guide-fields li[id]{scroll-margin-top:175px}
@media(max-width:600px){body.ds-v2.clinic-guide-page #guide-fields li[id]{scroll-margin-top:150px}}

/* N25 (owner 12-02 05:50): the live procedure photo left the home "왕진삼한의원 둘러보기" gallery, so its 8 photos left a
   hole at the end of v16's 3-column desktop grid (3 + 3 + 2). The last photo, when it is alone with one other in the
   last row, spans the two narrow columns, cropped to the row's height (16:9 matches the 4:3 wide column). Phones keep
   v16's 2-column grid (4 full rows). */
@media(min-width:821px){
 #clinic-tour .brand-gallery-grid > figure:last-child:nth-child(3n+2){grid-column:2/span 2}
 #clinic-tour .brand-gallery-grid > figure:last-child:nth-child(3n+2) img{aspect-ratio:16/9;object-fit:cover}}
/* N25, second gallery: "진료·학술 활동" kept v16's 3 photos plus the lecture photo (4) after the two live procedure photos
   left. Its last photo, alone in the last row, takes the whole row: on desktop (3 columns) and on phones, where v16's
   first photo spans both columns (1 + 2 + 1). */
@media(min-width:821px){
 .brand-clinic-gallery:not(#clinic-tour) .brand-gallery-grid > figure:last-child:nth-child(3n+1){grid-column:1/-1}
 .brand-clinic-gallery:not(#clinic-tour) .brand-gallery-grid > figure:last-child:nth-child(3n+1) img{aspect-ratio:21/9;object-fit:cover}}
@media(max-width:820px){
 .brand-clinic-gallery:not(#clinic-tour) .brand-gallery-grid > figure:last-child:nth-child(even){grid-column:1/-1}
 .brand-clinic-gallery:not(#clinic-tour) .brand-gallery-grid > figure:last-child:nth-child(even) img{aspect-ratio:16/9;object-fit:cover}}

/* P12: the 학술 발표 현장 grid on 원장 소개 has an odd number of photos (owner 12-02 added the doctor's 학술대회 photos);
   the wide hall photo spans both columns so no photo sits alone at half width. */
body.director-v13 .v12-academic-grid .academic-wide{grid-column:1/-1}
/* P15: the same gallery mixed tall, square and wide photos at natural height, so rows ran ragged with big gaps (owner
   12-03 "the layout is all off"). Every tile now has the same 4:3 frame (photo cropped from the upper middle, where the
   faces are); the wide hall photo spans both columns at 2:1. */
body.director-v13 .v12-academic-grid{align-items:start}
body.director-v13 .v12-academic-grid > figure{margin:0;aspect-ratio:4/3;overflow:hidden;position:relative;padding:0}
body.director-v13 .v12-academic-grid > figure img{position:absolute;inset:0;width:100%!important;height:100%!important;max-height:none!important;aspect-ratio:auto!important;object-fit:cover!important;object-position:50% 30%!important}
body.director-v13 .v12-academic-grid > figure.academic-wide{aspect-ratio:2/1}

/* P13: the two links under the last home FAQ (owner 12-03) sat touching each other. */
.faq-links{display:flex;flex-wrap:wrap;gap:8px 22px}

/* P14: the side contents box (owner 12-03): item dividers curved up at both ends (10px rounded corners on a bottom
   border), "이 페이지 목차" was spaced very wide, and the current item was a rounded green block that clashed with the
   dividers. Now: straight full-width dividers, normal letter spacing, a thin bar on the left of the current item. */
body.ds-v2 .side .article-toc a{border-radius:0;border-bottom:1px solid var(--ds-line);padding-left:14px}
body.ds-v2 .side .article-toc a:last-of-type{border-bottom:0}
body.ds-v2 .side .article-toc a:hover{background:#F4F8F3}
body.ds-v2 .side .article-toc a[aria-current="location"]{background:transparent;box-shadow:inset 3px 0 0 var(--ds-forest-strong);color:var(--ds-forest-strong);font-weight:700}
body.ds-v2 .side .article-toc .eyebrow{letter-spacing:.02em}

/* P16: the RMSK certificate under the 원장 profile was cropped at both sides (the grid's photo frame cuts to fill);
   a certificate must show whole, so it keeps its own shape at a readable size. */
body.director-v13 .cert-photo{max-width:440px;aspect-ratio:auto!important;background:none}
body.director-v13 .cert-photo img{width:100%!important;height:auto!important;aspect-ratio:auto!important;object-fit:contain!important;max-height:none!important}
body.director-v13 .brand-academic-grid:has(> .cert-photo){display:block;margin-top:24px}

/* P17: paper pages without the left contents box (owner 12-03): one column, kept to a readable line length. */
.r11-layout{grid-template-columns:minmax(0,1fr)!important}
.r11-layout > .r11-article{max-width:820px}

/* P18: 진료 안내 '진료를 한눈에' (owner 12-03): 8 facts in v16's 3-column grid left an empty cell, so the 대표전화 box ran
   into it and looked taller. Desktop: 2 even rows of 4; 821–1050 px: 4 even rows of 2 (4 columns would wrap the
   treatment names); phones keep v16's 2 / 1 column. */
@media(min-width:1051px){
 body.ds-v2.clinic-guide-page .guide-fact-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 body.ds-v2.clinic-guide-page .guide-fact-grid>div{padding:25px 24px}
 body.ds-v2.clinic-guide-page .guide-fact-grid>div:nth-child(3n){border-right:1px solid var(--guide-line)}
 body.ds-v2.clinic-guide-page .guide-fact-grid>div:nth-child(4n){border-right:0}
 body.ds-v2.clinic-guide-page .guide-fact-grid>div:nth-last-child(-n+3){border-bottom:1px solid var(--guide-line)}
 body.ds-v2.clinic-guide-page .guide-fact-grid>div:nth-last-child(-n+4){border-bottom:0}
}
@media(min-width:821px) and (max-width:1050px){
 body.ds-v2.clinic-guide-page .guide-fact-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.ds-v2.clinic-guide-page .guide-fact-grid>div:nth-child(3n){border-right:1px solid var(--guide-line)}
 body.ds-v2.clinic-guide-page .guide-fact-grid>div:nth-child(2n){border-right:0}
 body.ds-v2.clinic-guide-page .guide-fact-grid>div:nth-last-child(-n+3){border-bottom:1px solid var(--guide-line)}
 body.ds-v2.clinic-guide-page .guide-fact-grid>div:nth-last-child(-n+2){border-bottom:0}
}

/* P19: 진료 안내 top bar (owner 12-03): current section marked like the side box (bold, green, thin line), here under
   the item since the bar runs sideways. */
body.ds-v2.clinic-guide-page .guide-toc a{border-radius:0}
body.ds-v2.clinic-guide-page .guide-toc a[aria-current="location"]{color:var(--ds-forest-strong);font-weight:700;box-shadow:inset 0 -3px 0 var(--ds-forest-strong);background:transparent}

/* P20: condition and treatment pages (owner 12-03): the button row under the title listed the same sections as the
   side box. From 901 px the side box sits beside the text, so the row is hidden there; phones and narrow tablets
   keep it (the side box drops halfway down the page). */
@media(min-width:901px){
 body:has(.article-toc) .topic-nav{display:none}
}

/* P21: 진료 안내 진료과목 list (owner 12-03): 8 items in 3 columns ended 3-3-2; desktop shows 2 even rows of 4. */
@media(min-width:1051px){
 body.ds-v2.clinic-guide-page #guide-fields .guide-process{grid-template-columns:repeat(4,minmax(0,1fr));gap:28px 24px}
}

/* P22: 체중관리 (owner 12-03): with the knee chart gone, the disc chart stands alone; shown whole (not cropped to a
   photo frame) at a readable size. */
body.ds-v2 .article .chart-photo{max-width:560px;margin:24px 0}
body.ds-v2 .article .chart-photo img{width:100%;height:auto;aspect-ratio:auto;object-fit:contain}
