/* ==========================================================================
   구컴패니 관리자 — 트레이스 모니터 규약

   값을 지어내지 않았다. 참조본(docs/설계/관리자-화면-참조.md)의 글꼴·색·높이·
   테두리를 그대로 옮겼다. 전에는 우리 나름의 톤을 잡느라 글자가 10~20px 로
   흩어지고 색도 제각각이라 화면마다 달라 보였다.

   외운 값
     글꼴 Malgun Gothic · 바탕 13px · 글자 #333
     검은 바 하나(#222 60px)에 로고·메뉴·사용자를 다 담는다 — 띠가 둘이면 무겁다
     그 아래 흰 화면 줄(50px)에 이름·건수·도구
     선 #ddd(경계) #bbb(표 머리 아래) #eee(줄 사이)
     탭 #2774d8 + 밑줄 #347ee5 · 고른 줄 #dbe8ff · 스친 줄 #f5f8fc
     표 머리·줄 38px · 목록 글자 14px(본문 13px보다 한 단 크다) · 단추 36px/#d4d4d4
     로그인 카드 430px · 입력 44px · 단추 46px #3478d8
   ========================================================================== */

:root {
  --f-2xs: 10px;
  --f-xs:  11px;
  --f-sm:  13px;
  --f-md:  14px;
  --f-lg:  15px;
  --f-xl:  18px;
  --f-list:16px;   /* 목록 — 이 화면의 주인공이라 본문보다 두 단 크다 */
  --f-num: 22px;

  --panel:      #222;
  --line:       #ddd;
  --line-gnb:   #dedede;
  --line-hard:  #bbb;
  --line-soft:  #eee;
  --text:       #333;
  --strong:     #222;
  --muted:      #555;
  --faint:      #888;
  --hint:       #999;

  --nav:        #1670d2;   /* GNB·사이드 메뉴 */
  --nav-bg:     #eaf2ff;
  --accent:     #2774d8;   /* 탭 */
  --accent-bar: #347ee5;
  --accent-bg:  #eaf2fd;
  --accent-line:#c3dafb;
  --brand:      #3478d8;   /* 로그인 단추·아바타 */
  --sel:        #dbe8ff;
  --hover:      #f5f8fc;
  --btn-line:   #d4d4d4;

  --ok:         #3d9b63;
  --ok-bg:      #eaf5ee;
  --ok-line:    #c2ddcc;
  --warn:       #d07a00;
  --warn-bg:    #fdf4e6;
  --warn-line:  #f0dcb4;
  --danger:     #d33;
  --danger-bg:  #fdecea;
  --danger-line:#f4cdcb;

  /* 구간 색 — 참조본 범례 그대로 */
  --c-http:   #9e86e9;   /* 외부 호출 (CP) */
  --c-db:     #75d0d0;   /* 목록 조회 (group_scan) */
  --c-method: #efbd7c;   /* 안쪽 처리 (kb) */
  --c-stack:  #df3833;   /* 포기 */
  --c-etc:    #b8bec7;

  --radius: 4px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; width: 100%; height: 100%; }

body {
  background: #fff;
  color: var(--text);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: var(--f-md);
  line-height: 1.5;
}

button, input, select, textarea { font-family: inherit; }

.num, .when, .stat .v { font-variant-numeric: tabular-nums; }

.hidden { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #f3f3f3; }
::-webkit-scrollbar-thumb { background: #c8c8c8; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ══════════════════════════════════════════════════════════════════════
   로그인 · 2차 인증
   ══════════════════════════════════════════════════════════════════════ */

.auth-screen { position: fixed; inset: 0; z-index: 5000; background: #f5f7fa; overflow: auto; }
.auth-background {
  position: absolute; inset: 0;
  display: flex; justify-content: center; align-items: center;
  background: radial-gradient(circle at 50% 35%, #ffffff 0, #f7f9fc 42%, #eef2f7 100%);
}
.auth-grid {
  position: absolute; inset: 0; opacity: .35;
  background-image:
    linear-gradient(rgba(30,80,130,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,80,130,.035) 1px, transparent 1px);
  background-size: 40px 40px;
}
.auth-container {
  position: relative; width: min(430px, 100%);
  display: flex; flex-direction: column; align-items: center;
  padding: 30px 0;
}

.auth-logo { text-align: center; margin-bottom: 27px; }
.auth-logo-mark {
  width: 56px; height: 56px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: #222; color: #fff; border-radius: 9px;
  font-size: 29px; font-weight: 700;
  box-shadow: 0 5px 15px rgba(0,0,0,.12);
}
.auth-logo-title { font-size: 21px; font-weight: 700; letter-spacing: .8px; color: #222; }
.auth-logo-subtitle { margin-top: 5px; color: #8a929c; font-size: var(--f-xs); }

.auth-card {
  width: 100%; padding: 32px 36px 27px;
  background: #fff; border: 1px solid #e1e5ea; border-radius: 8px;
  box-shadow: 0 12px 40px rgba(20,40,70,.08);
}
.auth-card-header { margin-bottom: 26px; }
.auth-card-header h1 { margin: 0; color: #222; font-size: 20px; font-weight: 700; }
.auth-card-header p { margin: 8px 0 0; color: #8a929c; font-size: var(--f-sm); }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; color: #444; font-size: var(--f-sm); font-weight: 600; }
.form-group input, .form-group textarea {
  width: 100%; height: 44px; padding: 0 13px;
  border: 1px solid #d5dbe2; border-radius: 5px; outline: none;
  font: inherit; font-size: var(--f-md); background: #fff; transition: .15s;
}
.form-group textarea { height: auto; padding: 11px 13px; resize: vertical; min-height: 62px; }
.form-group input::placeholder, .form-group textarea::placeholder { color: #a8afb7; }
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(52,120,216,.08);
}
.form-group .hint { margin-top: 6px; }

.password-input { position: relative; }
.password-input input { padding-right: 45px; }
.password-input button {
  position: absolute; right: 4px; top: 4px; width: 36px; height: 36px;
  border: 0; background: transparent; color: #888; cursor: pointer;
}

.login-options {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 22px; font-size: var(--f-xs);
}
.remember { display: flex; align-items: center; color: #666; cursor: pointer; }
.remember input { margin-right: 6px; accent-color: var(--brand); width: auto; height: auto; }
.login-options a, .auth-footer a { color: var(--brand); }

.login-button {
  width: 100%; height: 46px; border: 0; border-radius: 5px;
  background: var(--brand); color: #fff;
  font: inherit; font-size: var(--f-md); font-weight: 600;
  cursor: pointer; transition: .15s;
}
.login-button:hover { background: #2868c2; box-shadow: 0 4px 12px rgba(52,120,216,.22); }
.login-button:active { transform: translateY(1px); }
.login-button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.auth-footer {
  margin-top: 21px; padding-top: 20px; border-top: 1px solid var(--line-soft);
  text-align: center; color: var(--hint); font-size: var(--f-xs);
}
.auth-footer a { margin-left: 4px; }

.otp-card { position: relative; }
.otp-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; background: var(--nav-bg); border-radius: 50%; font-size: 19px;
}
.back-login {
  border: 0; background: transparent; padding: 0; margin-bottom: 25px;
  color: #777; font: inherit; font-size: var(--f-xs); cursor: pointer;
}
.back-login:hover { color: var(--brand); }

.otp-inputs { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 27px 0 21px; }
.otp-input {
  width: 45px; height: 52px; padding: 0;
  border: 1px solid #d5dbe2; border-radius: 5px;
  text-align: center; font: inherit; font-size: 20px; font-weight: 600; color: #222;
  outline: none; transition: .15s;
}
.otp-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(52,120,216,.08); }
.otp-divider { color: #aaa; font-size: var(--f-xl); margin: 0 1px; }

.otp-info {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 21px; font-size: var(--f-sm); color: var(--muted);
}
/* 승인만 받은 사람이 QR 을 받는 문이다 — 작게 두면 못 찾는다 */
.otp-info button {
  height: 28px; padding: 0 11px; border-radius: 14px; cursor: pointer;
  background: var(--nav-bg); border: 1px solid var(--accent-line); color: var(--nav);
  font: inherit; font-size: var(--f-sm); font-weight: 600;
}
.otp-info button:hover { background: #dbe9ff; }

.otp-timer { margin-top: 14px; text-align: center; font-size: var(--f-xs); color: var(--hint); }
.otp-timer strong { margin-left: 4px; color: #e04a43; font-weight: 600; }

.auth-copyright { margin-top: 20px; color: #a1a8b0; font-size: var(--f-2xs); }

/* 알림 줄 — 로그인 화면 안에서 쓰는 것 */
.gate-err {
  background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--danger);
  border-radius: 5px; font-size: var(--f-sm); padding: 9px 11px; margin-bottom: 16px;
}
.gate-ok {
  background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok);
  border-radius: 5px; font-size: var(--f-sm); padding: 9px 11px; margin-bottom: 16px;
}

/* ══════════════════════════════════════════════════════════════════════
   콘솔
   ══════════════════════════════════════════════════════════════════════ */

.shell { width: 100%; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: #fff; }

/* ── GNB ─────────────────────────────────────────────────────────────── */

/* 검은 바 하나가 로고·메뉴·사용자를 다 담는다 */
.gnb {
  height: 60px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; background: var(--panel); color: #fff;
  z-index: 100;
}
.gnb-left { height: 100%; display: flex; align-items: center; }
.gnb-right { display: flex; align-items: center; height: 100%; }

.logo { display: flex; align-items: center; margin-right: 36px; white-space: nowrap; }
.logo-mark {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: #fff; color: #222; border-radius: 5px;
  font-size: var(--f-xl); font-weight: 700; margin-right: 9px;
}
.logo-text { font-size: var(--f-xl); font-weight: 700; letter-spacing: .5px; color: #fff; }
.logo-sub { font-size: var(--f-2xs); color: #8f96a0; margin-left: 7px; letter-spacing: .5px; }

.main-menu { height: 100%; display: flex; align-items: center; }
.nav-item {
  position: relative; height: 100%;
  display: flex; align-items: center; padding: 0 17px;
  border: 0; background: transparent;
  color: #b6bcc5; font: inherit; font-size: var(--f-lg);
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.nav-item:hover { color: #fff; background: #2e2e2e; }
.nav-item.active { color: #fff; font-weight: 600; }
.nav-item.active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 0;
  height: 3px; background: #4b91ec;
}
.nav-item .ico { margin-right: 6px; font-size: var(--f-md); }
.nav-item .badge-n {
  margin-left: 6px; padding: 0 5px; border-radius: 8px;
  background: #e53935; color: #fff; font-size: var(--f-2xs); font-weight: 700;
}

/* 검은 바 안 단추 — 바에 녹아 있어야 한다 */
.gnb-btn { height: 32px; margin-right: 14px; background: transparent; border-color: #4a4a4a; color: #ddd; }
.gnb-btn:hover { background: #2e2e2e; border-color: #6a6a6a; color: #fff; }
.gnb-btn .icon { color: #b6bcc5; }

.user-area { height: 44px; display: flex; align-items: center; padding: 0 9px; border-radius: 5px; cursor: pointer; position: relative; }
.user-area:hover { background: #2e2e2e; }
.user-avatar, .dropdown-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.user-info { margin-left: 9px; line-height: 1.25; }
.user-name { font-size: var(--f-md); font-weight: 600; color: #fff; }
.user-role { color: #8f96a0; font-size: var(--f-2xs); }
.user-arrow { margin-left: 10px; color: #b6bcc5; }

.user-dropdown {
  position: absolute; top: 55px; right: 0; width: 230px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 5px 20px rgba(0,0,0,.12);
  padding: 8px; display: none; z-index: 500;
}
.user-dropdown.show { display: block; }
.dropdown-user { display: flex; align-items: center; padding: 10px; }
.dropdown-user > div:last-child { margin-left: 10px; min-width: 0; }
.dropdown-user strong { display: block; font-size: var(--f-md); }
.dropdown-user span {
  display: block; margin-top: 3px; font-size: var(--f-xs); color: var(--faint);
  overflow: hidden; text-overflow: ellipsis;
}
.dropdown-divider { height: 1px; background: var(--line-soft); margin: 5px 0; }
.user-dropdown button {
  width: 100%; height: 38px; border: 0; background: #fff;
  text-align: left; padding: 0 10px; border-radius: 4px; cursor: pointer;
  color: #444; font: inherit; font-size: var(--f-md);
}
.user-dropdown button:hover { background: #f5f7fa; }
.user-dropdown button.logout { color: var(--danger); }

/* ── 페이징 — 목록은 모두 쪽으로 끊는다 ──────────────────────────────── */

.pager {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  height: 46px; border-top: 1px solid var(--line-soft);
}
.pager:empty { display: none; }
.pager .pager-info { color: var(--muted); }
.pager .pager-move { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pager .pager-now { color: var(--text); min-width: 68px; text-align: center; }
.pager select.input { width: 92px; flex: 0 0 auto; }

/* ── 본문 ────────────────────────────────────────────────────────────── */

.content { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0 22px 22px; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }

.card { display: flex; flex-direction: column; min-height: 0; }
.card + .card { margin-top: 18px; }

/* 안쪽 제목은 옅게 — 검은 띠는 위에 하나뿐이다 */
.card-head {
  height: 44px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line);
  font-size: var(--f-lg); font-weight: 600; color: var(--strong);
}
.card-head .count { font-size: var(--f-md); font-weight: 400; color: var(--faint); }
.card-head .head-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.card-body { padding: 12px 0; }
.card-body.tight { padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ── 지표 칩 ─────────────────────────────────────────────────────────── */

.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; flex-shrink: 0; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 14px; min-width: 118px; }
.stat .k { font-size: var(--f-sm); color: var(--muted); }
.stat .v { font-size: var(--f-num); font-weight: 600; color: var(--strong); margin-top: 1px; }
.stat.wide { flex: 1 1 320px; min-width: 260px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: var(--f-xs); background: #fafafa; border: 1px solid var(--line-soft); padding: 1px 7px; color: var(--muted); }
.chip b { color: var(--strong); margin-left: 3px; }
.chip.bad { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.chip.bad b { color: var(--danger); }

/* ── 탭 — 화면 위·상세 안이 같은 모양 ───────────────────────────────── */

.subtabs, .det-tabs {
  height: 54px; flex-shrink: 0;
  display: flex; align-items: flex-end;
  border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden;
}
.subtab, .det-tab {
  height: 42px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
  border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: var(--f-md);
}
.subtab:hover, .det-tab:hover { background: #fafafa; }
.subtab.active, .det-tab.on { color: var(--accent); font-weight: 600; }
.subtab.active::after, .det-tab.on::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px;
  height: 2px; background: var(--accent-bar);
}
.subtab b, .det-tab b { margin-left: 6px; font-size: var(--f-xs); font-weight: 600; color: var(--faint); }
.subtab.active b, .det-tab.on b { color: var(--accent); }
.subtab b.bad { color: var(--danger); }

/* 탭이 감싸는 화면 — 탭 아래가 남은 높이를 다 쓴다 */
.etab { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ── 도구줄 ──────────────────────────────────────────────────────────── */

.toolbar {
  height: 54px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line);
}
.toolbar + .toolbar { height: 46px; border-bottom-color: var(--line-soft); }
.toolbar .grow { flex: 1 1 auto; min-width: 60px; }
.toolbar .dim { white-space: nowrap; flex: 0 0 auto; }
/* 늘어나는 칸 옆의 단추는 눌려서 두 줄로 접힌다 — 글자 폭만큼은 지킨다 */
.toolbar .btn { flex: 0 0 auto; white-space: nowrap; }

/* ── 단추 ────────────────────────────────────────────────────────────── */

.btn {
  height: 38px; display: inline-flex; align-items: center; gap: 5px; padding: 0 13px;
  background: #fff; border: 1px solid var(--btn-line); border-radius: var(--radius);
  color: var(--muted); font: inherit; font-size: var(--f-md); cursor: pointer;
}
.btn:hover { background: #f5f5f5; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icon { color: var(--faint); }
.btn.primary { background: var(--nav); border-color: var(--nav); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #125cb0; border-color: #125cb0; }
.btn.danger { color: var(--danger); border-color: var(--danger-line); background: #fff; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { height: 32px; padding: 0 11px; font-size: var(--f-lg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #f1f1f1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* ── 입력 (콘솔 쪽) ──────────────────────────────────────────────────── */

.field { margin-bottom: 10px; }
.field label { display: block; font-size: var(--f-sm); font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid #ccc; border-radius: var(--radius); background: #fff;
  font: inherit; font-size: var(--f-md); color: #444;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 56px; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(52,120,216,.08); }
.input.sm { height: 34px; }
.field-row { display: flex; gap: 8px; }
.field-row > * { flex: 1; }
.hint { font-size: var(--f-xs); color: var(--hint); margin-top: 4px; }

/* ── 표 ── 머리 36px · 줄 35px · 한 줄이 한 항목 ─────────────────────── */

.table-wrap { flex: 1; min-height: 0; overflow: auto; }

table.grid { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
/* 라이선스는 칸 폭 합이 커서 따로 잡는다 — 이보다 좁아지면 표만 가로로 구른다 */
#viewLicense table.grid { min-width: 1180px; }
/* 좌우로 갈라 놓은 안은 폭이 반뿐이다. 여기서 900px 을 밀면 뒤 칸이 화면 밖으로 나간다. */
.split table.grid { min-width: 0; }
table.grid thead { position: sticky; top: 0; background: #fff; z-index: 3; }
table.grid th {
  height: 46px; padding: 0 12px;
  border-bottom: 1px solid var(--line-hard);
  color: #333; font-weight: 600; font-size: var(--f-list);
  text-align: center; white-space: nowrap;
}
/* 목록 글자는 본문보다 한 단 크다 — 표를 훑는 것이 이 화면의 일이라 여기가 주인공이다 */
table.grid td {
  height: 46px; padding: 0 12px; font-size: var(--f-list);
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  vertical-align: middle;
}
table.grid tbody tr:hover { background: var(--hover); }
table.grid tr.on { background: var(--ok-bg); }
/* 어긋난 것은 붉게 — 초록(tr.on)은 「지금 쓰는 것」이라는 뜻이라 정반대로 읽힌다 */
table.grid tr.row-bad { background: var(--danger-bg); }
table.grid tr.row-bad:hover { background: #fbdedb; }
table.grid tbody tr.sel, table.grid tbody tr.sel:hover { background: var(--sel); }
table.grid .num { text-align: right; }
table.grid .mid, table.grid th.mid { text-align: center; }
table.grid td.wrap { white-space: normal; overflow: visible; height: auto; padding: 7px; }
/* 단추 칸은 잘리면 안 된다 — 글꼴이 조금만 넓어도 끝 단추가 사라진다.
   뒤 빈 칸 쪽으로 넘치게 둔다. */
table.grid td.acts { overflow: visible; }
table.grid.pick tbody tr { cursor: pointer; }

.empty { text-align: center; padding: 28px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: var(--f-lg); }
/* 목록 글자가 흐리다는 지적을 받아 한 단 진하게(#555 12px → #444 13px). 표에서 눈이 미끄러졌다. */
.dim { color: #444; font-size: var(--f-lg); }
.dim.small { font-size: var(--f-sm); }
/* 줄 안 단추는 접히면 줄이 무너진다 — 한 줄로 세운다 */
table.grid .btn-row { flex-wrap: nowrap; }

/* ── 배지 ────────────────────────────────────────────────────────────── */

.pill {
  display: inline-block; padding: 1px 7px; border-radius: 3px;
  font-size: var(--f-sm); font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.pill.ok   { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok-line); }
.pill.off  { background: #f1f1f1;          color: var(--muted);  border-color: var(--line); }
.pill.bad  { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.pill.warn { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-line); }
.pill.info { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }

.pill.cat-판정     { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.pill.cat-로그인   { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-line); }
.pill.cat-라이선스 { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-line); }
.pill.cat-변조     { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.pill.cat-네트워크 { background: #f1f1f1;          color: var(--muted);  border-color: var(--line); }
.pill.cat-예외     { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.pill.cat-기타     { background: #f1f1f1;          color: var(--muted);  border-color: var(--line); }

/* ── 좌 목록 / 우 상세 ───────────────────────────────────────────────── */

.split { flex: 1; min-height: 0; display: flex; border-bottom: 1px solid var(--line); }
.split-l { width: var(--split-w, 48%); min-width: 470px; display: flex; flex-direction: column; min-height: 0; }
.split-r { flex: 1; min-width: 460px; display: flex; flex-direction: column; min-height: 0; }
.split-l .card, .split-r .card { flex: 1; min-height: 0; }

.split-bar { width: 34px; flex-shrink: 0; position: relative; cursor: col-resize; user-select: none; font-size: 0; }
.split-bar::before {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: #fff;
}
.split-bar::after {
  content: "◀▶"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #999; font-size: var(--f-sm); letter-spacing: -4px;
}
.split.dragging { user-select: none; cursor: col-resize; }

/* ── 상세 — 요약줄 · 타임라인 · 단계 표 ──────────────────────────────── */

.det-head { padding: 15px 12px 5px; flex-shrink: 0; }
.det-title { font-size: var(--f-lg); font-weight: 600; margin-bottom: 7px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.det-msg { color: var(--muted); margin-bottom: 7px; word-break: break-all; }
.det-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); }
.det-facts span { white-space: nowrap; }
.det-facts b { color: var(--strong); font-weight: 600; margin-left: 4px; }
.det-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.det-acts .btn { text-decoration: none; }

/* 발생 고르기 — 지문 하나에 이력이 최대 3건이다 */
.ev-pick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; flex-shrink: 0; }
.ev-btn {
  height: 28px; padding: 0 11px; border-radius: 14px; cursor: pointer;
  background: #fff; border: 1px solid var(--btn-line); color: var(--muted);
  font: inherit; font-size: var(--f-sm);
}
.ev-btn.on { background: var(--nav); border-color: var(--nav); color: #fff; }

/* 타임라인 — 회색 판 안에 흰 띠, 점선 테두리 */
.tl { margin: 7px 12px 0; background: #f5f5f5; padding: 20px 12px 0; flex-shrink: 0; }
.tl-wrap { position: relative; }
.tl-bar { position: relative; height: 27px; background: #fff; border: 1px dashed #aaa; overflow: hidden; }
.tl-seg { height: 100%; min-width: 2px; }
.tl-seg.s-cp    { background: var(--c-http); }
.tl-seg.s-wait  { background: repeating-linear-gradient(135deg, #e4e4e4 0 5px, #f4f4f4 5px 10px); }
.tl-seg.s-group { background: var(--c-db); }
.tl-seg.s-kb    { background: var(--c-method); }
.tl-seg.s-give  { background: var(--c-stack); }
.tl-seg.s-etc   { background: var(--c-etc); }
.tl-grid { position: absolute; inset: 0; pointer-events: none; }
.tl-grid i { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #bbb; }
.tl-axis { position: relative; height: 17px; padding-top: 4px; color: #444; font-size: var(--f-xs); }
.tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-axis span.edge-l { transform: none; left: 0; }
.tl-axis span.edge-r { transform: none; right: 0; }
.tl-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
  background: #f5f5f5; margin: 0 12px; padding: 4px 12px 9px;
  font-size: var(--f-xs); flex-shrink: 0;
}
.tl-legend span { display: inline-flex; align-items: center; gap: 4px; }
.tl-legend i { width: 10px; height: 10px; display: inline-block; }
.tl-none {
  margin: 7px 12px; padding: 11px 12px; flex-shrink: 0;
  color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line);
}

/* 단계 표 — 갭이 핵심이다. 기다린 시간이 여기서 드러난다 */
table.grid.steps { table-layout: fixed; }
table.grid.steps th { height: 38px; }
/* 칸 폭을 안 주면 fixed 가 균등으로 갈라 「내용」이 화면 밖으로 밀린다 */
table.grid.steps th:nth-child(1), table.grid.steps td:nth-child(1) { width: 46px; }
table.grid.steps th:nth-child(2), table.grid.steps td:nth-child(2) { width: 134px; }
table.grid.steps th:nth-child(3), table.grid.steps td:nth-child(3) { width: 68px; }
table.grid.steps th:nth-child(4), table.grid.steps td:nth-child(4) { width: 76px; }
table.grid.steps th:nth-child(5), table.grid.steps td:nth-child(5) { width: auto; }
table.grid.steps td { height: auto; padding: 7px 8px; vertical-align: top; white-space: normal; overflow: visible; }
table.grid.steps .gap-big { color: var(--danger); font-weight: 600; }
table.grid.steps .when { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
/* 칸 이름이 제목이고 색으로 무엇인지 가른다 (참조본의 DAO·Socket·MYSQL 처럼) */
.step-tag { font-weight: 600; margin-right: 7px; }
.step-tag.s-cp    { color: #7045c5; }
.step-tag.s-wait  { color: var(--faint); }
.step-tag.s-group { color: #008d8d; }
.step-tag.s-kb    { color: #d07a00; }
.step-tag.s-give  { color: var(--danger); }
.step-extra { font-family: var(--mono); font-size: var(--f-xs); color: var(--muted); }
/* 경과가 얼마나 나쁜가 — 8초↑ 빨강 · 3~8초 주황 · 그 아래 파랑 */
.lat-bad  { color: var(--danger); font-weight: 600; }
.lat-warn { color: var(--warn);   font-weight: 600; }
.lat-ok   { color: var(--accent); }

.det-pane { flex: 1; min-height: 0; overflow: auto; margin: 0 12px 12px; }
.det-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
/* 서버가 알려 준 까닭 — 이걸 감추면 왜 빈지 못 짚는다 */
.notice-why {
  margin: 14px auto 0; max-width: 620px; padding: 10px 12px;
  background: #fafafa; border: 1px solid var(--line-soft); border-radius: 4px;
  font-family: var(--mono); font-size: var(--f-sm); color: #444;
  text-align: left; word-break: break-all;
}

/* ── 원문 · 콜스택 ───────────────────────────────────────────────────── */

pre.raw {
  margin: 0; padding: 12px;
  background: #fafafa; color: #333; border: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: var(--f-sm); line-height: 1.55;
  overflow: auto; white-space: pre-wrap; word-break: break-all;
}
/* 추적은 "노드 내부 프레임 사이에서 우리 프레임을 찾는 일"이 전부다. 그래서 색으로 가른다. */
pre.raw .fr-head { color: var(--danger); font-weight: 600; }
pre.raw .fr-ours { color: #7045c5; font-weight: 600; }
pre.raw .fr-dim  { color: var(--hint); }

.stack-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 12px; background: #fafafa; border-bottom: 1px solid var(--line-soft);
}
.stack-head .dim { color: var(--faint); font-size: var(--f-xs); font-family: var(--mono); }

/* 그때의 입력 — 재현의 열쇠라 눈에 띄게 둔다 */
.trace-box { background: #fff; }
.trace-ev { border-top: 1px solid var(--line-soft); }
.trace-ev-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 12px; }
.trace-ev-head .dim { color: var(--faint); font-size: var(--f-xs); }
.trace-links { margin-left: auto; display: flex; gap: 6px; }
.trace-links .btn { text-decoration: none; }
.kv-row { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px 10px; }
.kv {
  font-size: var(--f-xs); font-family: var(--mono);
  background: #fafafa; border: 1px solid var(--line-soft); color: #444; padding: 3px 8px;
}
.kv i { font-style: normal; color: var(--faint); margin-right: 6px; }
.trace-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); }
.trace-label { padding: 6px 12px; font-size: var(--f-xs); color: var(--faint); background: #fafafa; }

/* ── 모달 ────────────────────────────────────────────────────────────── */

.modal {
  position: fixed; inset: 0; z-index: 6000;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card { background: #fff; border-radius: 6px; overflow: hidden; width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; }
.modal-head {
  height: 52px; background: var(--panel); color: #fff; padding: 0 16px;
  font-size: var(--f-lg); font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: 14px; }
.modal-foot { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.qr-wrap { text-align: center; padding: 6px 0 12px; }
.qr-wrap canvas, .qr-wrap svg { border: 1px solid var(--line); }
.secret-box {
  font-family: var(--mono); letter-spacing: 1px;
  background: #fafafa; border: 1px solid var(--line); border-radius: 5px;
  padding: 9px; word-break: break-all; text-align: center;
}

/* ── 토스트 ──────────────────────────────────────────────────────────── */

#toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 7000;
  background: var(--panel); color: #fff;
  padding: 11px 14px; border-left: 3px solid var(--accent-bar); border-radius: var(--radius);
  max-width: 380px;
}

/* ── 좁은 화면 ───────────────────────────────────────────────────────── */

/* ── 좁은 화면 ───────────────────────────────────────────────────────── */

@media (max-width: 1400px) {
  .logo { margin-right: 22px; }
  .nav-item { padding: 0 12px; font-size: var(--f-md); }
  .content { margin: 0 14px 14px; }
  .split-l { width: 46%; min-width: 400px; }
  .split-r { min-width: 380px; }
  .subtab, .det-tab { padding: 0 11px; font-size: var(--f-md); }
}

/* 좌우로 갈라 놓으면 양쪽 다 못 읽는 폭 — 위아래로 쌓는다 */
@media (max-width: 1150px) {
  .split { flex-direction: column; }
  .split-l, .split-r { width: 100%; min-width: 0; }
  .split-l { height: 46vh; }
  .split-bar { display: none; }
  .split-l .card, .split-r .card { flex: 1; }
}

@media (max-width: 980px) {
  .gnb { padding: 0 12px; }
  .logo-sub { display: none; }
  .logo { margin-right: 12px; }
  /* 메뉴가 넘치면 접는 대신 옆으로 굴린다 — 햄버거를 다시 만들지 않는다 */
  .main-menu { overflow-x: auto; scrollbar-width: none; }
  .main-menu::-webkit-scrollbar { display: none; }
  .gnb-btn span.icon + * { display: none; }
  .user-info, .user-arrow { display: none; }
  .user-area { padding: 0 4px; }
}

@media (max-width: 720px) {
  .logo-text { display: none; }
  .toolbar { height: auto; padding: 8px 0; flex-wrap: wrap; }
  .pager { height: auto; padding: 8px 0; flex-wrap: wrap; }
  .pager .pager-move { margin-left: 0; }
  .auth-card { padding: 24px 18px 20px; }
  .otp-input { width: 40px; height: 48px; }
}

/* 판정 사슬 — 스택이 없는 보고형 오류가 쓰는 자리 */
.chain { padding: 12px 14px; }
.chain-head { color: var(--muted); margin-bottom: 10px; line-height: 1.6; }
.chain-row { display: flex; align-items: center; gap: 8px; padding: 7px 0;
             border-bottom: 1px solid var(--line-soft); }
.chain-row:last-child { border-bottom: 0; }
.chain-up { width: 14px; color: var(--muted); text-align: center; flex: 0 0 auto; }
.chain-what { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-extra { color: var(--muted); font-size: 12px; flex: 0 1 auto; min-width: 0;
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-ms { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.btn.soft { color: var(--muted); border-color: var(--line-soft); }

.chain-at { flex: 0 0 auto; color: var(--muted); font-size: 12px; opacity: .75; }

/* 사슬의 회차 머리 — 같은 길을 되풀이한 회차는 한 줄로 접는다 */
.chain-round { margin: 10px 0 4px; padding: 4px 0; color: var(--accent); font-weight: 600;
               border-top: 1px dashed var(--line-soft); }
.fold-toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--muted);
               white-space: nowrap; flex: 0 0 auto; cursor: pointer; }

/* 오간 통신 — 콜스택 탭 아래. 판정이 실제로 묻고 받은 것을 원문 조각으로 보인다. */
.net-head { margin: 14px 0 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.net-clue {
  margin-top: 3px; padding: 2px 6px; border-left: 2px solid var(--accent-line);
  background: var(--accent-bg); color: var(--fg);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
  overflow-wrap: anywhere;
}
