/* JARVIS 디자인 토큰 — Airbnb 톤 (2026-10-18 선택, 기준 문서 ../DESIGN.md).
   값은 MENTOR(web/frontend/src/index.css)와 같다. 흰 바탕 · 먹색 글자 · Rausch 는 로고에만. 다크 모드는 두지 않는다. */
:root {
  color-scheme: light;
  /* 면 — 바탕도 흰색이다 (회색 바탕 없음) */
  --bg: #ffffff;
  --surface-2: #f7f7f7;
  --raised: #f2f2f2;
  /* 선 */
  --line: #dddddd;
  --line-soft: #ebebeb;
  /* 글자 — --mute 보다 옅은 글자는 쓰지 않는다 (--faint 는 아이콘·빈 점 전용) */
  --ink: #222222;
  --body: #3f3f3f;
  --mute: #6a6a6a;
  --faint: #929292;
  --focus: #222222;
  /* Rausch — 글자가 없는 곳(로고 표시)만 */
  --accent: #ff385c;
  /* 상태 점 — 늘 글자와 함께 쓴다 */
  --live: #248a3d;
  --beta: #e08a00;
  /* 모양 — 이 넷 말고 다른 radius 는 쓰지 않는다 */
  --r-pill: 9999px;
  --r-lg: 20px;
  --r-card: 14px;
  --r-sm: 8px;
  /* 그림자는 한 단 — 떠 있는 것(호스트 pill · 보기 전환의 고른 쪽)에만. 타일 · 카드 · 단추에는 없다 */
  --float-shadow: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px 0, rgba(0, 0, 0, 0.1) 0 4px 8px 0;
  /* 글꼴 — Inter + Noto Sans KR (Airbnb Cereal 대신, web/fonts 에 들어 있다) */
  --font: 'Inter Variable', 'Noto Sans KR Variable', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    'Malgun Gothic', sans-serif;
  /* MENTOR 는 ui-monospace 가 먼저지만, Chrome 이 그것을 OS 기본 mono 로 바꿔 넣은 Geist Mono 가 쓰이지 않는다 — 넣은 글꼴을 먼저 둔다 */
  --mono: 'Geist Mono Variable', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* 모니터링 보기 — btop 테마 everforest-dark-hard 그대로 (v1.5.0, DESIGN.md §2). 이 보기에서만 어둡다 */
  --bt-bg: #2b3339; /* main_bg */
  --bt-panel: #323c41;
  --bt-dim: #3a454a; /* 빈 ■ 칸 · 쉬는 스레드 */
  --bt-line: #4b565c; /* box · div_line · selected_bg */
  --bt-fg: #d3c6aa; /* main_fg · title */
  --bt-mute: #9da9a0; /* 곁글자 — bt-bg 위 대비 5:1 */
  --bt-faint: #859289; /* 코어 번호만 */
  --bt-hi: #e67e80; /* hi_fg — 상자 제목 앞 번호 */
  --bt-sel: #dbbc7f; /* selected_fg */
  --bt-green: #a7c080; /* cpu_start · used_start */
  --bt-yellow: #dbbc7f; /* cpu_mid */
  --bt-red: #f85552; /* cpu_end */
  --bt-blue: #7fbbb3; /* cached_start */
  --bt-aqua: #83c092; /* cached_mid */
  --bt-lime: #8da101; /* download_start */
  --bt-orange: #e69875;
  --bt-deep: #cc241d; /* process_end */
  /* 폭 */
  --page-max: 1440px;
  --gutter: 80px;
}

@media (max-width: 1279px) {
  :root {
    --gutter: 40px;
  }
}

@media (max-width: 744px) {
  :root {
    --gutter: 24px;
  }
}

@media (max-width: 480px) {
  :root {
    --gutter: 16px;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.43;
  /* 한글은 낱말(어절) 단위로 줄을 바꾼다. 한 낱말이 칸보다 길면 그 안에서 끊는다 */
  word-break: keep-all;
  overflow-wrap: break-word;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* 본문 폭 — 상단바 · 본문 · footer 가 같은 선에 선다 */
.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  box-sizing: border-box;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ── 상단바 ── */
.topbar {
  border-bottom: 1px solid var(--line-soft);
}

.topbar .wrap {
  min-height: 80px;
  padding-top: 16px;
  padding-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.brand-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--r-sm);
  color: var(--accent);
  text-decoration: none;
}

/* 이름 + 버전 (JARVIS v1.0.0) — 버전은 이름의 글자 바닥선에 맞춘 작고 옅은 글자 (PEERS .brand-version 과 같은 모양) */
.brand-name {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.brand-version {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--mute);
}

/* 관리자 페이지 제목 (v1.13.0) — 보기 전환 왼쪽. 첫 화면은 제목 없이 상태별 개수 */
.admin-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

/* ── 본문 ── */
main {
  flex: 1;
  padding-top: calc(20px * var(--k, 1));
}

/* 페이지 제목은 화면에 보이지 않게 둔다 — 화면 낭독기 · 문서 개요용 (2026-10-18 보이는 제목 「어느 시스템으로 갈까요?」 삭제) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 상태별 개수와 보기 전환(관리자 페이지) · 바로가기(첫 화면) 한 줄 — 그룹 위에 (좁으면 오른쪽 것이 둘째 줄로) */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 40px;
}

/* 상태별 개수 — hairline 으로 나눈 칸, 칸마다 한 줄(숫자 · 점 · 상태) */
.counts {
  flex: 0 1 auto;
  display: flex;
  margin: 0;
  box-sizing: border-box;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.count {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.count + .count {
  border-left: 1px solid var(--line-soft);
}

.count dd {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.count dt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--mute);
  white-space: nowrap;
}

/* 바로가기(v1.21.0 — 시안 B 「작은 앱 둘」) — 상태 개수 오른쪽의 MSDL 홈페이지 · MONITOR. 따로 선 판 둘(radius 14), 판마다 아이콘 40 · 이름 · 분류.
   테두리 · hover 는 타일과 같다. --k 로 줄이지 않는다(개수 칸처럼 글자 크기 그대로). 좁으면 판이 다음 줄로 */
.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  padding: 7px 20px 7px 7px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}

.quick-link:hover {
  border-color: var(--faint);
}

.quick-icon {
  flex: none;
  display: block;
  width: 40px;
  height: 40px;
}

.quick-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.quick-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.quick-category {
  font-size: 12px;
  line-height: 1.3;
  color: var(--mute);
  white-space: nowrap;
}

/* 상태 점 — 운영 중 · 시범 운영은 채운 점, 개발 중은 빈 점 */
.dot {
  flex: none;
  width: 8px;
  height: 8px;
  box-sizing: border-box;
  border-radius: var(--r-pill);
  border: 2px solid var(--faint);
}

.dot-live {
  background: var(--live);
  border-color: var(--live);
}

.dot-beta {
  background: var(--beta);
  border-color: var(--beta);
}

/* ── 그룹 — 업무관리 · 연구개발 … 그룹마다 런처(또는 기술 카드)를 모두 펼친다 ── */
.groups[hidden] {
  display: none;
}

.groups {
  margin-top: calc(20px * var(--k, 1));
  display: flex;
  flex-direction: column;
  gap: calc(24px * var(--k, 1));
}

.group {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--k, 1));
  min-width: 0;
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: calc(44px * var(--k, 1));
}

.group-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-width: 0;
}

.group-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.group-count {
  font-weight: 600;
}

.group-desc {
  color: var(--mute);
}

/* ── 보기 전환 — 아이콘 · 기술스택 · 모니터링 (상태별 개수 오른쪽). 고른 쪽만 흰 면이 떠 있다 ── */
.view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-pill);
  background: var(--raised);
}

.view-switch button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--mute);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.view-switch button[aria-pressed='true'] {
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--float-shadow);
}

/* ── 아이콘 — 런처 (2026-10-19 P4). 128px 칸을 채운다 — 1440 아홉 · 1024 여섯 · 390 둘 ──
   첫 화면이 창보다 길면(v1.19.0) app.js 가 body 에 --k(0.6–1)를 주어 칸 · 판 여백 · 아이콘 · 사이를 같은 비율로 줄인다 — 글자는 그대로.
   칸은 92px 아래로 줄지 않는다(가장 긴 글자 「ARACHNE」 74 + 판 여백 · 테두리 18). --k 가 없으면(관리자 페이지 · 넉넉한 창) 지금 크기 */
.launcher {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(92px, calc(128px * var(--k, 1))), 1fr));
  gap: calc(12px * var(--k, 1));
}

/* 타일 — 열 주소가 있으면 판 전체가 링크(a), 없으면 누를 수 없는 점선 판(div.is-locked) */
.tile {
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}

.tile.is-locked {
  border-style: dashed;
  border-color: var(--line);
}

a.tile:hover {
  border-color: var(--faint);
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(6px * var(--k, 1));
  padding: calc(18px * var(--k, 1)) 8px calc(14px * var(--k, 1));
  text-align: center;
}

.tile-icon {
  position: relative;
  display: block;
}

/* 시스템 아이콘 — 그 시스템 화면이 쓰는 아이콘(web/icons). 런처 72 · 기술 카드 40 */
.sys-icon {
  flex: none;
  display: block;
  width: calc(72px * var(--k, 1));
  height: calc(72px * var(--k, 1));
}

/* 아이콘이 아직 없는 시스템 — 점선 칸에 첫 글자 */
.sys-icon-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px dashed var(--faint);
  border-radius: var(--r-card);
  font-size: 24px;
  font-weight: 700;
  color: var(--mute);
}

/* 열 주소가 없을 때 아이콘 모서리의 자물쇠 */
.tile-lock {
  position: absolute;
  right: calc(-6px * var(--k, 1));
  bottom: calc(-6px * var(--k, 1));
  width: max(20px, calc(26px * var(--k, 1)));
  height: max(20px, calc(26px * var(--k, 1)));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--mute);
}

.tile-name {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.tile-category {
  font-size: 12px;
  line-height: 1.3;
  color: var(--mute);
}

.tile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.33;
  color: var(--body);
}

.is-locked .tile-status {
  color: var(--mute);
}

/* ── 기술스택 — 시스템 리스트 (시안 L2, v1.6.0). 한 줄 = 시스템 하나 — 시스템 · 상태 · 주소 · 화면 · 서버 · DB · AI · 디자인.
   기술은 칩 하나씩: 회색 = 다른 시스템도 쓴다, 테두리 = 이 시스템만, 점선 = 일부(「덱만」). 쓰는 곳 수 · 칩 읽는 법은 v1.15.0 에 지웠다.
   줄 전체가 링크(열 주소가 없으면 div). 1440 아래는 줄이 둘(시스템 · 상태 · 주소 / 다섯 층 — 한 줄 표는 칩 이름이 접힌다), 720 아래는 층마다 한 줄 ── */
.slist-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.slist-top p {
  margin: 0;
  font-size: 15px;
}

.slist-head,
.srow {
  display: grid;
  grid-template-columns: 208px 100px 124px minmax(0, 1.2fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr);
}

.slist-head {
  margin-bottom: -12px;
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
}

.slist-head > span {
  padding: 0 10px 10px;
}

.slist {
  border-top: 1px solid var(--line);
}

.srow {
  position: relative;
  min-height: 64px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.15s;
}

a.srow:hover {
  background: var(--surface-2);
}

.srow-sys,
.srow-state,
.srow-where,
.srow-cell,
.srow-undecided {
  min-width: 0;
  padding: 12px 10px;
  display: flex;
  align-items: center;
}

.srow-sys {
  gap: 12px;
}

.srow .sys-icon {
  flex: none;
  width: 32px;
  height: 32px;
}

.srow .sys-icon-blank {
  font-size: 14px;
}

.srow-title,
.srow-state,
.srow-where {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.srow-title {
  display: flex;
}

.srow-name {
  font-size: 14px;
  font-weight: 700;
}

.srow-sub {
  font-size: 12px;
  color: var(--mute);
}

.srow-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.srow-ver {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}

.srow-addr {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

/* 다섯 층 — 넓으면 줄의 칸으로 바로 들어간다(display: contents) */
.srow-stack {
  display: contents;
}

.srow-label {
  display: none;
}

.srow-chips {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 6px;
}

.srow-none {
  font-size: 13px;
  color: var(--mute);
}

.srow-undecided {
  grid-column: 4 / -1;
  gap: 14px;
  font-size: 13px;
  color: var(--mute);
}

.srow-undecided::after {
  content: '';
  flex: 1;
  border-top: 1px dashed var(--line);
}

/* 칩 — 쓰는 곳 수는 이름 끝에 붙어 함께 접히고, 「일부」 글은 좁으면 다음 줄로 */
.chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
  max-width: 100%;
  min-height: 26px;
  box-sizing: border-box;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.chip > span:first-child {
  min-width: 0;
}

.chip.is-shared {
  border-color: transparent;
  background: var(--raised);
  font-weight: 600;
}

.chip.is-part {
  border-style: dashed;
}

.chip.is-shared.is-part {
  border-color: var(--faint);
}

.chip-note {
  font-size: 12px;
  font-weight: 400;
  color: var(--mute);
  white-space: nowrap;
}

@media (max-width: 1439px) {
  .slist-head {
    display: none;
  }

  .srow {
    grid-template-columns: minmax(0, 1fr) 120px 160px;
  }

  .srow-stack {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 0.9fr);
    padding-bottom: 6px;
  }

  .srow-cell {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
    padding-top: 0;
  }

  .srow-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--mute);
  }

  .srow-chips {
    align-content: flex-start;
  }

  .srow-undecided {
    grid-column: 1 / -1;
    padding-top: 0;
  }
}

@media (max-width: 719px) {
  .srow {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .srow-sys {
    grid-column: 1 / -1;
    padding-bottom: 6px;
  }

  .srow-state,
  .srow-where {
    padding-top: 0;
  }

  .srow-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .srow-cell {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: start;
    padding: 3px 10px;
  }

  .srow-label {
    padding-top: 4px;
  }
}

/* ── footer ── */
.foot {
  margin-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.foot .wrap {
  padding-top: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mute);
}

/* ── 모니터링 (v1.5.0 — 시안 B1 「btop 그대로」) ──
   html.is-monitor 일 때만 어둡다 — 상단바를 56px 로 줄이고 보기 스위치를 그 가운데로 올린다(넓은 화면), 상태 개수 · footer 는 숨긴다.
   1100px 넘는 화면에서는 한 화면에 다 든다(높이 = 100dvh - 상단바 57 - 위아래 20, 창 높이 650 안팎까지 — 1366 노트북 창 657 · 125% 배율 1536×730).
   남는 높이는 cpu 3 · gpu 1 · 아래 4 로 나눠 그래프 · 목록 자리(.bt-slot · .bt-prows)가 받는다 — 점 칸 수 · 목록 줄 수는 monitor.js 가 그 자리를 재서 정한다.
   좁으면 상자가 쌓이고 아래로 길어진다.
   크기 · 색은 monitor.js 가 data-* 로 적고 CSSOM 으로 넣는다 (CSP style-src 'self'). 그래프 점 · ■ 칸은 데이터 표시라 작은 radius(1px) */
html.is-monitor,
html.is-monitor body {
  background: var(--bt-bg);
  color: var(--bt-fg);
  color-scheme: dark;
}

.is-monitor :focus-visible {
  outline-color: var(--bt-sel);
}

.is-monitor .topbar {
  border-bottom-color: var(--bt-line);
}

.is-monitor .topbar .wrap {
  max-width: none;
  min-height: 56px;
  padding: 4px 16px;
}

.is-monitor .brand-name {
  font-size: 18px;
  color: var(--bt-fg);
}

.is-monitor .brand-version {
  color: var(--bt-mute);
}

.is-monitor .admin-title,
.is-monitor .counts,
.is-monitor .foot {
  display: none;
}

.is-monitor .logout {
  border-color: var(--bt-line);
  background: transparent;
  color: var(--bt-fg);
}

.is-monitor .logout[aria-current='page'] {
  border-color: transparent;
  background: var(--bt-panel);
}

.is-monitor .view-switch {
  background: var(--bt-panel);
}

.is-monitor .view-switch button {
  color: var(--bt-mute);
}

.is-monitor .view-switch button[aria-pressed='true'] {
  background: var(--bt-line);
  color: var(--bt-sel);
  box-shadow: none;
}

.is-monitor main.wrap {
  max-width: none;
  padding: 12px 12px 8px;
}

.is-monitor .hero {
  justify-content: center;
}

.monitor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--bt-fg);
  font-variant-numeric: tabular-nums;
}

.monitor[hidden] {
  display: none;
}

@media (min-width: 1100px) {
  .is-monitor .hero {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
  }

  .is-monitor .monitor {
    margin-top: 0;
    height: calc(100vh - 77px);
    height: calc(100dvh - 77px);
    min-height: 570px;
  }
}

.bt-mute {
  color: var(--bt-mute);
}

.bt-num {
  text-align: right;
  white-space: nowrap;
}

.bt-box {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  padding: 12px 10px 8px;
  border: 1px solid var(--bt-line);
  border-radius: 10px;
}

/* 상자 제목은 btop 처럼 테두리 위에 — 왼쪽 이름(앞 번호는 hi_fg), 가운데 시각, 오른쪽 곁글자 */
.bt-t {
  position: absolute;
  top: -9px;
  padding: 0 6px;
  background: var(--bt-bg);
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}

.bt-t.l {
  left: 12px;
}

.bt-t.l2 {
  left: calc(50% + 6px);
}

.bt-t.c {
  left: 50%;
  transform: translateX(-50%);
}

.bt-t.r {
  right: 12px;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  color: var(--bt-mute);
}

.bt-t.is-lost {
  color: var(--bt-red);
}

.bt-key {
  color: var(--bt-hi);
}

.bt-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.bt-svg {
  display: block;
}

/* 그래프 자리 — 크기는 배치가 정하고, monitor.js 가 재서 그 칸 수 · 줄 수만큼 점을 찍는다. 그림은 자리 크기를 바꾸지 않는다(absolute) */
.bt-slot {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 96px;
  overflow: hidden;
}

.bt-slot > .bt-svg {
  position: absolute;
  top: 0;
  left: 0;
}

.bt-cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 16px;
  color: var(--bt-mute);
}

.bt-cap b {
  color: var(--bt-fg);
}

.bt-meter {
  display: flex;
  gap: 2px;
}

.bt-meter > span {
  flex: 1;
  height: 9px;
  border-radius: 1px;
}

.bt-cpu {
  flex: 3 1 auto;
  display: flex;
  gap: 12px;
}

.bt-graph {
  flex: 1 1 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bt-sock {
  flex: none;
  width: 340px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px;
  border: 1px solid var(--bt-line);
  border-radius: 8px;
}

.bt-cpu-meter {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 42px 36px 62px;
  align-items: center;
  gap: 6px;
}

/* 코어 칸은 줄 12px 부터 — CPU 상자가 커지면 줄이 같이 커지고 스레드 막대도 길어진다(24px 까지) */
.bt-cores {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: minmax(12px, 1fr);
  gap: 1px 6px;
}

.bt-core {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}

.bt-core > span {
  font-size: 10px;
  line-height: 12px;
  color: var(--bt-faint);
}

.bt-core > i {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: calc(100% - 2px);
  min-height: 10px;
  max-height: 24px;
}

.bt-core > i > span {
  width: 4px;
}

.bt-ccd {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.bt-model {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bt-gpus {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 12px;
}

.bt-gpus.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* GPU 상자 — 그래프 · 계기 · 그 GPU 를 쓰는 프로세스 세 칸. 상자가 좁으면(GPU 둘이 나란하거나 좁은 화면) 프로세스 칸이 아래로 */
.bt-gpu {
  display: flex;
  flex-direction: column;
  container-type: inline-size;
}

.bt-gpu-in {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
}

.bt-gpu .bt-graph {
  flex: 1 1 260px;
}

.bt-gpu .bt-slot {
  min-height: 64px;
}

.bt-gpu-meters {
  flex: 0 0 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.bt-gprocs {
  flex: 0 0 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  border-left: 1px solid var(--bt-line);
}

/* 줄 수는 자리 높이로 정한다(contain: size — 줄이 많아도 상자가 커지지 않는다) */
.bt-gprows {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  contain: size;
}

.bt-gprow {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 80px 52px;
  gap: 8px;
}

.bt-gprow > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bt-gprow.is-head {
  padding-bottom: 2px;
  font-weight: 700;
}

@container (max-width: 980px) {
  .bt-gpu-in {
    flex-wrap: wrap;
  }

  .bt-gprocs {
    flex-basis: 100%;
    padding: 6px 0 0;
    border-left: 0;
    border-top: 1px solid var(--bt-line);
  }

  .bt-gprows {
    flex: none;
    contain: none;
  }
}

@container (max-width: 640px) {
  .bt-gpu-meters {
    flex-basis: 100%;
  }
}

.bt-gm {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 126px;
  align-items: center;
  gap: 8px;
}

.bt-bottom {
  flex: 4 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 10px 12px;
}

.bt-left {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* mem · net 은 내용보다 작아지지 않는다 — 모자라면 잘리지 않고 문서가 길어진다 */
.bt-mem {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.bt-mem-col {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bt-disks {
  padding-left: 12px;
  border-left: 1px solid var(--bt-line);
}

.bt-mrow {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 34px 64px;
  align-items: center;
  gap: 6px;
}

.bt-drow {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 62px;
  align-items: center;
  gap: 6px;
}

.bt-io {
  white-space: nowrap;
}

.bt-io > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-net {
  flex: 1;
  display: flex;
  gap: 12px;
}

.bt-net .bt-slot {
  min-height: 64px;
}

/* 눈금 — btop net_auto 로 정한 그래프 꼭대기 값 */
.bt-scale {
  position: absolute;
  top: 0;
  left: 0;
  padding-right: 4px;
  background: var(--bt-bg);
  font-size: 10px;
  line-height: 12px;
  color: var(--bt-faint);
}

.bt-net-side {
  flex: none;
  width: 168px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bt-down {
  font-weight: 700;
  color: var(--bt-green);
}

.bt-upl {
  font-weight: 700;
  color: var(--bt-orange);
}

.bt-proc {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 6px;
}

/* 줄은 안쪽에서 자른다 — 상자에 overflow 를 걸면 테두리 위 제목까지 잘린다. 줄 수는 자리 높이로 정한다(contain: size) */
.bt-prows {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  contain: size;
  display: flex;
  flex-direction: column;
}

.bt-prow {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 56px 96px 64px 120px;
  gap: 8px;
  flex: none;
  padding: 0 6px;
  border-radius: 3px;
}

.bt-prow > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bt-prow.is-head {
  padding-bottom: 2px;
  font-weight: 700;
}

.bt-prow.is-sel {
  background: var(--bt-line);
  color: var(--bt-sel);
}

.bt-pcpu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.bt-pcpu > i {
  display: flex;
  gap: 1px;
}

.bt-pcpu > i > span {
  width: 5px;
  height: 9px;
  border-radius: 1px;
}

.bt-pcpu > b {
  width: 40px;
  font-weight: 400;
  text-align: right;
}

@media (max-width: 1099px) {
  .bt-cpu,
  .bt-net {
    flex-wrap: wrap;
  }

  /* 쌓이면 높이가 정해지지 않으므로 그래프 · 목록 자리에 높이를 준다 */
  .bt-cpu .bt-slot {
    min-height: 160px;
  }

  .bt-gpu .bt-slot {
    min-height: 112px;
  }

  .bt-net .bt-slot {
    flex-basis: 100%;
    min-height: 128px;
  }

  .bt-prows {
    flex: none;
    height: 480px;
  }

  .bt-gpus.is-two,
  .bt-bottom,
  .bt-mem {
    grid-template-columns: minmax(0, 1fr);
  }

  .bt-sock,
  .bt-net-side {
    width: 100%;
  }

  .bt-disks {
    padding: 6px 0 0;
    border-left: 0;
    border-top: 1px solid var(--bt-line);
  }

  .bt-t.l2 {
    display: none;
  }

  .bt-prow {
    grid-template-columns: 62px minmax(0, 1fr) 40px 72px 52px 52px;
  }

  .bt-gprow {
    grid-template-columns: 62px minmax(0, 1fr) 72px 52px;
  }

  .bt-pcpu > i {
    display: none;
  }
}

/* ── 상단바 오른쪽 — 관리 · 로그아웃 (v1.13.0 — 호스트 pill 은 지웠다). 「관리」는 링크지만 같은 pill ── */
.topbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.logout {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.logout:hover {
  border-color: var(--faint);
}

a.logout {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  text-decoration: none;
}

.logout[aria-current='page'] {
  border-color: transparent;
  background: var(--raised);
}

.logout:disabled {
  color: var(--mute);
  border-color: var(--line-soft);
  cursor: default;
}

/* 상단바 단추 글자는 12(v1.20.0 — 사용자 「관리 로그아웃 글짜 크기가 너무 커 … 2단계」, 14 → 12). 보안 판 · 경고 창의 같은 단추는 14 그대로 */
.topbar .logout {
  font-size: 12px;
}

/* 앱 설치(v1.18.0 — 데스크탑 앱) — 브라우저가 설치할 수 있다고 알려 올 때만 보인다(app.js). 표시는 글자에 맞춰 16 */
.install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.install svg {
  width: 16px;
  height: 16px;
}

.install[hidden] {
  display: none;
}

/* ── 로그인 판 (login.html, v1.8.0 — PEERS 로그인과 같은 꼴) — 상단바 · footer 없이 창 가운데 판 하나.
   판 머리에 표시(Rausch) · 이름 JARVIS · 부제, 두 단계(아이디 · 비밀번호 → OTP 6자리), 판 밖에 잠금 안내 한 줄.
   흰 글자 주 단추는 쓰지 않는다(§1) — 단추는 먹색 테두리 pill ── */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-stack {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--bg);
}

/* 표시는 이름(JARVIS) 줄의 가운데에 (PEERS 4.9.1). 부제 · 판 밖 잠금 안내는 v1.14.0 에 지웠다(사용자) */
.login-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.login-mark {
  flex: none;
  margin-top: calc((28px * 1.14 - 28px) / 2);
  color: var(--accent);
}

.login-brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* 이름 + 버전 — MENTOR 로그인과 같다: 버전은 이름 글자 바닥선에 맞춘 작고 옅은 mono 글자 */
.login-brand-text h1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.14;
}

.login-version {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--mute);
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px;
  }
}

.login-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-step[hidden],
.login-button[hidden],
.field[hidden] {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.field input:focus {
  border-color: var(--ink);
  outline: none;
}

.field input.otp {
  min-height: 56px;
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 0.3em;
  text-align: center;
}

/* 칸 앞 표시(사람 · 자물쇠)와 비밀번호 보기 단추 — 칸 안에 겹쳐 둔다 */
.login-input {
  position: relative;
  display: block;
}

.login-input > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--mute);
  pointer-events: none;
}

.login-input input {
  padding-left: 40px;
}

.login-input input[type='password'],
.login-input input.is-revealed {
  padding-right: 48px;
}

.login-reveal {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: var(--mute);
  cursor: pointer;
}

.login-reveal:hover {
  color: var(--ink);
}

.login-reveal .eye,
.login-reveal[aria-pressed='true'] .eye-off {
  display: none;
}

.login-reveal[aria-pressed='true'] .eye {
  display: block;
}

.login-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.login-button:hover {
  background: var(--surface-2);
}

.login-button:disabled {
  color: var(--mute);
  border-color: var(--line);
  cursor: progress;
}

.login-back {
  align-self: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--body);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-card);
  background: #fdeceb;
  font-size: 13px;
}

.login-alert::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: var(--r-pill);
  background: #f85552;
}

.login-alert[hidden] {
  display: none;
}

/* 오류가 아닌 안내(자동 로그아웃 까닭 · 저장했습니다) — 회색 */
.login-alert.is-info {
  background: var(--surface-2);
}

.login-alert.is-info::before {
  background: var(--faint);
}

/* ── 관리자 페이지 「보안」 (v1.13.0) — 판 넷을 두 단으로(좁으면 한 단). 판은 로그인 판과 같은 선 · radius,
   켜고 끄기는 스위치, 시간은 고르기(목록), 저장은 로그인 판의 칸 · 단추 그대로 ── */
.security {
  padding-top: 32px;
}

.sec {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

@media (max-width: 1023px) {
  .sec {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sec-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.sec-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
}

.sec-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.sec-count {
  margin-left: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mute);
}

.sec-row,
.sec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sec-row + .sec-row,
.sec-sub + .sec-row {
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.sec-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sec-name {
  font-weight: 600;
  color: var(--ink);
}

.sec-desc {
  margin: 0;
  font-size: 13px;
  color: var(--mute);
}

.sec-mono {
  font-family: var(--mono);
}

/* 비활동 아래 칸 — 「입력 없이 20분」 · 「경고 2분 전」. 비활동을 끄면 옅게 */
.sec-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: -4px;
}

.sec-sub.is-off {
  opacity: 0.5;
}

.sec-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--body);
}

.sec-pick select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.sec-pick select:focus {
  border-color: var(--ink);
  outline: none;
}

.sec-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sec-item {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}

.sec-item:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.sec-item .logout,
.sec-card > .logout {
  flex: none;
  align-self: flex-start;
}

.sec-item .logout {
  align-self: center;
}

.sec-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--raised);
  font-size: 12px;
  font-weight: 600;
  color: var(--body);
}

/* 스위치 — 체크 상자를 그대로 두고(키보드 · 화면 낭독기) 그 위에 그린다. 켜면 먹색 */
.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-ui {
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  background: var(--line);
  transition: background-color 0.15s;
  pointer-events: none;
}

.switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--bg);
  box-shadow: var(--float-shadow);
  transition: transform 0.15s;
}

.switch input:checked + .switch-ui {
  background: var(--ink);
}

.switch input:checked + .switch-ui::after {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch-ui {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── 자동 로그아웃 경고 (session.js, v1.13.0) — 화면 가운데 판, 바탕은 옅게 가린다. 모니터링(어두운 화면)에서도 같은 흰 판 ── */
.idle {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(34, 34, 34, 0.4);
}

.idle[hidden] {
  display: none;
}

.idle-card {
  width: 100%;
  max-width: 380px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--float-shadow);
  font-family: var(--font);
  text-align: center;
}

.idle-card h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.idle-card p {
  margin: 0;
  font-size: 14px;
  color: var(--body);
}

.idle-card .idle-clock {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.idle-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.idle-actions .login-button[hidden] {
  display: none;
}

.idle-actions .logout {
  min-height: 48px;
}

/* 모니터링(어두운 화면) 위에서도 판 안은 흰 판의 색 그대로 */
.is-monitor .idle .logout {
  border-color: var(--line);
  background: var(--bg);
  color: var(--ink);
}

.is-monitor .idle :focus-visible {
  outline-color: var(--focus);
}

@media (prefers-reduced-motion: reduce) {
  .tile,
  .quick-link,
  .srow,
  .view-switch button,
  .switch-ui,
  .switch-ui::after {
    transition: none;
  }
}
