/*
 * HistoryCheck 디자인 시스템 — 공개 아카이브(종이·먹·명조) + 관리자 콘솔(admin-site §F 셸).
 * 시안: docs/design/canvas-v1/ (Design Canvas). 토큰은 :root 한 곳.
 *
 * ⚠️ CSP 가 default-src 'self' 다 — 마크업의 style="…" 과 <style> 은 브라우저가 막는다.
 *    모든 모양은 이 파일의 클래스로만 준다(tests/run.php 가 뷰의 style= 을 막는다).
 * ⚠️ 외부 웹폰트도 막힌다 — 글꼴은 같은 출처에 둔다(/assets/fonts: Pretendard 동적 서브셋 + 마루부리).
 *    시스템 명조(AppleMyungjo·바탕)로 떨어지면 «옛날 사이트» 느낌이 난다(2026-10-21 오너 지적) — 명조 대체 글꼴을 목록에 넣지 않는다.
 *    명조(마루부리)는 대제목·사건 제목·인물 이름·사료 인용문에만. 섹션 제목·연도·숫자는 Pretendard.
 */
:root {
  /* 공개 — 종이·먹 */
  --ink: #18202B;
  --ink-2: #3D4553;
  --ink-3: #5A6170;
  --paper: #F7F5F0;
  --paper-2: #EFECE4;
  --line: #DDD8CC;
  --line-strong: #C4BDAD;
  --surface: #FFFFFF;
  --accent: #1F4A7A;
  --accent-hover: #163759;
  --seal: #C2493A;

  /* 관리자 — 회색 바탕 */
  --admin-bg: #F4F5F7;
  --admin-line: #DCE0E6;
  --admin-line-2: #E6E9EE;
  --admin-muted: #4A5260;
  --sidebar: #141B26;
  --sidebar-2: #222C3B;
  --sidebar-line: #263142;
  --sidebar-text: #C9D1DC;
  --sidebar-dim: #8E99A8;
  --sidebar-accent: #E46B57;

  /* 상태 */
  --ok: #1F5A3D;
  --ok-soft: #E3EFE7;
  --ok-line: #A8CDB5;
  --info: #1D4677;
  --info-soft: #E4ECF6;
  --info-line: #A9C0DE;
  --warn: #6E4300;
  --warn-soft: #FBEFD6;
  --warn-line: #E3BF78;
  --danger: #8E2A1C;
  --danger-soft: #F8E3DF;
  --danger-line: #E2A79C;
  --overturned: #4A2D78;
  --overturned-soft: #F2EDF8;
  --block: #7A1F1F;
  --neutral-soft: #F2F1EE;

  --font-sans: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  --font-serif: "MaruBuri", "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-pop: 0 20px 40px -16px rgba(20, 27, 38, .45);

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
}

/* ── 바탕 ─────────────────────────────────────────── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans); color: var(--ink); line-height: 1.7; font-size: 16px; letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--paper-2); padding: 1px 5px; border-radius: 3px; }
table { border-collapse: collapse; width: 100%; }

.icon { flex: none; display: inline-block; vertical-align: middle; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius); text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.muted { color: var(--ink-3); }
.admin-body .muted { color: var(--admin-muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.text-ok { color: var(--ok); font-weight: 700; }
.text-danger { color: var(--danger); font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row-sm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-wrap { flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 20px; align-items: start; }
.empty-state { padding: 28px 20px; text-align: center; color: var(--ink-3); font-size: 15px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.panel .empty-state { border: 0; border-radius: 0; }

/* ── 버튼 (관리자 기본) ─────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid #C9CED6; border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover, .btn.is-hover { background: #F0F2F5; color: var(--ink); }
.btn.is-focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.btn-primary:hover, .btn-primary.is-hover { background: #2D3848; border-color: #2D3848; color: #fff; }
.btn-danger { border-color: var(--danger-line); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 700; }
.btn-danger-solid:hover { background: #73200F; color: #fff; }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(127, 137, 150, .14); }

/* ── 폼 ─────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.admin-body .field-label { color: var(--admin-muted); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea,
.form-inline select, .row-sm select {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid #C9CED6; border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: 15px;
}
.row-sm select { width: auto; min-height: 34px; padding: 4px 8px; font-size: 13px; }
.field textarea { resize: vertical; line-height: 1.6; }
.field input:disabled, .field select:disabled { background: var(--admin-bg); color: var(--admin-muted); }
.field.is-error input { border: 1.5px solid var(--danger); }
.field.is-error .field-label, .field.is-error .field-hint { color: var(--danger); }
.field-hint { font-size: 12px; color: var(--admin-muted); }
.field-sm input:not([type=checkbox]) { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.field-sm .field-label { font-size: 12px; }
.field-grow { flex: 1 1 320px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.form-grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.form-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-inline .field { flex: 1 1 240px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 32px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--ink); }
.check-top { align-items: flex-start; line-height: 1.6; }
.check-top input { margin-top: 3px; }
.checklist { margin: 0; padding: 8px 12px 10px; border: 1px solid var(--admin-line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 2px; }
.checklist legend { padding: 0 4px; font-size: 12px; font-weight: 700; color: var(--admin-muted); }
.checklist .check { font-size: 13px; min-height: 28px; }
.subtle-box { padding: 12px 14px; background: var(--admin-bg); border: 1px solid var(--admin-line-2); border-radius: var(--radius); }

.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; padding-right: 48px !important; }
.pw-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--admin-muted); cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: #F0F2F5; }
.pw-toggle > span { display: inline-flex; }
.pw-toggle[aria-pressed="false"] .icon-eye-off, .pw-toggle[aria-pressed="true"] .icon-eye { display: none; }

/* ── 알림: 배너 · 토스트 · 전면 배너 (CPR-05) ─────────── */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid; border-radius: 8px; font-size: 14px; line-height: 1.65; }
.alert-info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.alert-error { background: var(--danger-soft); border-color: var(--danger-line); color: #6E1E13; }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-line); color: #5A3700; }
.alert .icon { margin-top: 1px; }
.alert-list { margin: 4px 0 0; padding-left: 18px; }
.banner-full { padding: 12px 20px; background: var(--danger); color: #fff; font-size: 14px; font-weight: 700; border-radius: var(--radius-sm); }
.toast-region { position: fixed; z-index: 90; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 40px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow-pop); max-width: 520px; }
.toast-ok .icon:first-child { color: #8FD3A6; }
.toast-err { background: var(--danger); }
.toast.is-static { display: inline-flex; box-shadow: none; margin-top: 6px; }
.toast-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer; opacity: .8; }
.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, .12); }

/* ── 표 ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.table-wrap.is-flush { border: 0; border-radius: 0; }
.table-wrap table { min-width: 760px; font-size: 14px; }
th, td { padding: 11px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--paper-2); font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.admin-body th { background: var(--admin-bg); color: var(--admin-muted); }
.admin-body th, .admin-body td { border-bottom-color: var(--admin-line-2); }
.cell-wrap { white-space: normal; max-width: 420px; line-height: 1.6; }
.cell-quote { max-width: 380px; }
.cell-right { text-align: right; }
.col-action { min-width: 300px; }

/* ── 태그(관리자 표 상태) · 칩 ─────────────────────────── */
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.tag-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.tag-block { background: #fff; color: var(--block); border: 1.5px solid var(--block); }
.tag-muted { background: var(--admin-bg); color: var(--admin-muted); border-color: var(--admin-line); }
.tag-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--ink); background: var(--surface); white-space: nowrap; }
.value-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: var(--radius-sm); background: var(--admin-bg); border: 1px solid var(--admin-line); font-size: 13px; }

/* ── 7단계 검증 상태 배지 — 색만으로 구분하지 않는다(채움·선·아이콘) ── */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap; border: 1px solid transparent; font-family: var(--font-sans); }
.badge-officially_confirmed  { background: var(--ok); color: #fff; border-color: var(--ok); }
.badge-retrial_overturned    { background: var(--overturned); color: #fff; border-color: var(--overturned); }
.badge-consensus             { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge-controversial         { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-alleged               { background: var(--neutral-soft); color: #3F4148; border: 1px dashed #8A8C93; }
.badge-officially_denied     { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge-insufficient_evidence { background: #fff; color: var(--block); border: 1.5px solid var(--block); }
.badge-unknown               { background: var(--neutral-soft); color: var(--ink-2); border-color: var(--line-strong); }

/* ── 연좌제 추정 금지 고지 — 경고색이 아닌 먹색 띠(기록 원칙) ── */
.notice { border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.notice-head { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; }
.notice-body { padding: 16px 20px; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.notice-body strong { color: var(--ink); }
.notice-list { margin: 0; padding: 16px 20px 16px 40px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.notice-compact { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--ink); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; font-weight: 500; }

/* ── 모달 (CPR-05) ─────────────────────────────────── */
.hc-modal { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
.hc-modal::backdrop { background: rgba(20, 27, 38, .45); }
.hc-modal-box { display: flex; flex-direction: column; margin: 0; }
.hc-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--admin-line-2); }
.hc-modal-head h2 { font-size: 17px; }
.hc-modal-head h2.is-danger { color: var(--danger); }
.hc-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.hc-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--admin-line-2); background: #F7F8FA; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ── 관계도 상자 ─────────────────────────────────── */
.graph-box { min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.graph-box-md { min-height: 380px; border: 0; border-radius: 0; }
.graph-box-lg { min-height: 620px; }
.relscope {
  --rm-bg: var(--paper); --rm-surface: var(--surface); --rm-surface-2: var(--paper-2);
  --rm-border: var(--line); --rm-border-strong: var(--line-strong);
  --rm-text: var(--ink); --rm-text-muted: var(--ink-3); --rm-accent: var(--accent); --rm-on-accent: #fff;
  --rm-ok: var(--ok); --rm-ok-soft: var(--ok-soft); --rm-warn: var(--warn); --rm-warn-soft: var(--warn-soft);
  --rm-fail: var(--danger); --rm-fail-soft: var(--danger-soft);
}

/* ═════════════════════════════════════════════════
 *  공개 아카이브
 * ═════════════════════════════════════════════════ */
.site-body { background: var(--paper); }
.site-header { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--ink); }
.site-header-inner { max-width: 1240px; margin: 0 auto; padding: 8px 32px; min-height: 76px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand:hover { color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 18px; }
.brand-sub { font-size: 12px; color: var(--ink-3); letter-spacing: .03em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 15px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--ink); background: var(--paper-2); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--seal); }
.site-main { max-width: 1240px; margin: 0 auto; padding: 48px 32px 24px; display: flex; flex-direction: column; gap: 48px; outline: 0; }

.btn-site { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 1px solid var(--ink); border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-site:hover { background: var(--paper-2); color: var(--ink); }
.btn-site-solid { background: var(--ink); color: #fff; }
.btn-site-solid:hover { background: #2D3848; color: #fff; }
.btn-site-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-site-light:hover { background: var(--paper-2); }
.btn-site:disabled { opacity: .5; cursor: progress; }

.crumbs { font-size: 14px; color: var(--ink-3); }
.page-header { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.page-h1 { font-family: var(--font-serif); font-size: 40px; font-weight: 700; line-height: 1.25; }
.page-h1-sub { font-family: var(--font-sans); font-size: 18px; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.section-title .page-h1-sub { font-size: 15px; }
.page-lead { font-size: 17px; line-height: 1.75; color: var(--ink-2); }
.section { display: flex; flex-direction: column; gap: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-title { font-family: var(--font-sans); font-size: 26px; font-weight: 750; letter-spacing: -0.015em; }
.section-desc { font-size: 15px; color: var(--ink-2); line-height: 1.7; }

/* 홈 */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 40px; align-items: start; padding-bottom: 44px; border-bottom: 1px solid var(--line); }
.hero-main { display: flex; flex-direction: column; gap: 20px; }
.eyebrow { font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; color: var(--ink-3); }
.hero-title { font-family: var(--font-serif); font-size: 52px; font-weight: 700; line-height: 1.22; letter-spacing: -0.01em; word-break: keep-all; }
.hero-lead { font-size: 18px; line-height: 1.8; color: var(--ink-2); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.principles { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.principles-title { font-family: var(--font-sans); font-size: 20px; }
.principles ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.principles li { display: flex; gap: 14px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.principles li strong { color: var(--ink); }
.principle-no { font-family: var(--font-mono); font-weight: 500; color: #A3352A; }
.principles-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 14px; }
.ledger-wrap { display: flex; flex-direction: column; gap: 10px; }
.ledger { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.ledger > div { padding: 18px; border-right: 1px solid var(--line); }
.ledger > div:last-child { border-right: 0; }
.ledger dt { font-size: 13px; color: var(--ink-3); }
.ledger dd { margin: 4px 0 0; font-family: var(--font-sans); font-size: 34px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ledger dd span { font-family: var(--font-sans); font-size: 15px; font-weight: 500; margin: 0 4px 0 3px; }
.ledger-note { font-size: 13px; color: var(--ink-3); }
.event-list { border-top: 1px solid var(--ink); }
.event-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.event-years { font-family: var(--font-sans); font-size: 26px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.event-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: var(--ink-3); }
.event-title { font-size: 22px; line-height: 1.45; }
.event-title a { color: var(--ink); text-decoration: none; }
.event-title a:hover { text-decoration: underline; }
.event-lead { font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.milestones { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.milestones li { padding: 10px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.milestones li:last-child { border-right: 0; }
.ms-label { font-size: 12px; color: var(--ink-3); }
.ms-date { font-family: var(--font-mono); font-size: 14px; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 24px; }
.cmp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.cmp-card-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.cmp-card-head h3 { font-size: 18px; line-height: 1.5; }
.cmp-event { font-size: 13px; color: var(--ink-3); text-decoration: none; }
.cmp-pair { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); flex: 1; }
.cmp-then, .cmp-now { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.7; }
.cmp-then { background: var(--danger-soft); }
.cmp-now { background: var(--ok-soft); }
.cmp-tag { font-size: 12px; font-weight: 700; }
.cmp-then .cmp-tag { color: var(--danger); }
.cmp-now .cmp-tag { color: var(--ok); }
.cmp-actor { font-size: 12px; color: var(--ink-2); }
.cmp-arrow { display: flex; align-items: center; justify-content: center; background: var(--paper-2); color: var(--ink); }

/* 연표 */
.era-filter { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-top: -16px; }
.era-filter a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.era-filter a:hover { background: var(--paper-2); }
.era-filter a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.legend { list-style: none; margin: -24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.mk { display: inline-block; width: 10px; height: 10px; flex: none; }
.mk-occurred { border-radius: 50%; background: var(--ink); }
.mk-announced { border-radius: 50%; border: 2px solid var(--danger); background: var(--surface); }
.mk-investigated { background: var(--info); }
.mk-reexamined { background: var(--overturned); transform: rotate(45deg) scale(.85); }
.tl { list-style: none; margin: 0 0 0 8px; padding: 0; border-left: 2px solid var(--ink); }
.tl-item { position: relative; padding: 0 0 40px 34px; }
.tl-item:last-child { padding-bottom: 8px; }
.tl-dot { position: absolute; left: -9px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.tl-era { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); letter-spacing: .03em; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 2px; }
.tl-year { font-family: var(--font-sans); font-size: 28px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tl-card { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.tl-title { font-size: 21px; line-height: 1.45; color: var(--ink); }
.tl-title a { color: var(--ink); text-decoration: none; }
.tl-title a:hover { text-decoration: underline; }
.tl-place { font-size: 14px; color: var(--ink-3); }
.tl-dates { margin: 4px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 12px; font-size: 14px; }
.tl-dates > div { display: flex; gap: 8px; align-items: center; }
.tl-dates dt { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); }
.tl-dates dd { margin: 0; font-family: var(--font-mono); color: var(--ink); }

/* 상세 2단 */
.layout-2col { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.col-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 40px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 96px; }
.article-head { display: flex; flex-direction: column; gap: 14px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.article-title { font-family: var(--font-serif); font-size: 38px; font-weight: 700; line-height: 1.32; word-break: keep-all; }
.article-lead { font-size: 18px; line-height: 1.8; font-weight: 500; }
.article-body { font-size: 16px; line-height: 1.9; color: var(--ink-2); }
.stage-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stage { background: var(--surface); border: 1px solid var(--line); border-top-width: 4px; border-radius: var(--radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.7; }
.stage-label { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.stage-actor { font-size: 13px; color: var(--ink-2); }
.s-announce { border-top-color: var(--danger); }
.s-testimony { border-top-color: #A06A00; }
.s-commission { border-top-color: var(--info); }
.s-retrial { border-top-color: var(--overturned); }
.stage-summary { padding: 14px 18px; background: var(--paper-2); border-radius: var(--radius-sm); font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.claim { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.claim-head { padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.claim-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.claim-title { font-size: 18px; line-height: 1.5; }
.claim-body { font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.claim-quote { margin: 0; padding: 20px 24px; background: var(--paper-2); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.claim-quote figcaption { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.quote-ok { color: var(--ok); }
.quote-no { color: var(--danger); }
.claim-quote blockquote { margin: 0; font-family: var(--font-serif); font-size: 17px; line-height: 1.85; }
.quote-src { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.quote-src a { display: inline-flex; align-items: center; gap: 4px; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.side-title { font-size: 16px; }
.mini-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mini-tl li { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 10px; align-items: center; font-size: 15px; }
.mini-tl .mini-label { font-size: 13px; color: var(--ink-3); }
.mini-tl .mono { grid-column: 2; }
.mini-tl .mk { grid-row: 1; }

/* 인물 */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.person-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.person-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.person-name { font-family: var(--font-serif); font-size: 24px; font-weight: 700; }
.person-name a { color: var(--ink); text-decoration: none; }
.person-name a:hover { text-decoration: underline; }
.person-hanja { font-family: var(--font-serif); font-size: .68em; color: var(--ink-3); font-weight: 600; }
.person-life { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.person-bio { font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.person-more { margin-top: auto; font-size: 14px; font-weight: 700; }
.flag-record { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--danger-soft); border: 1px solid var(--danger-line); border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; color: var(--danger); }
.flag-record-lg { font-size: 15px; padding: 12px 16px; }
.career { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.career-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.career-years { font-size: 15px; font-weight: 500; }
.career-body { display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.career-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 17px; color: var(--ink); }

/* 비교표 */
.stage-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stage-legend li { display: flex; flex-direction: column; padding: 12px 16px; border-right: 1px solid var(--line); border-top: 4px solid; font-size: 14px; }
.stage-legend li:last-child { border-right: 0; }
.stage-legend .mono { font-size: 12px; color: var(--ink-3); }
.cmp-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cmp-table-head { padding: 24px 28px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.cmp-issue { font-family: var(--font-serif); font-size: 24px; line-height: 1.45; }
.status-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chain-arrow { display: inline-flex; color: var(--ink-3); }
.cmp-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cmp-stage { padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-top: 4px solid; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.7; }
.cmp-stage h3 { font-size: 15px; }
.cmp-stage .mono.small { color: var(--ink-3); }
.cmp-table-foot { padding: 16px 28px; background: var(--paper-2); font-size: 14px; line-height: 1.7; color: var(--ink-2); }

/* 관계도 */
.graph-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; margin-top: -16px; }
.graph-layout .graph-box { flex: 999 1 640px; min-width: 0; }
.graph-legend { flex: 1 1 240px; font-size: 14px; }
.graph-legend ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

/* 사료 */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: -16px; }
.tier-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tier { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tier-1 { background: var(--ink); color: #fff; }
.tier-2 { background: var(--ink-2); color: #fff; }
.tier-3 { border: 1px solid var(--ink-2); color: var(--ink); }
.tier-4 { border: 1px dashed var(--ink-2); color: var(--ink); }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; }
.catalog-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; line-height: 1.65; }
.catalog-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.status-guide { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.status-guide > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.status-guide > div:last-child { border-bottom: 0; }
.status-guide dd { margin: 0; font-size: 14px; line-height: 1.6; }
.cta-band { background: var(--ink); color: #E6EAF0; border-radius: var(--radius); padding: 28px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.cta-band h2 { font-family: var(--font-sans); font-size: 24px; color: #fff; margin-bottom: 8px; }
.cta-band p { font-size: 15px; line-height: 1.7; max-width: 720px; }

/* 공개 푸터 */
.site-footer { background: var(--ink); color: #C9D1DC; margin-top: 64px; }
.site-footer a { color: #D9DEE6; }
.site-footer a:hover { color: #fff; }
.site-footer-inner { max-width: 1240px; margin: 0 auto; padding: 44px 32px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 28px; }
.site-footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 32px; font-size: 14px; line-height: 1.75; }
.site-footer-name { font-family: var(--font-sans); font-weight: 700; font-size: 18px; color: #fff; margin-bottom: 8px; }
.site-footer-head { font-weight: 700; color: #fff; margin-bottom: 6px; }
.site-footer-links { display: flex; flex-direction: column; gap: 6px; }
.site-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 18px; border-top: 1px solid #3A4454; font-size: 13px; color: #AEB7C4; }

/* ═════════════════════════════════════════════════
 *  관리자 콘솔 — admin-site §F
 * ═════════════════════════════════════════════════ */
.admin-body { background: var(--admin-bg); font-size: 15px; line-height: 1.6; }
.shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 14px 10px 14px 18px; border-bottom: 1px solid var(--sidebar-line); min-height: var(--topbar-h); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.sidebar-brand:hover { color: #fff; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sidebar-brand-name { font-weight: 700; font-size: 15px; white-space: nowrap; }
.sidebar-brand-name span { font-weight: 500; opacity: .8; }
.sidebar-brand-sub { font-size: 12px; color: var(--sidebar-dim); margin-top: 3px; }
.sidebar-collapse { color: #AEB7C4; flex: none; }
.sidebar-collapse:hover { color: #fff; background: var(--sidebar-2); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0 calc(96px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
.nav-group { padding-top: 10px; }
.nav-group-name { padding: 6px 20px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--sidebar-dim); }
.nav-group ul { list-style: none; margin: 0; padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--radius); color: var(--sidebar-text); font-size: 14px; font-weight: 500; text-decoration: none; }
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
.nav-item[aria-current="page"] { background: var(--sidebar-2); color: #fff; font-weight: 700; }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sidebar-accent); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--sidebar-accent); color: var(--sidebar); font-size: 12px; font-weight: 700; }
.sidebar-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--sidebar-line); font-size: 12px; line-height: 1.7; color: #AEB7C4; }
.sidebar-foot > div { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-dot { width: 8px; height: 8px; border-radius: 50%; background: #8FD3A6; flex: none; }
.env-dot.is-prod { background: var(--sidebar-accent); }
.sidebar-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(20, 27, 38, .45); }

.shell-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; min-height: var(--topbar-h); padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--admin-line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.topbar-menu { display: none; border-color: var(--admin-line); }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 14px; min-width: 0; color: var(--admin-muted); }
.crumb .icon { color: #8A93A1; }
.crumb-current { font-weight: 700; color: var(--ink); }
.topbar-spacer { flex: 1 1 40px; }
.quicknav { position: relative; display: flex; align-items: center; flex: 0 1 300px; min-width: 200px; margin: 0; }
.quicknav .icon { position: absolute; left: 12px; color: var(--admin-muted); pointer-events: none; }
.quicknav input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--admin-line); border-radius: var(--radius); background: var(--admin-bg); font-size: 14px; }
.quicknav input:focus { background: #fff; }
.env-badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .05em; background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); white-space: nowrap; }
.env-badge.is-prod { background: var(--danger); color: #fff; border-color: var(--danger); }
.env-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.account { display: flex; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid var(--admin-line); }
.account form { margin: 0; }
.account-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.account-text { display: flex; flex-direction: column; line-height: 1.2; margin-right: 4px; }
.account-id { font-size: 14px; font-weight: 700; }
.account-role { font-size: 12px; color: var(--admin-muted); }

.page { flex: 1; width: 100%; max-width: none; padding: 28px 28px 40px; display: flex; flex-direction: column; gap: 20px; outline: 0; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 20px; }
.page-title { font-size: 24px; font-weight: 700; }
.page-desc { margin-top: 6px; font-size: 14px; line-height: 1.7; color: var(--admin-muted); max-width: 1000px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--admin-line); border-radius: 8px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
a.kpi:hover { border-color: #AEB6C2; color: var(--ink); }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--admin-muted); }
.kpi-value { font-size: 30px; font-weight: 700; line-height: 1.15; }
.kpi-unit { font-size: 14px; font-weight: 500; margin-left: 3px; color: var(--admin-muted); }
.kpi-note { font-size: 12px; color: var(--admin-muted); }
.kpi-note.is-warn { color: #8A5300; font-weight: 700; }

.panel { background: var(--surface); border: 1px solid var(--admin-line); border-radius: 8px; overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 14px 20px; border-bottom: 1px solid var(--admin-line-2); font-size: 14px; }
.panel-head h2 { font-size: 16px; }
.panel-head h2 .muted { font-size: 13px; font-weight: 400; margin-left: 4px; }
.panel-head-stack { flex-direction: column; align-items: flex-start; }
.panel-body { padding: 18px 20px; }
.todo-list, .log-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--admin-line-2); font-size: 14px; }
.todo-list li:last-child, .log-list li:last-child { border-bottom: 0; }
.todo-text { flex: 1; }
.todo-list a { font-weight: 700; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-warn { background: #B26A00; }
.dot-danger { background: var(--danger); }
.log-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 2px 12px; padding: 12px 20px; border-bottom: 1px solid var(--admin-line-2); font-size: 14px; }
.log-list li > :last-child { grid-column: 2; font-size: 13px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--admin-line); }
.tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; font-size: 14px; color: var(--admin-muted); text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"], .tabs a[aria-selected="true"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--ink); }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--admin-line-2); color: var(--ink); font-size: 12px; font-weight: 700; }
.tabs a[aria-current="page"] .tab-count, .tabs a[aria-selected="true"] .tab-count { background: var(--ink); color: #fff; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--admin-line); border-radius: 8px; padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; min-width: 0; word-break: break-all; }
.stat-card-label { font-size: 13px; color: var(--admin-muted); }
.stat-card-value { font-size: 17px; font-weight: 700; word-break: keep-all; }
.meter { width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 3px; background: var(--admin-line-2); overflow: hidden; }
.meter::-webkit-progress-bar { background: var(--admin-line-2); border-radius: 3px; }
.meter::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.meter::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.kv { margin: 0; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--admin-muted); }
.kv dd { margin: 0; }
.check-summary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.check-summary li { display: flex; align-items: center; gap: 4px; }
.check-summary .is-ok { color: var(--ok); }
.check-summary .is-no { color: var(--danger); }
.cite-list { margin: 6px 0 0; padding-left: 16px; color: var(--ok); }
.log-console { background: var(--sidebar); color: #D9DEE6; padding: 14px 18px; font-family: var(--font-mono); font-size: 13px; line-height: 1.75; overflow-x: auto; max-height: 640px; overflow-y: auto; }
.log-line { white-space: pre-wrap; word-break: break-word; }
.log-ts { color: #AEB7C4; }
.log-lvl { font-weight: 500; color: #8FD3A6; }
.log-lvl-warn, .log-lvl-warning { color: #F0C674; }
.log-lvl-error, .log-lvl-critical { color: #FF9B8A; }
.log-ctx { color: #AEB7C4; }
.token-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.token { border: 1px solid var(--admin-line); border-radius: var(--radius); overflow: hidden; }
.token-sw { height: 52px; border-bottom: 1px solid var(--admin-line-2); }
.token-meta { padding: 8px 10px; display: flex; flex-direction: column; font-size: 12px; line-height: 1.5; }
.sw-ink { background: var(--ink); } .sw-ink-2 { background: var(--ink-2); } .sw-paper { background: var(--paper); } .sw-paper-2 { background: var(--paper-2); }
.sw-line { background: var(--line); } .sw-accent { background: var(--accent); } .sw-seal { background: var(--seal); } .sw-admin-bg { background: var(--admin-bg); }
.sw-sidebar { background: var(--sidebar); } .sw-ok { background: var(--ok); } .sw-overturned { background: var(--overturned); } .sw-danger { background: var(--danger); }
.ds-type-display { font-family: var(--font-serif); font-size: 40px; font-weight: 700; line-height: 1.25; }
.ds-type-h2 { font-family: var(--font-sans); font-size: 26px; font-weight: 700; }
.ds-type-admin { font-size: 24px; font-weight: 700; }

.admin-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; min-height: 56px; padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--admin-line); background: var(--surface); color: var(--admin-muted); font-size: 13px; }
.admin-footer-left, .admin-footer-right { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.admin-footer strong { color: var(--ink); }

/* 메뉴 접기(데스크톱) — 아이콘만 */
body.nav-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.nav-collapsed .shell-main { margin-left: var(--sidebar-w-collapsed); }
body.nav-collapsed .sidebar-brand-text, body.nav-collapsed .nav-label, body.nav-collapsed .nav-group-name, body.nav-collapsed .sidebar-foot { display: none; }
body.nav-collapsed .sidebar-head { flex-direction: column; padding: 12px 0; gap: 8px; }
body.nav-collapsed .nav-item { justify-content: center; padding: 0; }
body.nav-collapsed .nav-badge { position: absolute; top: 2px; right: 4px; min-width: 18px; height: 16px; padding: 0 4px; font-size: 11px; }
body.nav-collapsed .nav-group { border-top: 1px solid var(--sidebar-line); margin-top: 8px; }
body.nav-collapsed .nav-group:first-child { border-top: 0; margin-top: 0; }

/* 로그인 */
.auth-body { min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center; background: var(--admin-bg); padding: 24px 16px; }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card { background: var(--surface); border: 1px solid var(--admin-line); border-radius: var(--radius-lg); padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 12px 32px -18px rgba(20, 27, 38, .35); }
.auth-brand { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--admin-line-2); }
.auth-logo { display: inline-flex; align-items: center; gap: 12px; }
.auth-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.auth-logo-name { font-weight: 700; font-size: 16px; }
.auth-logo-name span { font-weight: 500; color: var(--admin-muted); }
.auth-logo-sub { font-size: 12px; color: var(--admin-muted); margin-top: 3px; }
.auth-title { font-size: 20px; }
.auth-checks { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--admin-muted); }
.auth-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: #6A7280; }

/* 오류 화면 (ErrorHandler — 뷰 없이 그린다) */
.error-body { min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center; background: var(--paper); padding: 24px 16px; }
.error-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px 32px; max-width: 460px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.error-code { font-family: var(--font-sans); font-size: 48px; font-weight: 700; line-height: 1; }
.error-title { font-size: 18px; font-weight: 500; color: var(--ink-2); }
.error-rid { font-size: 12px; color: var(--ink-3); }

/* ── 반응형 ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .account-text { display: none; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: min(84vw, 300px); box-shadow: var(--shadow-pop); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open { overflow: hidden; }
  .shell-main, body.nav-collapsed .shell-main { margin-left: 0; }
  body.nav-collapsed .sidebar { width: min(84vw, 300px); }
  body.nav-collapsed .sidebar-brand-text, body.nav-collapsed .nav-label, body.nav-collapsed .nav-group-name, body.nav-collapsed .sidebar-foot { display: revert; }
  .sidebar-collapse { display: none; }
  .topbar-menu { display: inline-flex; }
  .topbar { padding: 8px 16px; }
  .quicknav { order: 10; flex: 1 1 100%; }
  .topbar-spacer { display: none; }
  .account { margin-left: auto; }
  .account .btn span { display: none; }
  .page { padding: 20px 16px 32px; }
  .col-side { position: static; }
}
@media (max-width: 720px) {
  .site-header { position: static; }
  .site-header-inner, .site-main, .site-footer-inner { padding-left: 16px; padding-right: 16px; }
  .site-main { padding-top: 28px; gap: 36px; }
  .site-nav { margin: 0 -12px; }
  .hero-title { font-size: 36px; }
  .page-h1 { font-size: 30px; }
  .article-title { font-size: 28px; }
  .section-title { font-size: 23px; }
  .event-row, .career-row { grid-template-columns: 1fr; gap: 8px; }
  .event-years { font-size: 22px; }
  .cmp-pair { grid-template-columns: 1fr; }
  .cmp-arrow { padding: 6px; transform: rotate(90deg); }
  .ledger > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .status-guide > div { grid-template-columns: 1fr; gap: 6px; }
  .principles, .form-card { padding: 20px; }
  .cmp-table-head, .cmp-table-foot { padding-left: 18px; padding-right: 18px; }
  .admin-footer { padding-left: 16px; padding-right: 16px; }
  .kv { grid-template-columns: 1fr; }
  .crumb-group, .crumb .icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
