:root {
  --ink: #1a1a2e; --muted: #5a5a72; --navy: #1a237e; --line: #d5d5e3;
  --boxred: #d32f2f; --paper: #ffffff; --wash: #f4f5fa;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Apple SD Gothic Neo", "NanumGothic", "Malgun Gothic",
    "Noto Sans KR", "Hiragino Sans", sans-serif;
  color: var(--ink); background: var(--wash); margin: 0; padding: 0;
  line-height: 1.7; font-size: 16px; word-break: keep-all;
  overflow-wrap: break-word;
}
.wrap { max-width: 1080px; margin: 0 auto; background: var(--paper);
  padding: 24px 32px 64px; box-shadow: 0 2px 18px rgba(26,35,126,.08);
  min-height: 100vh; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 4px; }
a { color: var(--navy); }

/* top public nav */
.pubnav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--navy); border-radius: 10px; padding: 10px 16px; margin-bottom: 18px;
  font-size: 14.5px; }
.pubnav a { color: #fff; text-decoration: none; font-weight: 700; }
.pubnav a:hover { text-decoration: underline; }
.pubnav .sep { color: rgba(255,255,255,.55); }
.pubnav .sp { flex: 1 1 auto; }

/* header: title + search */
.hc-head { border-bottom: 4px solid var(--navy); padding: 8px 0 20px; margin-bottom: 16px; }
.hc-head .brand { color: var(--navy); font-weight: 800; letter-spacing: .12em; font-size: 14px; }
.hc-head h1 { font-size: 30px; margin: 6px 0 4px; line-height: 1.35; }
.hc-head .sub { color: var(--muted); font-size: 14px; }
.hc-head .edition { color: var(--muted); font-size: 13px; margin-top: 4px; }
.hc-tools { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.searchbox { flex: 1 1 320px; display: flex; gap: 8px; }
.searchbox input[type="search"] {
  flex: 1 1 auto; min-width: 0; font-size: 17px; padding: 10px 14px;
  border: 2px solid var(--navy); border-radius: 8px; font-family: inherit; }
.btn { font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  border: 2px solid var(--navy); border-radius: 8px; background: var(--navy);
  color: #fff; padding: 9px 16px; white-space: nowrap; }
.btn.ghost { background: #fff; color: var(--navy); }
.btn:hover { text-decoration: underline; }
.langpick { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.langpick button { font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 6px 10px; }
.langpick button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chips .chip-label { font-size: 13.5px; color: var(--muted); font-weight: 700;
  align-self: center; margin-right: 2px; }
.chip { font-family: inherit; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 5px 13px; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }
.chip:hover { border-color: var(--navy); }
.result-meta { font-size: 14px; color: var(--muted); margin: 6px 0 12px; min-height: 1.4em; }

/* index groups: dense list */
.idx-group { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.idx-group > h2 { font-size: 16px; margin: 0; padding: 9px 14px; background: #e8eaf6;
  color: var(--navy); border: none; }
.idx-group ul { list-style: none; margin: 0; padding: 0; }
.idx-group li { border-top: 1px solid var(--line); }
.idx-group li a { display: flex; gap: 10px; padding: 8px 14px; text-decoration: none;
  color: var(--ink); font-size: 15px; align-items: baseline; }
.idx-group li a:hover { background: var(--wash); text-decoration: underline; }
.idx-group .num { color: var(--navy); font-weight: 800; font-size: 13.5px;
  min-width: 44px; flex: 0 0 auto; }
.idx-group .tags { margin-left: auto; font-size: 12px; color: var(--muted); flex: 0 0 auto; }

/* search results */
.results { list-style: none; margin: 0; padding: 0; }
.results li { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; }
.results li a { display: block; padding: 10px 14px; text-decoration: none; color: var(--ink); }
.results li a:hover { background: var(--wash); }
.results .r-title { font-weight: 800; color: var(--navy); font-size: 15.5px; }
.results .r-chapter { font-size: 12.5px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.results .r-snippet { font-size: 14px; color: var(--ink); margin-top: 4px; }
mark { background: #fff176; color: inherit; padding: 0 1px; border-radius: 2px; }
.empty { border: 1px dashed var(--line); border-radius: 10px; padding: 22px 18px;
  color: var(--muted); font-size: 15px; }
.empty strong { color: var(--ink); }

/* article layout */
.crumb { font-size: 14px; color: var(--muted); margin: 4px 0 10px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.article-layout { display: flex; gap: 24px; align-items: flex-start; }
.sidebar { flex: 0 0 250px; max-width: 250px; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 0; font-size: 14px; position: sticky; top: 12px;
  max-height: calc(100vh - 24px); overflow: auto; background: #fff; }
.sidebar h2 { font-size: 13px; margin: 4px 12px 8px; color: var(--muted); border: none; padding: 0; }
.sidebar details { border-top: 1px solid var(--line); }
.sidebar summary { cursor: pointer; padding: 7px 12px; font-weight: 700; color: var(--navy);
  font-size: 13.5px; list-style: none; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::before { content: "▸ "; color: var(--muted); }
.sidebar details[open] summary::before { content: "▾ "; }
.sidebar ul { list-style: none; margin: 0; padding: 0 0 6px; }
.sidebar li a { display: block; padding: 5px 12px 5px 22px; text-decoration: none;
  color: var(--ink); font-size: 13.5px; }
.sidebar li a:hover { background: var(--wash); text-decoration: underline; }
.sidebar li a[aria-current="page"] { background: #e8eaf6; font-weight: 800; color: var(--navy); }
.sidebar-close { display: none; }
.article { flex: 1 1 auto; min-width: 0; }
.article h2.title { font-size: 24px; color: var(--navy); border-bottom: 2px solid var(--navy);
  padding-bottom: 8px; margin: 0 0 14px; line-height: 1.4; }
.article-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px;
  border-top: 1px solid var(--line); padding-top: 14px; font-size: 14.5px; }
.article-nav .sp { flex: 1 1 auto; }
.menu-btn { display: none; }

/* article body (trusted manual content) */
.article-body h3 { font-size: 20px; margin: 30px 0 12px; line-height: 1.45; }
.article-body h4 { font-size: 17px; margin: 24px 0 10px; }
.article-body p { margin: 10px 0; }
.article-body code { font-family: "NanumGothicCoding", "D2Coding", Menlo, Consolas, monospace;
  background: #eef0f7; padding: 1px 6px; border-radius: 4px; font-size: .92em; }
.article-body ul, .article-body ol { margin: 10px 0; padding-left: 26px; }
.article-body li { margin: 4px 0; }
.article-body ul.checklist { list-style: none; padding-left: 4px; }
.article-body ul.checklist li::before { content: "☐\2009"; }
.article-body table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14.5px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 7px 10px;
  text-align: left; vertical-align: top; }
.article-body th { background: #e8eaf6; color: var(--navy); }
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 30px 0; }
.callout { border-radius: 10px; padding: 12px 16px; margin: 16px 0; font-size: 15px; }
.callout.note { background: #e8f5e9; border: 1px solid #a5d6a7; }
.callout.warn { background: #fff8e1; border: 1px solid #e0b64c; }
.callout.meta { background: var(--wash); border: 1px solid var(--line); }
.callout .tag { font-weight: 800; display: block; margin-bottom: 4px; }
.callout.note .tag { color: #1b5e20; }
.callout.warn .tag { color: #8a5a00; }
.meta-box { background: var(--wash); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; margin: 22px 0; font-size: 14px; }
.meta-box div { margin: 2px 0; }
/* figures with vector annotations */
.fig { border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  margin: 22px 0; background: #fff; }
.shot { position: relative; line-height: 0; }
.shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.fig.phone { display: flex; gap: 20px; align-items: flex-start; }
.fig.phone .shot { flex: 0 0 330px; max-width: 46%; }
.fig.phone figcaption { flex: 1 1 auto; min-width: 0; }
.ovl { position: absolute; pointer-events: none; }
.ovl.box { border: 3px solid var(--boxred); border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.85); }
.badge { position: absolute; left: -16px; top: -16px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--boxred); color: #fff; font-weight: 800;
  font-size: 16px; line-height: 30px; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.35); font-style: normal; }
.badge.right { left: auto; right: -16px; }
.ovl.red { background: #000; border-radius: 3px; line-height: 1.2; }
.ovl.red span { color: #fff; font-size: 11px; padding: 2px 6px; display: inline-block; }
.cap { font-weight: 700; margin: 10px 0 6px; font-size: 15.5px; }
.fig.phone .cap { margin-top: 0; }
.legend { margin: 6px 0; padding-left: 24px; font-size: 14.5px; }
.legend li { margin: 3px 0; }
.legend li::marker { color: var(--boxred); font-weight: 800; }
.article-body img { max-width: 100%; height: auto; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.footer { margin-top: 40px; padding-top: 16px; border-top: 2px solid var(--navy);
  color: var(--muted); font-size: 13px; }

/* small screens: no page-level horizontal overflow */
@media (max-width: 860px) {
  .article-layout { display: block; }
  .menu-btn { display: inline-block; margin: 0 0 12px; }
  .sidebar { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0;
    max-height: none; width: min(320px, 88vw); max-width: none;
    border-radius: 0; margin: 0; padding-top: 52px;
    transform: translateX(-105%); transition: transform .18s ease-out;
    box-shadow: 4px 0 24px rgba(0,0,0,.25); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
  .scrim[hidden] { display: none; }
  .sidebar-close { display: inline-block; position: absolute; top: 8px; right: 8px; }
}
@media (max-width: 700px) {
  .wrap { padding: 16px 14px 48px; }
  .hc-head h1 { font-size: 24px; }
  .pubnav { font-size: 14px; padding: 10px 12px; }
  .searchbox input[type="search"] { font-size: 16px; }
  .fig.phone { flex-direction: column; }
  .fig.phone .shot { max-width: 340px; width: 100%; }
  .article-body table { display: block; overflow-x: auto; font-size: 13px; }
  .article h2.title { font-size: 20px; }
  .idx-group .tags { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
