* { box-sizing: border-box; margin: 0; }
:root {
  --bg: #0d1117; --fg: #e6edf3; --dim: #8b949e; --line: #21262d;
  --accent: #2f81f7; --ok: #3fb950; --warn: #d29922; --bad: #f85149;
}
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-top: env(safe-area-inset-top);
}
.hidden { display: none !important; }
.view { min-height: 100dvh; display: flex; flex-direction: column; }
.view.center { justify-content: center; align-items: center; gap: 14px; padding: 24px; text-align: center; }
h1 { font-size: 28px; }
.sub { color: var(--dim); }
.small { font-size: 13px; }
.small a { color: var(--accent); }
.msg { color: var(--warn); min-height: 1.5em; font-size: 14px; }
input {
  width: 100%; max-width: 340px; padding: 12px 14px; font-size: 16px;
  background: #161b22; color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px;
}
button {
  font-size: 15px; border: 1px solid var(--line); border-radius: 10px;
  background: #21262d; color: var(--fg); padding: 8px 14px; cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.big { width: 100%; max-width: 340px; padding: 14px; font-size: 17px; }
button.ghost { background: none; border: none; font-size: 20px; }
button.danger { color: var(--bad); }

header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; }
.who { color: var(--dim); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 10px; top: 52px; z-index: 10;
  background: #161b22; border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; overflow: hidden;
}
.menu button { border: none; border-radius: 0; text-align: left; padding: 12px 16px; background: none; }
.menu button:active { background: var(--line); }

#sessions, #users { list-style: none; overflow-y: auto; flex: 1; }
#sessions li, #users li {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.glyph { font-size: 13px; width: 1em; }
.glyph.attached, .glyph.multi { color: var(--ok); }
.glyph.detached { color: var(--dim); }
.glyph.dead { color: var(--bad); }
.sname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sstate { color: var(--dim); font-size: 12px; }
.empty { color: var(--dim); text-align: center; padding: 40px 0; }

#view-term { height: 100dvh; }
.termbar { padding: 6px 10px; }
#terminal { flex: 1; min-height: 0; padding: 2px; }
.keybar {
  display: flex; gap: 6px; padding: 6px; overflow-x: auto;
  border-top: 1px solid var(--line);
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
.keybar button { padding: 8px 12px; font-size: 14px; flex-shrink: 0; }
