/* 레이아웃: 왼쪽 목차 + 본문. 본문의 각 섹션은 [요약 | 법제처 원문] 두 칸.
   요약은 고딕(IBM Plex Sans KR), 원문은 명조(Noto Serif KR)로 구분해 '해설'과 '법조문'이 한눈에 갈리게 한다. */
:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --statute: #fbfaf6;
  --ink: #17202b;
  --muted: #5b6570;
  --line: #dde1e3;
  --accent: #1d4e89;
  --accent-soft: #e6eef7;
  --seal: #b4382a;
  --seal-soft: #f8e9e6;
  --ok: #2f7a4a;
  --ok-soft: #e5f2e9;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --mark: #fff1a8;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --serif: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161b; --surface: #191f26; --statute: #1c2128; --ink: #e6e9ec; --muted: #9aa4ae; --line: #2c343d;
    --accent: #7fb0e8; --accent-soft: #1d2a3a; --seal: #ef8a7c; --seal-soft: #3a2220;
    --ok: #7fcf9a; --ok-soft: #1c2f24; --warn: #e6b65c; --warn-soft: #33291a; --mark: #5a4d12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161b; --surface: #191f26; --statute: #1c2128; --ink: #e6e9ec; --muted: #9aa4ae; --line: #2c343d;
  --accent: #7fb0e8; --accent-soft: #1d2a3a; --seal: #ef8a7c; --seal-soft: #3a2220;
  --ok: #7fcf9a; --ok-soft: #1c2f24; --warn: #e6b65c; --warn-soft: #33291a; --mark: #5a4d12;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body { margin: 0; font: 15px/1.7 var(--sans); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.3; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

/* ---------- 사이드바 */
.side { border-right: 1px solid var(--line); background: var(--surface); position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; overflow-y: auto; padding: 22px 16px 28px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.brand b { font-size: 17px; letter-spacing: -0.01em; }
.brand span { font-size: 12px; color: var(--muted); }
.navs { display: flex; flex-direction: column; gap: 18px; }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navgroup h6 { margin: 0 0 4px; padding: 0 8px; font-size: 11px; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.navlink { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; }
.navlink:hover { background: var(--accent-soft); }
.navlink[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.navlink.planned { color: var(--muted); }
.navlink.sub { padding-left: 22px; font-size: 13px; color: var(--muted); }
.navlink.sub[aria-current="page"] { color: var(--accent); }
.navlink small { font-size: 11px; color: var(--muted); font-weight: 400; }
/* 우리 회사 적용 여부 */
.cotoggle { margin-top: auto; padding: 0 4px; }
.cotoggle + .sync { margin-top: 0; }
.co-toggle { font: inherit; font-size: 13px; display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; text-align: left; }
.co-toggle .sw { flex: 0 0 auto; width: 30px; height: 18px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.co-toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: left .15s; }
.co-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.co-toggle[aria-pressed="true"] .sw { background: var(--accent); }
.co-toggle[aria-pressed="true"] .sw::after { left: 14px; }
.co-badge { margin-left: 6px; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.co-badge.yes { color: var(--ok); background: var(--ok-soft); }
.co-badge.no { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.co-badge.check { color: var(--warn); background: var(--warn-soft); }
.co-box { border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 10px; padding: 10px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.co-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.co-head span { font-size: 12px; color: var(--muted); }
.co-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.co-box li { display: grid; grid-template-columns: 18px auto auto minmax(0, 1fr); gap: 6px; align-items: baseline; }
.co-box li .m { font-weight: 700; text-align: center; }
.co-box li.yes .m, .co-box li.yes .t { color: var(--ok); }
.co-box li.no .m, .co-box li.no .t { color: var(--muted); }
.co-box li.check .m, .co-box li.check .t { color: var(--warn); }
.co-box li .t { font-size: 12px; font-weight: 700; }
.co-box li .n { font-size: 12.5px; color: var(--muted); }
.co-src { font-size: 11.5px; color: var(--muted); }
th.co-col, td.co-col { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); white-space: nowrap; }
.sync { margin-top: auto; font-size: 12px; color: var(--muted); padding: 10px 8px 0; border-top: 1px solid var(--line); }
.sync .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-right: 6px; vertical-align: 1px; }
.sync .dot.ok { background: var(--ok); }

/* ---------- 본문 */
main { min-width: 0; padding-block: 32px 80px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; padding-inline: 12px; }

.head { display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; }
.head h1 { font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -0.02em; }
.lede { margin: 0; max-width: 68ch; color: var(--muted); font-size: 15.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); cursor: help; }
.chip.now { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); color: var(--accent); background: var(--accent-soft); }
.chip.soon { border-color: color-mix(in srgb, var(--seal) 40%, var(--line)); color: var(--seal); background: var(--seal-soft); }
.chip .k { font-size: 11px; opacity: 0.8; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.toc { display: flex; flex-wrap: wrap; gap: 6px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-block: 10px; border-bottom: 1px solid var(--line); }
.toc button { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.toc button:hover { border-color: var(--accent); color: var(--accent); }

.colhead { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }

section.sec { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; scroll-margin-top: 64px; }
section.sec.wide { grid-template-columns: minmax(0, 1fr); }
.sum { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sum h2 { font-size: 19px; letter-spacing: -0.01em; }
.sum h4 { font-size: 15px; margin-top: 6px; }
.sum p, .sum ul, .sum ol { margin: 0; }
.badge { font-size: 11.5px; padding: 2px 8px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.badge.verified { background: var(--ok-soft); color: var(--ok); }
.badge.check { background: var(--warn-soft); color: var(--warn); }
.note { font-size: 13px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 10px; }
.srcs { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }

ul.plain { padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { border-top: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.tbl thead th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg); }
.tbl tbody th { font-weight: 600; white-space: nowrap; }
.tbl .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl.compact td, .tbl.compact th { padding: 6px 10px; }

.formula { background: var(--accent-soft); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; }
.formula > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.f-name { font-weight: 700; color: var(--accent); min-width: 7em; }
.frac { display: inline-flex; flex-direction: column; align-items: center; text-align: center; }
.frac span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 6px 2px; }
.frac span:last-child { padding: 2px 6px 0; }

ol.timeline { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; }
ol.timeline li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 6px 0 10px 16px; position: relative; }
ol.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
ol.timeline li.soon::before { border-color: var(--seal); background: var(--seal); }
ol.timeline time { font-family: var(--mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
ol.timeline li.soon time, ol.timeline li.soon b { color: var(--seal); }

ol.flow { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0; }
ol.flow li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); position: relative; }
ol.flow li:first-child { border-top: 0; }
ol.flow .step { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 4px; text-align: center; padding: 3px 0; height: fit-content; }
ol.flow li:nth-child(4) .step, ol.flow li:nth-child(5) .step { color: var(--seal); background: var(--seal-soft); }
ol.chain { padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; margin: 0; }

/* 규범 개요 사다리 */
.ladder { display: flex; flex-direction: column; gap: 10px; }
.rung { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--surface); }
.rung[data-level="2"] { margin-left: 18px; }
.rung[data-level="3"] { margin-left: 36px; }
.rung[data-level="4"] { margin-left: 54px; }
.rung-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lv { font-family: var(--mono); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--surface); display: inline-grid; place-items: center; font-size: 13px; }
.kind { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.rung-head a.go { margin-left: auto; font-size: 12.5px; font-weight: 600; text-decoration: none; padding: 3px 10px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 999px; background: var(--accent-soft); white-space: nowrap; }
.rung-head a.go:hover { border-color: var(--accent); }
.go-date { flex-basis: 100%; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.go-date b { color: var(--seal); font-weight: 600; }
.rung dl { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 14px; }
.rung dt { color: var(--muted); font-size: 13px; }
.rung dd { margin: 0; }

/* ---------- 법제처 원문 칸 */
.statute { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.art { background: var(--statute); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.art-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.art-head .who { font-size: 12px; color: var(--muted); }
.art-head .no { font-family: var(--serif); font-weight: 700; font-size: 15px; }
.art-head a { font-size: 12px; }
.art-why { font-size: 12px; color: var(--muted); padding: 6px 14px 0; }
.art-body { font-family: var(--serif); font-size: 14px; line-height: 1.85; padding: 10px 14px 14px; white-space: pre-wrap; max-height: 340px; overflow: auto; }
.art-body mark { background: var(--mark); color: inherit; padding: 0 1px; }
.art-tabs { display: flex; gap: 4px; padding: 8px 14px 0; }
.art-tabs button { font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.art-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.art-tabs button.soon[aria-pressed="true"] { background: var(--seal); border-color: var(--seal); }
.art-tabs button.soon { color: var(--seal); }
.art.pending .art-body { font-family: var(--sans); color: var(--muted); font-size: 13px; white-space: normal; }
.art details { padding: 8px 14px 12px; }
.art summary { cursor: pointer; font-size: 13px; }
.art details .art-body { padding: 8px 0 0; max-height: 260px; }
/* 요약이 가리키는 항·호 */
.art-body .focus { display: block; margin: 4px -8px; padding: 6px 8px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; }
.art-body .focus-ho { font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.focus-tag { display: inline-block; margin-left: 4px; font-size: 11.5px; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 6px; }
.found { display: flex; flex-direction: column; gap: 4px; }
.art-body.annex { font-family: var(--mono); font-size: 12px; line-height: 1.6; white-space: pre; overflow: auto; max-height: 480px; }

/* ---------- 업데이트 / 준비중 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.card .st { font-size: 12px; font-weight: 600; }
.card .st.ok { color: var(--ok); } .card .st.bad { color: var(--seal); } .card .st.wait { color: var(--warn); }
.log { display: flex; flex-direction: column; gap: 8px; }
.log li { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.log { padding: 0; margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- 요약 | 원문 두 열을 따로 스크롤 (PC) */
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; height: calc(100dvh - 48px); }
.pane-left, .pane-right { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.pane-left { display: flex; flex-direction: column; gap: 28px; padding-right: 8px; padding-bottom: 40vh; }
.pane-left section.sec { grid-template-columns: minmax(0, 1fr); }
.pane-left .statute { display: none; }
/* 별표 원문 하위 페이지 */
.sublink { display: inline-block; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: 8px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.sublink:hover { border-color: var(--accent); }
.back { font-size: 13px; text-decoration: none; width: fit-content; }
.annex-doc { gap: 6px; }
.annex-h { font-family: var(--serif); font-size: 17px; margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.annex-doc > .annex-h:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.annex-h4 { font-size: 15px; margin-top: 10px; }
.annex-p { margin: 0; font-size: 14.5px; line-height: 1.75; }
.annex-table { overflow-x: auto; background: var(--statute); border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.annex-table pre { margin: 0; padding: 12px 14px; font-family: "Nanum Gothic Coding", var(--mono); font-size: 13.5px; line-height: 1.45; white-space: pre; width: max-content; }
.annex-table mark, .annex-p mark { background: var(--mark); color: inherit; }
.formula-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.formula-img { max-width: 100%; height: auto; background: #fff; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); }
.formula-img.inline { vertical-align: middle; margin: 4px 0; }
.annex-note { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }

/* 한눈에 보기 · 개편동향 카드 · 상태 꼬리표 */
.keycard { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.k-eyebrow { font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: 0.04em; }
.k-formula { font-size: 17px; font-weight: 700; line-height: 1.5; }
.k-formula b { color: var(--accent); }
.k-note { margin: 0; font-size: 14px; color: var(--ink); }
.k-refs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 4px; padding: 0 6px; margin-right: 6px; vertical-align: 1px; }
.tbl.kvrows tbody th { width: 9.5em; color: var(--muted); font-weight: 600; white-space: normal; }
.tbl.kvrows td .refchip, .tbl.route td .refchip { margin: 2px 2px 0 0; }
.sublink.small { font-size: 12.5px; padding: 3px 9px; }
.soon-text { color: var(--seal); }
.upd { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.upd.soon { border-left-color: var(--seal); }
.upd.review { border-left-color: var(--warn); }
.upd p { margin: 0; font-size: 14px; }
.upd-head { display: flex; align-items: center; gap: 8px; }
.upd-head time { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.pill.soon { color: var(--seal); background: var(--seal-soft); }
.pill.review { color: var(--warn); background: var(--warn-soft); }
.pill.eval { color: var(--accent); background: var(--accent-soft); }
.pill.info { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.pill.warn { color: var(--seal); background: var(--seal-soft); }
.tbl.route tbody th { width: 11em; white-space: normal; }
.tbl.route td:nth-child(2) { width: 8.5em; }

/* 최근 변경 */
.nb { font-style: normal; font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 0 5px; margin-left: 4px; white-space: nowrap; }
.nb.soon { color: var(--seal); background: var(--seal-soft); }
.nb.amend { color: var(--surface); background: var(--seal); }
.navlink > span { flex: 1 1 auto; }
.cnt { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.citem { border-top: 1px dashed var(--line); padding: 8px 0 4px; }
.citem summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.cpages { font-size: 12px; color: var(--muted); }
.diff { font-family: var(--serif); font-size: 14px; line-height: 1.85; white-space: pre-wrap; background: var(--statute); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 6px; max-height: 480px; overflow: auto; }
.diff del { color: var(--seal); background: var(--seal-soft); text-decoration: line-through; }
.diff ins { color: var(--ok); background: var(--ok-soft); text-decoration: underline; text-underline-offset: 3px; }
.dskip { color: var(--muted); font-family: var(--sans); font-size: 12px; }
.dside { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dside b { display: block; font-family: var(--sans); font-size: 12px; color: var(--muted); }
section.sum > h2 { display: flex; align-items: baseline; }

.nitem { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.ndetail { flex-basis: 100%; margin-top: 2px; }
.ndetail summary { cursor: pointer; font-size: 12.5px; color: var(--accent); }
.ngist { white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; background: var(--statute); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 6px; }
.ndoc { margin-top: 6px; }
.ndoc summary { cursor: pointer; font-size: 12.5px; color: var(--accent); }
.ngist.doc { max-height: 520px; overflow: auto; font-family: var(--serif); font-size: 13.5px; }
.nfiles { font-size: 12.5px; margin-top: 6px; }
.note-inline { font-size: 12px; color: var(--muted); }

/* 해설 */
.purpose { margin: 0; font-size: 14px; line-height: 1.7; background: var(--ok-soft); border-radius: 8px; padding: 8px 12px; }
.upd.news { border-left-color: var(--muted); }
.why-box { border-left: 4px solid var(--ok); background: var(--surface); border-radius: 0 8px 8px 0; padding: 10px 14px; max-width: 760px; }
.why-box b { font-size: 13px; color: var(--ok); }
.why-box p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.7; }

/* 규범 연결 (상위 인용·하위 위임) */
.art-body .xref { text-decoration: underline dotted var(--accent); text-underline-offset: 3px; color: var(--accent); }
.art-body .xdeleg { text-decoration: underline dashed var(--ok); text-underline-offset: 3px; }
.xlinks { border-top: 1px dashed var(--line); padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.xrow { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; align-items: start; }
.xk { color: var(--muted); font-weight: 600; padding-top: 2px; }
.xlist { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.xitem { border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 6px; background: var(--surface); }
.xitem > summary { cursor: pointer; padding: 2px 8px; color: var(--accent); list-style: none; }
.xitem > summary::-webkit-details-marker { display: none; }
.xitem[open] { flex-basis: 100%; }
.xitem.link { padding: 2px 8px; text-decoration: none; }
.xbody { max-height: 260px !important; font-size: 13px !important; padding: 6px 10px 10px !important; }
.xdel { border: 1px dashed color-mix(in srgb, var(--ok) 50%, var(--line)); color: var(--ok); border-radius: 6px; padding: 1px 8px; }

/* 근거 원문 버튼 */
.refchips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 2px; }
.refchips-k { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.refchip { font: inherit; font-size: 12.5px; padding: 3px 9px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); color: var(--accent); cursor: pointer; text-align: left; }
.refchip:hover { border-color: var(--accent); }
.refchip.on { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.refwrap { border-radius: 10px; scroll-margin-top: 64px; }
.refwrap.flash .art { animation: refflash 1.6s ease-out; }
@keyframes refflash { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .refwrap.flash .art { animation: none; box-shadow: 0 0 0 2px var(--accent); } }
.pane-right { display: flex; flex-direction: column; gap: 10px; padding-right: 4px; padding-bottom: 60vh; }
.pane-head { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 4px 0 10px; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.pane-hint { font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.rgroup { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; }
.rgroup-title { font-size: 13px; font-weight: 600; color: var(--accent); padding-top: 4px; }
.pane-right .art-body { max-height: none; }
.pane-right .art-body.annex { max-height: 520px; }
main:has(.split) { padding-block: 24px; }
.wrap:has(.split) { max-width: 1480px; }

@media (max-width: 980px) {
  .split { display: block; height: auto; }
  .pane-left { overflow: visible; padding: 0; gap: 28px; }
  .pane-left .statute { display: flex; }
  .pane-right { display: none; }
  section.sec, .colhead { grid-template-columns: minmax(0, 1fr); }
  .colhead { display: none; }
  .statute::before { content: "법제처 원문"; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); gap: 10px; }
  .navs { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 14px; overflow-x: auto; scrollbar-width: none; }
  .navs::-webkit-scrollbar { display: none; }
  .navgroup { flex: 0 0 auto; }
  .navgroup h6 { display: none; }
  .navgroup { flex-direction: row; }
  .navlink { white-space: nowrap; }
  .navlink small { display: none; }
  .sync { display: none; }
  .cotoggle { margin-top: 0; padding: 0; }
  .co-box li { grid-template-columns: 18px minmax(0, 1fr); }
  .co-box li .t, .co-box li .n { grid-column: 2; }
  .wrap { padding-inline: 0; }
  .rung[data-level] { margin-left: 0; }
  .rung dl { grid-template-columns: minmax(0, 1fr); }
  .rung-head a.go { margin-left: 0; }
  .go-date { text-align: left; }
  ol.timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sum { padding: 16px; }
}
/* 휴대폰 (갤럭시 S25 등 폭 360~430px) */
@media (max-width: 640px) {
  body { font-size: 15px; }
  main { padding-block: 16px 64px; }
  .wrap { gap: 20px; }
  .head h1 { font-size: 24px; }
  .lede { font-size: 15px; }
  /* 섹션 이동 버튼: 한 줄 가로 스크롤 */
  .toc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-block: 8px; margin-inline: -4px; padding-inline: 4px; }
  .toc::-webkit-scrollbar { display: none; }
  .toc button { white-space: nowrap; flex: 0 0 auto; }
  section.sec { gap: 12px; scroll-margin-top: 56px; }
  .sum { padding: 16px 14px; gap: 10px; border-radius: 8px; }
  .sum h2 { font-size: 18px; }
  /* 표: 한 행 = 카드 한 장, 칸마다 열 제목을 위에 작게 */
  .tbl-wrap { overflow-x: visible; }
  table.tbl, .tbl tbody, .tbl tr { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { border-top: 1px solid var(--line); padding: 10px 0; }
  .tbl tr:first-child { border-top: 0; }
  .tbl th, .tbl td { display: block; border: 0; padding: 2px 0; white-space: normal; text-align: left; }
  .tbl tbody th { font-size: 15px; margin-bottom: 2px; }
  .tbl td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
  .tbl td[data-label]:first-child::before { margin-top: 0; }
  .tbl .num { text-align: left; }
  .tbl.kv th { color: var(--accent); font-size: 13px; }
  .tbl.kvrows tbody th, .tbl.route tbody th, .tbl.route td:nth-child(2) { width: auto; }
  .k-formula { font-size: 15.5px; }
  .formula { padding: 12px; font-size: 14px; }
  .f-name { min-width: 0; width: 100%; }
  ol.flow li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  ol.flow .step { width: fit-content; padding: 2px 10px; }
  .art-body { max-height: 60vh; font-size: 14.5px; }
  .art-head { padding: 10px 12px; }
  .art-body, .art-why, .art details { padding-inline: 12px; }
  .facts dd { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
