/* language 16 병원 질환백과 — copied from docs/proto/v05/16-medical-encyclopedia/styles.css (AMC box grammar + Mayo title band).
   Mockup-only parts (disease figure, purpose panel, hospital cards) left out; static-guide additions at the end. Tokens: tokens.json */
:root {
  --bg: #FFFFFF; --ink: #111111; --body: #444444; --muted: #666666;
  --line: #DDDDDD; --box-line: #CDCDCD; --rule-strong: #969696; --surface: #F5F5F5;
  --teal: #0E787C; --teal-ink: #0B5F63; --teal-tint: #E8F3F3;
  --band: #0A4F53; --band-line: rgba(255,255,255,.18); --band-pill: rgba(255,255,255,.10);
  --util: #333333; --tab-active: #666666; --footer: #5E646A; --focus: #F2B705;
  --sans: "Noto Sans KR", system-ui, sans-serif; --serif: "Noto Serif KR", serif;
  --container: 1200px; --rail: 260px; --gap: 40px; --read: 760px;
  --body-lg: 20px; --body-lh: 1.7;
}
html.big { --body-lg: 23px; --body-lh: 1.65; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--body); font: 400 18px/1.6 var(--sans); word-break: keep-all; overflow-wrap: break-word; }
[id] { scroll-margin-top: 24px; }
a { color: inherit; }
img, svg { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: #fff; padding: 12px; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
@media (min-width: 1240px) { .wrap { padding: 0; } }

/* ---------- util bar (AMC top bar → medical notice line) */
.util { background: var(--util); color: #fff; font-size: 14px; }
.util .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.util p { margin: 0; padding: 10px 0; line-height: 1.5; }
.util a { display: inline-flex; align-items: center; min-height: 44px; color: #fff; text-underline-offset: 3px; white-space: nowrap; }

/* ---------- GNB (AMC 88px row) */
.gnb { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 2px 4px rgba(0,0,0,.06); position: relative; z-index: 5; }
.gnb .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 88px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; min-width: 0; }
.brand .mark { flex: none; }
.brand svg { width: 34px; height: 34px; }
.brand b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.brand small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.nav { display: flex; gap: 8px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; font-size: 19px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--teal); }
.nav a:hover { color: var(--teal); }
.menu-btn { display: none; flex: none; min-width: 44px; min-height: 44px; border: 1px solid var(--box-line); background: #fff; font: 500 15px var(--sans); color: var(--ink); padding: 0 12px; cursor: pointer; }

/* ---------- title band (Mayo: colour band + serif title + pill tabs) */
.band { background: var(--band); color: #fff; }
.band .top { padding-top: 28px; padding-bottom: 32px; }
.crumb { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #fff; font-size: 16px; text-decoration: none; }
.crumb svg { width: 14px; height: 14px; }
.crumb:hover { text-decoration: underline; text-underline-offset: 3px; }
.band h1 { margin: 10px 0 0; font: 700 48px/1.16 var(--serif); letter-spacing: -.01em; color: #fff; max-width: 920px; }
.band .sub { margin: 14px 0 0; font-size: 18px; line-height: 1.6; max-width: 760px; color: rgba(255,255,255,.88); }
.band .tabs { border-top: 1px solid var(--band-line); }
.pills { display: flex; gap: 8px; padding: 24px 0; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills a { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 24px; background: var(--band-pill); color: #fff; font-size: 16px; text-decoration: none; transition: background .2s ease; white-space: nowrap; }
.pills a:hover { background: rgba(255,255,255,.2); }
.pills a[aria-current="page"], .pills a[aria-current="true"] { background: #fff; color: var(--ink); font-weight: 500; }
.pills a .n { font-size: 14px; opacity: .8; }

/* ---------- page grid (AMC main + right rail) */
.page { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail); gap: var(--gap); padding-top: 40px; padding-bottom: 86px; }
.main { min-width: 0; }
.rail { min-width: 0; }

/* topic head box (AMC disease head box, label-value rows, no figure) */
.headbox { border: 1px solid var(--box-line); padding: 24px 28px 18px; margin: 0 0 32px; }
.headbox h2 { margin: 0 0 10px; font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.lv { margin: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); row-gap: 0; font-size: 16px; line-height: 1.6; }
.lv dt, .lv dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); color: var(--body); min-height: 44px; }
.lv dt { color: var(--muted); }
.lv dd a { color: var(--teal); text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0; }

/* gray tabs (AMC 질환설명 / 의료진) */
.graytabs { display: flex; border-bottom: 1px solid var(--line); margin: 0 0 40px; }
.graytabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; font-size: 18px; font-weight: 600; color: #333; text-decoration: none; position: relative; }
.graytabs a + a::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.graytabs a[aria-current="page"] { background: var(--tab-active); color: #fff; }
.graytabs a[aria-current="page"] + a::before { display: none; }

/* encyclopedia sections (AMC teal one-word heads) */
.sec { padding: 0 0 40px; margin: 0 0 40px; border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: 0; margin-bottom: 0; }
.sec h2 { margin: 0 0 14px; font-size: 24px; font-weight: 600; line-height: 1.4; color: var(--teal); }
.sec h3 { margin: 24px 0 6px; font-size: 18px; font-weight: 700; color: var(--ink); }
.sec p { margin: 0 0 14px; max-width: var(--read); font-size: 18px; line-height: 1.7; color: var(--body); }
.sec p a { color: var(--teal); text-underline-offset: 3px; }
.more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--teal); font-size: 16px; font-weight: 500; text-underline-offset: 3px; }
.more svg { width: 12px; height: 12px; }

/* entry rows (AMC list rows) */
.entries { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule-strong); max-width: var(--read); }
.entries li { border-bottom: 1px solid var(--line); padding: 14px 0 18px; }
.entries li[hidden] { display: none; }
.entries .t { display: block; padding: 9px 0; font-size: 20px; font-weight: 600; line-height: 1.5; color: var(--ink); text-decoration: none; }
.entries .t:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.entries p { margin: 0 0 6px; font-size: 17px; line-height: 1.7; color: var(--body); }
.entries p.meta { font-size: 14px; color: var(--muted); margin: 0; }

/* featured box (AMC square box) */
.featured { border: 1px solid var(--box-line); padding: 24px 28px; }
.featured .k { margin: 0; font-size: 14px; font-weight: 600; color: var(--teal-ink); }
.featured a.t { display: inline-flex; min-height: 44px; align-items: center; padding: 4px 0; font-size: 22px; font-weight: 700; line-height: 1.45; color: var(--ink); text-underline-offset: 4px; }
.featured .sum { margin: 6px 0 8px; font-size: 17px; line-height: 1.7; max-width: var(--read); }
.featured .meta { margin: 0; font-size: 14px; color: var(--muted); }

/* question / related list */
.qlist { list-style: none; padding: 0; margin: 0; max-width: var(--read); border-top: 2px solid var(--rule-strong); }
.qlist li { border-bottom: 1px solid var(--line); }
.qlist a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 0; font-size: 18px; line-height: 1.5; color: var(--ink); text-decoration: none; }
.qlist a small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.qlist a:hover > span { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.qlist svg { width: 12px; height: 12px; flex: none; color: var(--muted); }

/* ---------- rail */
.railbox { border-top: 2px solid var(--rule-strong); margin-bottom: 28px; }
.railbox h2 { margin: 0; background: var(--surface); font-size: 18px; font-weight: 600; color: var(--ink); padding: 8px 0 10px 15px; }
.toc { list-style: none; margin: 0; padding: 6px 15px 10px; border: 1px solid var(--line); border-top: 0; }
.toc a { display: flex; align-items: center; min-height: 44px; padding: 6px 0; font-size: 15px; line-height: 1.5; color: var(--teal); text-underline-offset: 3px; }
.facts { margin: 0; padding: 12px 15px 4px; border: 1px solid var(--line); border-top: 0; border-bottom: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; line-height: 1.6; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); font-weight: 500; }
.facts-note { margin: 0; padding: 8px 15px 14px; border: 1px solid var(--line); border-top: 0; font-size: 14px; line-height: 1.6; color: var(--body); }
.disclose { font-size: 14px; line-height: 1.7; color: #333; padding: 4px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.disclose p { margin: 0 0 14px; }
.disclose h2 { font-size: 15px; font-weight: 700; color: #333; margin: 0 0 4px; }
.policy { display: flex; flex-wrap: wrap; align-items: center; }
.policy a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: #333; text-underline-offset: 3px; position: relative; }
.policy a:first-child { padding-left: 0; }
.policy a + a::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: #333; }
.railmeta { font-size: 14px; color: var(--muted); line-height: 1.7; }
.railmeta b { color: var(--ink); font-weight: 500; }

/* ---------- bottom strip + footer (AMC) */
.strip { background: var(--teal-tint); }
.strip .wrap { padding-top: 22px; padding-bottom: 22px; }
.strip p { margin: 0; font-size: 16px; color: #333; }
.strip p strong, .strip p b { color: var(--teal-ink); }
.foot { background: var(--footer); color: #fff; font-size: 14px; }
.foot .wrap { padding-top: 36px; padding-bottom: 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 40px; }
.foot b { font-size: 18px; }
.foot p { margin: 8px 0 0; line-height: 1.7; color: rgba(255,255,255,.9); max-width: 680px; }
.foot p a { color: #fff; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 20px; align-content: start; }
.foot nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: #fff; text-underline-offset: 3px; }

/* ---------- list page */
.listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--rule-strong); padding-bottom: 14px; margin-bottom: 30px; }
.listhead h2 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.listhead p { margin: 0; font-size: 15px; color: var(--muted); }
.group > h2 { margin: 40px 0 4px; font-size: 24px; font-weight: 600; color: var(--teal); }
.group .count { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.empty { font-size: 17px; color: var(--muted); }
/* no-JS category filter: /posts/#cN shows that section only */
.group { display: none; }
.group#c0 { display: block; }
.group:target { display: block; }
.lists:has(.group:target) .group#c0:not(:target) { display: none; }

/* ---------- article (Mayo serif H2 with top rule, big body type) */
.byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.byline p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.7; }
.byline p b { color: var(--ink); font-weight: 500; }
.sizebtn { display: inline-flex; gap: 1px; background: var(--box-line); border: 1px solid var(--box-line); }
.sizebtn button { min-width: 64px; min-height: 44px; border: 0; background: #fff; font: 500 15px var(--sans); color: #333; cursor: pointer; transition: background .2s ease; }
.sizebtn button[aria-pressed="true"] { background: var(--tab-active); color: #fff; }
.art h2 { margin: 48px 0 20px; padding-top: 32px; border-top: 1px solid var(--line); font: 700 32px/1.3 var(--serif); color: var(--ink); letter-spacing: -.01em; max-width: var(--read); }
.art .prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.art h3 { margin: 28px 0 10px; font-size: 22px; font-weight: 700; line-height: 1.45; color: var(--ink); max-width: var(--read); }
.art h4 { margin: 24px 0 8px; font-size: 19px; font-weight: 700; color: var(--ink); }
.prose p, .prose li { max-width: var(--read); font-size: var(--body-lg); line-height: var(--body-lh); color: var(--body); }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 26px; max-width: var(--read); }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--teal); text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose code { font-size: 16px; background: var(--surface); padding: 1px 4px; }
.cite { font-size: 14px; vertical-align: super; line-height: 0; margin-left: 2px; color: var(--teal); text-decoration: none; white-space: nowrap; }
.cite:hover { text-decoration: underline; }
/* top disclaimer (MED-N05): same size as body, grey box with full 1px frame (mockup 확인 안내 상자) */
.prose p.disclaim { background: var(--surface); border: 1px solid var(--line); padding: 16px 20px; color: #333; }
.prose p.adnote { background: var(--surface); border: 1px solid var(--line); padding: 14px 18px; font-size: 16px; line-height: 1.7; color: #333; }
.prose blockquote { margin: 0 0 18px; background: var(--teal-tint); padding: 16px 20px; max-width: var(--read); }
.prose blockquote p { margin: 0 0 8px; font-size: 17px; line-height: 1.7; }
.prose blockquote p:last-child { margin: 0; }
.prose figure.fig { margin: 8px 0 28px; max-width: var(--read); }
.prose figure.fig img { width: 100%; height: auto; border: 1px solid var(--line); }
.prose figure.fig figcaption { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 8px; }
.cover { margin: 0 0 28px; max-width: var(--read); }
.cover img { width: 100%; height: auto; }

/* comparison table — bare rows, top rule, grey head (AMC/Mayo), only the table scrolls */
.table-scroll { overflow-x: auto; border-top: 2px solid var(--rule-strong); margin: 8px 0 12px; }
table.cmp { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 16px; }
table.cmp th, table.cmp td { text-align: left; vertical-align: top; padding: 12px 16px 12px 12px; border-bottom: 1px solid var(--line); line-height: 1.6; color: var(--body); }
table.cmp thead th { font-size: 15px; font-weight: 600; color: var(--ink); background: var(--surface); }
table.cmp tbody th { font-weight: 700; color: var(--ink); }
.prose p.table-note { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0 0 28px; }

/* references — open numbered list */
.sources h2 { scroll-margin-top: 24px; }
.src-note { margin: 0 0 14px; font-size: 15px; line-height: 1.7; color: var(--muted); max-width: var(--read); }
.refs { margin: 0; padding: 0 0 0 28px; max-width: var(--read); }
.refs li { font-size: 16px; line-height: 1.6; padding: 6px 0; scroll-margin-top: 24px; }
.refs li::marker { color: var(--muted); }
.refs li:target { background: var(--teal-tint); }
.refs a { color: var(--teal); text-underline-offset: 3px; word-break: break-all; }
.refs .k, .k { color: var(--muted); }
.endline { margin: 40px 0 0; padding: 16px 20px; border: 1px solid var(--line); font-size: 15px; line-height: 1.7; color: #333; max-width: var(--read); }
.endline a { color: var(--teal); text-underline-offset: 3px; }
.more-sec h2 { font-size: 26px; }
.samplebar { background: var(--surface); border: 1px solid var(--rule-strong); font-size: 15px; line-height: 1.6; padding: 10px 14px; margin: 0 0 20px; }
.todo { background: var(--surface); padding: 0 6px; font-weight: 600; }

/* ---------- tablet */
@media (max-width: 1024px) {
  :root { --rail: 220px; --gap: 32px; }
  .nav a { padding: 0 12px; font-size: 17px; }
}
@media (max-width: 768px) {
  .page { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .rail { border-top: 1px solid var(--line); padding-top: 28px; }
  .menu-btn { display: inline-flex; align-items: center; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 20px 12px; }
  .nav.open { display: flex; }
  .gnb .wrap { min-height: 64px; gap: 12px; }
  .band h1 { font-size: 36px; }
  .foot .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  :root { --body-lg: 17px; --body-lh: 1.75; }
  html.big { --body-lg: 20px; }
  body { font-size: 16px; }
  .util { font-size: 13px; }
  .util .wrap { flex-wrap: wrap; gap: 0 12px; }
  .util p { padding: 8px 0 0; }
  .brand { gap: 8px; }
  .brand svg { width: 28px; height: 28px; }
  .brand b { font-size: 18px; }
  .band .top { padding-top: 16px; padding-bottom: 24px; }
  .band h1 { font-size: 30px; line-height: 1.25; }
  .band .sub { font-size: 16px; }
  .pills { padding-top: 16px; padding-bottom: 16px; }
  .pills a { padding: 0 18px; font-size: 15px; }
  .headbox { padding: 18px 18px 10px; }
  .lv { grid-template-columns: minmax(0, 1fr); }
  .lv dt { font-size: 14px; padding: 10px 0 0; min-height: 0; }
  .lv dd { border-top: 0; padding: 0 0 10px; font-size: 15px; }
  .lv dd a { margin: 0; }
  .graytabs a { padding: 0 12px; font-size: 16px; }
  .sec h2 { font-size: 22px; }
  .sec p { font-size: 16px; }
  .art h2 { font-size: 26px; margin-top: 40px; padding-top: 24px; }
  .art h3 { font-size: 20px; }
  .featured { padding: 18px; }
  .featured a.t { font-size: 20px; }
  .listhead { flex-direction: column; gap: 6px; }
  .listhead h2 { font-size: 26px; }
  .entries .t { font-size: 18px; }
  .entries p { font-size: 16px; }
  .qlist a { font-size: 16px; }
  .prose blockquote p { font-size: 16px; }
}
@media (max-width: 360px) {
  .wrap { padding: 0 16px; }
  .brand b { font-size: 16px; }
  .brand small { display: none; }
  .band h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
