* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #0b0d10;
  color: #e6e8eb;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #14171c;
  border-bottom: 1px solid #1f242c;
  height: 40px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #cbd5e1;
  padding-right: 10px;
  border-right: 1px solid #1f242c;
  height: 100%;
  margin-right: 4px;
}
.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-thumb { background: #2a313b; border-radius: 4px; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px 0 12px;
  border-radius: 7px;
  background: #1b2027;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
  font-size: 12px;
  max-width: 220px;
}
.tab:hover { background: #232932; color: #cbd5e1; }
.tab.active {
  background: #0b0d10;
  color: #f1f5f9;
  border-color: #2a313b;
  box-shadow: inset 0 -2px 0 #6366f1;
}
.tab .label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.tab .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #475569;
  flex-shrink: 0;
}
.tab.active .pulse { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
.tab.detached .pulse { background: #f59e0b; }

.tab .close {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
}
.tab .close:hover { background: #334155; color: #f1f5f9; }

.add-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a313b;
  background: #1b2027;
  color: #94a3b8;
  border-radius: 7px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.add-btn:hover { background: #232932; color: #f1f5f9; }

.spacer { flex: 1; }
.status {
  font-size: 11px;
  color: #64748b;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status .led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
}
.status.ok .led { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
.status.err .led { background: #ef4444; }

main#panes {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.pane {
  position: absolute;
  inset: 0;
  padding: 6px 4px 4px 8px;
  display: none;
}
.pane.active { display: block; }
.pane .xterm { height: 100%; width: 100%; }
.pane .xterm-viewport { background-color: transparent !important; }

.empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 13px;
}
