/* 웹 터미널(탭·xterm 자리·접속 폼·상태 줄)과 VM 상세의 호스트 키 안내 */

.term {
  position: relative; display: flex; flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 170px); min-height: 460px;
  border-radius: 12px; overflow: hidden; background: var(--term-bg);
  border: 1px solid var(--term-border); box-shadow: var(--shadow-md);
}

/* ---------- 탭 ---------- */
.term__tabs { display: flex; align-items: flex-end; gap: 2px; padding: 8px 8px 0; background: var(--term-surface); border-bottom: 1px solid var(--term-border); }
.term__tablist { display: flex; align-items: flex-end; gap: 2px; min-width: 0; overflow-x: auto; }
.term__tab {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 12px;
  color: var(--term-muted); border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap; font-size: 12.5px;
  border: 1px solid transparent; border-bottom: 0;
}
.term__tab:hover { color: var(--term-text); background: rgba(255, 255, 255, 0.04); }
.term__tab:focus-visible { outline: 2px solid var(--term-path); outline-offset: -2px; }
.term__tab.is-active { color: var(--term-text); background: var(--term-bg); border-color: var(--term-border); margin-bottom: -1px; height: 35px; }
.term__tab .dot { background: var(--term-muted); }
.term__tab .dot--good { background: var(--term-user); }
.term__tab .dot--warn { background: var(--term-sys); }
.term__tab .dot--bad { background: var(--term-err); }
.term__tab-name { font-weight: 600; }
.term__tab-ip { font-family: var(--mono); font-size: 11px; color: var(--term-muted); }
.term__tab-close { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px; color: var(--term-muted); background: transparent; cursor: pointer; }
.term__tab-close:hover, .term__tab-close:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.12); }
.term__add { flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; margin: 0 0 3px 4px; border: 0; border-radius: 7px; color: var(--term-muted); background: transparent; cursor: pointer; }
.term__add:hover, .term__add:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* ---------- 터미널 자리: 탭마다 하나, 활성 탭만 붙어 있다 ---------- */
.term__stage { position: relative; flex: 1; min-height: 0; }
.term-pane { position: absolute; inset: 0; }
.term-pane__screen { position: absolute; inset: 10px 6px 6px 14px; }
.term-pane__screen .xterm { height: 100%; }
.term-pane__overlay {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background: rgba(10, 12, 16, 0.82);
}
.term-pane__overlay[hidden] { display: none; }

.term-login {
  display: flex; flex-direction: column; gap: 2px; width: min(380px, 100%); padding: 22px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.term-login__head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; line-height: 1.5; }
.term-login__head > .icon { margin-top: 3px; color: var(--primary-text); }
.term-login__dest { font-size: 12px; color: var(--muted); }
.term-login > .btn { justify-content: center; margin-top: 8px; }
.term-login__note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

.term-connecting { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--term-text); }
.term-ended { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 480px; text-align: center; color: var(--term-text); }
.term-ended__icon { color: var(--term-sys); }
.term-ended__msg { margin: 0; font-size: 13.5px; line-height: 1.65; }
.term-ended__actions { display: flex; gap: 8px; }

/* ---------- 상태 줄 ---------- */
.term__status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 14px;
  font-size: 12px; color: var(--term-muted); background: var(--term-surface); border-top: 1px solid var(--term-border);
}
.term__status .status--good { color: var(--term-user); }
.term__status .status--good .dot { box-shadow: none; background: var(--term-user); }
.term__status .status--warning { color: var(--term-sys); }
.term__status .status--critical { color: var(--term-err); }
.term__status .status--critical .dot { background: var(--term-err); }
.term__status .status--neutral { color: var(--term-muted); }
.term__status .muted { color: var(--term-muted); display: inline-flex; align-items: center; gap: 4px; }
.term__status .mono { font-family: var(--mono); }
.term__route { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); color: var(--term-text); }
.term__link { color: var(--term-path); }

/* ---------- VM 고르기 ---------- */
.picker { position: absolute; top: 46px; right: 8px; z-index: 10; width: 340px; padding: 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.picker__list { display: flex; flex-direction: column; margin-top: 6px; max-height: 320px; overflow-y: auto; }
.picker__item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; font: inherit; font-size: 13px; text-align: left; color: var(--text); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.picker__item:hover, .picker__item:focus-visible { background: var(--surface-hover); }
.picker__item .muted { font-size: 11.5px; }
.picker__none { padding: 10px; font-size: 12.5px; }

.term-empty .empty { padding: 64px 20px; }
.quick-open { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.quick-open .muted { font-size: 11.5px; font-weight: 400; }

/* ---------- VM 상세: 호스트 키 ---------- */
.hostkey { margin-top: 16px; }
.hostkey__fp { word-break: break-all; }
.hostkey__empty { margin: 0; padding: 4px 20px 18px; font-size: 12.5px; line-height: 1.6; }
.hostkey__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 20px 16px; }
.gw-hostkey { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.gw-hostkey > .icon { flex-shrink: 0; margin-top: 3px; }
.gw-hostkey code { word-break: break-all; }
