/* 금융결제원 센터(모의) 관리자 포털 — 흑백 위주 업무 화면(금융기관 포털과 같은 톤). 외부 폰트·CDN 없음(폐쇄망 시연 대비).
   색은 상태(정상·주의·위험)와 위험 버튼에만 쓴다. 카드 그림자·왼쪽 색 띠·알약 배지·그라데이션은 쓰지 않는다. */
:root {
  --navy: #171717;          /* 옛 이름 유지(스크립트·인라인 스타일 호환) — 이제 먹색 */
  --navy-2: #3a3a3a;
  --navy-3: #3a3a3a;
  --accent: #171717;
  --accent-soft: #f3f3f3;
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #171717;
  --ink2: #3a3a3a;
  --muted: #6b6b6b;
  --faint: #8a8a8a;
  --line: #e2e2e2;
  --line-soft: #ececec;
  --side: #f3f3f3;
  --panel: #f5f5f5;
  --ok: #1f7a3a; --ok-bg: #f3f8f4; --ok-line: #cfe3d4;
  --warn: #b45309; --warn-bg: #fdf7ec; --warn-line: #ecd5a8;
  --crit: #b42318; --crit-bg: #fdf2f1; --crit-line: #efc5bf;
  --radius: 0;
  --shadow: none;
  --side-w: 224px;
  --banner-h: 0px;   /* 맨 위 안내 줄은 쓰지 않는다(화면 이름의 "(모의)"로 표시) */
  --top-h: 48px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.55; min-width: 1100px; }
a { color: var(--ink); }
h1 { font-size: 32px; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 6px; }
h2 { font-size: 16px; letter-spacing: -.01em; margin: 0 0 10px; color: var(--ink); }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--ink); }
p { margin: 6px 0; }
small, .muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 4px; background: #fff; padding: 6px 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---- 맨 위 한 줄 + 왼쪽 메뉴 + 상단 바 ---- */
.banner { position: fixed; top: 0; left: 0; right: 0; height: var(--banner-h); z-index: 40; display: flex; align-items: center; justify-content: center; gap: 16px;
  background: var(--ink); color: #d4d4d4; font-size: 12px; }
.sidebar { position: fixed; top: var(--banner-h); bottom: 0; left: 0; width: var(--side-w); background: var(--side); color: var(--ink); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; }
.brand .mark { width: 24px; height: 24px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Crect x='1' y='1' width='11' height='24' fill='none' stroke='%23171717' stroke-width='1.6'/%3E%3Crect x='14' y='1' width='11' height='24' fill='%23171717'/%3E%3C/svg%3E") center/contain no-repeat; }
.brand strong { display: block; font-size: 14.5px; color: var(--ink); line-height: 1.3; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.sidebar nav { padding: 0 10px 16px; flex: 1; }
.navgroup { font-size: 12px; color: var(--faint); padding: 14px 10px 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; }
.sidebar nav a::before { content: ""; width: 17px; height: 17px; flex: none; background: var(--ink2); -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; }
.sidebar nav a:hover { background: #e9e9e9; }
.sidebar nav a.active { background: #dfdfdf; font-weight: 600; }
.navbadge { margin-left: auto; background: var(--crit); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 18px; text-align: center; padding: 0 5px; line-height: 18px; }
.sidebar nav a[data-k=dashboard] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=flow] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l3-7 4 14 3-7h4'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=institutions] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V9l7-5 7 5v12M9 21v-6h6v6'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=compat] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h14l-3-3M20 16H6l3 3'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=receipts] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18v4H3zM5 10v10h14V10M10 14h4'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=audit] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h9l4 4v14H6zM14 3v5h5M9 13h7M9 17h5'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=destroy] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13M10 11v6M14 11v6'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=backup] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6c0-1.7 3.6-3 8-3s8 1.3 8 3-3.6 3-8 3-8-1.3-8-3zM4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=keys] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15a4 4 0 1 0 8 0 4 4 0 1 0-8 0M11 12l9-9M17 6l3 3M15 8l2 2'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=fault] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 3L5 14h6l-1 7 8-11h-6z'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=ops] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 12a5 5 0 1 0 10 0 5 5 0 1 0-10 0M12 2v4M12 18v4M2 12h4M18 12h4'/%3E%3C/svg%3E"); }
.sidebar nav a[data-k=docs] { --i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h10a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3zM5 17a3 3 0 0 1 3-3h10'/%3E%3C/svg%3E"); }
.side-foot { padding: 10px 18px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); }
.topbar { position: fixed; top: var(--banner-h); left: var(--side-w); right: 0; height: var(--top-h); background: #fff; border-bottom: 1px solid var(--line-soft); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px; }
.crumb { color: var(--faint); font-size: 12.5px; }
.crumb b { color: var(--ink2); font-weight: 600; }
.tools { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink2); }
.tools label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tools .sep { width: 1px; height: 20px; background: var(--line); }
.user { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.user form { margin: 0; }
main.main { margin: calc(var(--banner-h) + var(--top-h)) 0 0 var(--side-w); padding: 26px 32px 56px; max-width: 1560px; }
.notice { margin: 0 0 14px; }

/* ---- 레이아웃: 카드 대신 위쪽 검은 선으로 구획 ---- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; gap: 14px 24px; flex-wrap: wrap; }
.pagehead .desc { color: var(--muted); max-width: 46em; }
.grid { display: grid; gap: 28px 32px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.span-2 { grid-column: span 2; }
.card { background: var(--card); border: 0; border-top: 1px solid var(--ink); padding: 12px 0 4px; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cardhead h2 { margin: 0; }
.flowcard { margin-bottom: 28px; }
.flowhint { margin-bottom: 6px; }
/* 현황 숫자 띠 */
.grid.kpis { gap: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }   /* 현황 숫자는 개수와 관계없이 한 줄 */
.grid.kpis > .card.stat { border-top: 0; padding: 12px 18px; border-left: 1px solid var(--line); }
.grid.kpis > .card.stat:first-child { border-left: 0; padding-left: 0; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); line-height: 1.25; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--faint); font-size: 12px; min-height: 18px; }
.stat.ok .value { color: var(--ink); } .stat.warn .value { color: var(--warn); } .stat.crit .value { color: var(--crit); }
.meter { position: relative; height: 6px; background: #ededed; margin: 8px 0 4px; }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink2); }
.meter.bad > i { background: var(--crit); }
.meter > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }

/* ---- 표: 넘치면 표 안에서만 가로로 스크롤 ---- */
.tbl-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.tbl-tools input[type=search] { min-width: 220px; }
.tbl-tools .count { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.tbl-wrap { overflow-x: auto; max-width: 100%; }
.tbl-wrap td { white-space: nowrap; }
.tbl-wrap td.wrap { white-space: normal; min-width: 200px; max-width: 440px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; border-bottom: 1px solid var(--ink); padding: 9px 16px 9px 0; white-space: nowrap; background: none; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th .arrow { display: inline-block; width: 10px; color: var(--ink); }
td { padding: 9px 16px 9px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:hover td { background: #fafafa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; text-align: right; }
.tbl-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 10px; color: var(--muted); font-size: 12.5px; }
time .abs { display: block; color: var(--faint); font-size: 11.5px; }
time .rel { white-space: nowrap; }
.idcell { display: inline-flex; align-items: center; gap: 4px; }
.copy { border: 0; background: transparent; color: var(--ink2); padding: 0 3px; cursor: pointer; font-size: 12px; line-height: 1; text-decoration: underline; }
.copy:hover { background: var(--panel); }

/* ---- 상태 표시: 점 + 글자(알약 배경 없음) ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap; background: none; padding: 0; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink2); flex: none; }
.badge.ok::before { background: var(--ok); }
.badge.warn { color: var(--warn); } .badge.warn::before { background: transparent; border: 1.5px solid var(--warn); width: 6px; height: 6px; }
.badge.crit { color: var(--crit); } .badge.crit::before { background: var(--crit); }
.badge.gray { color: var(--muted); } .badge.gray::before { background: #c4c4c4; }
.alert { padding: 10px 14px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-line); color: #6f4400; }
.alert.crit { background: var(--crit-bg); border-color: var(--crit-line); color: #8a1c1c; }
.alert.info { background: var(--panel); border-color: var(--line); color: var(--ink2); }
.alert.ok { background: var(--ok-bg); border-color: var(--ok-line); color: #1f5130; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 14px 0; }
.loading::before { content: ""; width: 14px; height: 14px; border: 2px solid #d4d4d4; border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation: none; } }
.empty { color: var(--muted); padding: 22px 0; text-align: center; }
.empty b { display: block; color: var(--ink); margin-bottom: 2px; }
.errbox { border: 1px solid var(--crit-line); background: var(--crit-bg); color: #8a1c1c; padding: 10px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.errbox .rid { font-size: 12px; opacity: .85; }

/* ---- 버튼·입력: 사각, 기본 버튼은 먹색 ---- */
button, .btn { font-family: inherit; font-size: 13.5px; border-radius: 0; border: 1px solid var(--ink); background: var(--ink); color: #fff; height: 32px; padding: 0 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1; white-space: nowrap; }
button:hover:not(:disabled), .btn:hover { background: #000; }
button.secondary, .btn.secondary { background: #fff; color: var(--ink); border-color: #bdbdbd; }
button.secondary:hover:not(:disabled), .btn.secondary:hover { background: var(--panel); }
button.danger { background: #fff; color: var(--crit); border-color: var(--crit); }
button.danger:hover:not(:disabled) { background: var(--crit-bg); }
button.ghost { background: transparent; border-color: transparent; color: var(--ink); padding: 0 8px; text-decoration: underline; }
button.ghost:hover:not(:disabled) { background: var(--panel); }
button.small, .btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
button:disabled { opacity: .4; cursor: not-allowed; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input, select, textarea { font-family: inherit; font-size: 13.5px; border: 1px solid #c8c8c8; border-radius: 0; height: 32px; padding: 0 8px; background: #fff; color: var(--ink); min-width: 0; }
input[type=checkbox], input[type=radio] { height: auto; }
textarea { width: 100%; resize: vertical; height: auto; padding: 6px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
input[readonly] { background: var(--panel); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.form { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: flex-end; }
.card > .form, .card .tbl-tools { background: var(--panel); padding: 12px 14px; }
.seg { display: inline-flex; border: 1px solid #bdbdbd; }
.seg button { border: 0; background: #fff; color: var(--ink); height: 30px; padding: 0 12px; }
.seg button:hover:not(:disabled) { background: var(--panel); }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
.seg button + button { border-left: 1px solid #bdbdbd; }
.exportbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.exportbar input[type=date] { height: 30px; }

/* ---- 차트 ---- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.spark { display: block; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.steps li:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--ok); } .dot.bad { background: var(--crit); }
.bar { height: 8px; background: #ededed; overflow: hidden; } .bar > div { height: 100%; background: var(--ink2); }

/* ---- 모달·토스트 ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal { background: #fff; border: 1px solid var(--ink); box-shadow: 0 12px 32px rgba(0, 0, 0, .18); width: 100%; max-width: 560px; display: flex; flex-direction: column; max-height: 84vh; }
.modal.wide { max-width: 860px; }
.modal-head { padding: 18px 22px 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 4px 22px 12px; overflow-y: auto; }
.modal-foot { padding: 12px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-soft); }
.modal .field { margin: 10px 0; }
.modal .field input, .modal .field select { width: 100%; }
.modal .field .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.modal .field .err { color: var(--crit); font-size: 12px; margin-top: 2px; }
.modal .section { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 14px; }
.modal .section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.secret-box { display: flex; gap: 8px; align-items: center; }
.secret-box input { flex: 1; font-family: var(--mono); font-size: 13px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: 440px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; font-size: 13.5px; }
.toast.err { background: var(--crit); }
.toast .rid { display: block; font-size: 11.5px; opacity: .85; margin-top: 2px; }

/* ---- 비로그인 문서 열람 / 로그인 화면 ---- */
body.public .topbar { left: 0; }
body.public main.main { margin-left: 0; }
body.public .brand.pub { border: 0; padding: 0; }
body.public .brand.pub strong { color: var(--ink); }
body.loginpage { padding-top: var(--banner-h); min-width: 0; background: var(--side); min-height: 100vh; }

/* ---- 로그인 ---- */
.login { max-width: 420px; margin: 12vh auto 0; }
.login .card { padding: 30px 32px 26px; background: #fff; border-top: 2px solid var(--ink); }
.login h1 { font-size: 28px; }
.login input { width: 100%; height: 38px; }
.login button[type=submit] { width: 100%; height: 40px; }
.login .stack > * + * { margin-top: 12px; }

/* ---- 개발자 문서 ---- */
.docs { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.docs-toc { position: sticky; top: 92px; font-size: 13.5px; }
.docs-toc a { display: block; padding: 5px 10px; color: var(--ink2); text-decoration: none; border-radius: 6px; }
.docs-toc a:hover { color: var(--ink); background: var(--side); }
.docs section { margin-bottom: 18px; scroll-margin-top: 92px; }
.docs pre { background: #171717; color: #e5e5e5; padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; margin: 10px 0; }
.docs pre code { font-size: inherit; }
.docs table td, .docs table th { vertical-align: top; }
.docs table td:first-child { white-space: nowrap; }
.method { display: inline-block; min-width: 56px; text-align: center; font-family: var(--mono); font-weight: 700; font-size: 11.5px; padding: 0 6px; border: 1px solid currentColor; }
.method.get { color: var(--ok); } .method.put { color: var(--warn); } .method.post { color: var(--ink); } .method.delete { color: var(--crit); }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--ink); margin: 10px 0; }
.tabs button { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); height: auto; padding: 8px 14px 6px; margin-bottom: -1px; }
.tabs button:hover:not(:disabled) { background: transparent; color: var(--ink); }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }

/* ---- 파기 증적서(화면 + A4 인쇄) ---- */
body.cert { min-width: 0; background: #ececec; }
.cert-toolbar { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; gap: 10px; align-items: center; z-index: 10; }
.paper { background: #fff; width: 210mm; min-height: 297mm; margin: 20px auto; padding: 18mm 18mm 14mm; border: 1px solid #d4d4d4; position: relative; }
.paper h1 { text-align: center; font-size: 24px; letter-spacing: 8px; margin: 6mm 0 2mm; }
.paper .docno { text-align: center; color: var(--muted); margin-bottom: 8mm; }
.paper table.meta th { width: 38mm; background: var(--panel); color: var(--ink); font-size: 13px; border: 1px solid #a3a3a3; padding: 7px 10px; }
.paper table.meta td { border: 1px solid #a3a3a3; padding: 7px 10px; }
.paper .hash { font-family: var(--mono); font-size: 11px; word-break: break-all; }
.paper .verdict { margin: 8mm 0 4mm; padding: 10px 14px; border: 1px solid; font-weight: 700; }
.paper .verdict.ok { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.paper .verdict.bad { border-color: var(--crit); color: var(--crit); background: var(--crit-bg); }
.paper .legal { font-size: 12px; color: var(--ink2); border-top: 1px solid #a3a3a3; margin-top: 8mm; padding-top: 4mm; }
.paper .mockmark { position: absolute; right: 18mm; top: 12mm; border: 2px solid var(--crit); color: var(--crit); font-weight: 700; font-size: 11px; padding: 2px 8px; transform: rotate(6deg); }
@media print {
  @page { size: A4; margin: 0; }
  body, body.cert { background: #fff; }
  .banner, .sidebar, .topbar, .cert-toolbar, .toasts { display: none !important; }
  .paper { border: 0; margin: 0; width: auto; min-height: 0; }
}

/* ---- 실시간 흐름 ---- */
.grow { flex: 1; }
.flowbar { display: flex; flex-direction: column; gap: 10px; }
.flowbar-top { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.flowbar-top .livenote { flex: 1 1 auto; min-width: 0; }
.flowbar-top .flowcounts { flex: none; white-space: nowrap; }
.flowbar-top button, .flowbar-top .live { flex: none; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--ink2); font-size: 13px; }
.live .dot { margin-top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.live.paused { color: var(--muted); } .live.paused .dot { background: #a3a3a3; }
.live.err { color: var(--crit); } .live.err .dot { background: var(--crit); }
.flow-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.flow-card { background: var(--card); border: 1px solid var(--line); border-top-color: var(--ink); padding: 10px 14px 12px; cursor: default; }
.flow-card[hidden] { display: none; }
.flow-card.st-fail { background: var(--crit-bg); border-color: var(--crit-line); border-top-color: var(--crit); }
.flow-card.st-stale { opacity: .75; }
.flow-card.fresh { animation: flowin .8s ease-out; }
@keyframes flowin { from { background: #f0f0f0; } to { background: var(--card); } }
.flow-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.flow-toggle { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 320px; background: transparent; border: 0; color: inherit; font: inherit; text-align: left; height: auto; padding: 3px 2px; cursor: pointer; }
.flow-toggle:hover:not(:disabled) { background: var(--panel); }
.flow-toggle .caret { width: 12px; color: var(--muted); }
.flow-title { flex: 1; min-width: 0; }
.flow-total { font-weight: 700; color: var(--ink); min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.flow-time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 116px; text-align: right; font-size: 12.5px; }
.flow-id { font-size: 12px; color: var(--muted); }
.flow-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.flow-op { font-size: 12px; color: var(--muted); min-width: 92px; }
.fsteps { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; margin: 0; padding: 0; }
.fstep { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 3px 10px; background: #fff; color: var(--ink); font-size: 12.5px; border: 1px solid var(--line); }
.fstep.ok { color: var(--ink); }
.fstep.fail { background: var(--crit-bg); color: var(--crit); border-color: var(--crit-line); font-weight: 700; }
.fstep.info { background: var(--panel); }
.fstep.pending { border-style: dashed; color: var(--muted); }
.fstep .fnm { font-weight: 700; }
.fstep .fnt { opacity: .9; }
.fstep .fms { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.fstep.fail .ms { color: var(--crit); }
.sico { flex: none; }
li.farrow { color: #a3a3a3; padding: 0 3px; }
.flow-detail { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.flow-call + .flow-call { margin-top: 12px; }
.flow-callhead { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
tr.row-fail td { background: var(--crit-bg); }
.flow-more { text-align: center; margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .flow-card.fresh { animation: none; } }

/* ---- 비정상 접근(연계기관 화면) ---- */
.anomaly-box { border: 1px solid var(--crit-line); background: var(--crit-bg); color: #8a1c1c; padding: 10px 14px; margin-bottom: 10px; }
.anomaly-box.review { border-color: var(--warn-line); background: var(--warn-bg); color: #6f4400; }
.anomaly-box .actions { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- 개발용 제어 경고 ---- */
.devwarn { color: #f5b74e; font-weight: 700; }
.testbadge { display: inline-block; white-space: nowrap; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: middle; }
