:root {
  --bg: #0f1116; --panel: #161a22; --border: #2a3040;
  --text: #e2e8f0; --muted: #8b93a7; --accent: #7ee787; --error: #ff7b72;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, sans-serif;
  display: flex; flex-direction: column;
}
.hidden { display: none !important; }

/* login */
.overlay {
  position: fixed; inset: 0; background: rgba(5, 7, 10, 0.9);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px; width: min(360px, 92vw); display: flex; flex-direction: column; gap: 12px;
}
.card h1 { margin: 0; font-size: 20px; }
.muted { color: var(--muted); margin: 0; }
input, textarea, select {
  background: #0b0e13; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; font: inherit; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
button {
  background: var(--accent); color: #08130a; border: 0; border-radius: 8px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.ghost:hover:not(:disabled) { color: var(--text); }
.error { color: var(--error); min-height: 1em; margin: 0; font-size: 13px; }

/* header */
header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; }
.status { display: flex; align-items: center; gap: 7px; color: var(--muted); flex: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.connected { background: var(--accent); }
.dot.connecting { background: #e3b341; }
.dot.error { background: var(--error); }

main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* connection form */
#conn-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--border);
}
#conn-form input, #conn-form select, #conn-form textarea { width: auto; }
#f-host { flex: 2 1 170px; }
#f-port { width: 80px; }
#f-username { flex: 1 1 110px; }
#f-password { flex: 1.5 1 140px; }
#f-key { flex: 1 1 100%; font-family: ui-monospace, monospace; }
#f-passphrase { flex: 1 1 140px; }
.btns { display: flex; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.chip {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 400;
}
.chip:hover { color: var(--text); border-color: var(--accent); }

/* terminal */
#terminal { flex: 1; min-height: 0; padding: 6px 0 6px 8px; }