/* ─ Connection Indicator ─ */
.connection-indicator-host {
  position: relative;
  flex-shrink: 0;
}

/* Server switch menu is portaled to body (ConnectionIndicator); rules kept for any inline-less use. */
.connection-indicator-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: min(320px, 85vw);
}

.connection-indicator-chevron--open {
  transform: rotate(180deg);
  transition: transform var(--transition-fast, 0.15s ease);
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.connection-sync-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.connection-sync-btn:disabled {
  cursor: default;
}

.connection-sync-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.connection-sync-btn--visible .connection-sync-icon {
  opacity: 0.85;
}

.connection-sync-btn--busy .connection-sync-icon {
  opacity: 1;
  animation: connection-sync-spin 0.9s linear infinite;
}

@keyframes connection-sync-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.connection-meta--clickable {
  cursor: pointer;
}

.connection-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.connection-led--connected {
  background: #a6e3a1;
  box-shadow: 0 0 6px 2px rgba(166, 227, 161, 0.55);
}

.connection-led--queue-handoff {
  background: #f9e2af;
  box-shadow: 0 0 6px 2px rgba(249, 226, 175, 0.55);
}

.connection-led--disconnected {
  background: #f38ba8;
  box-shadow: 0 0 6px 2px rgba(243, 139, 168, 0.55);
}

.connection-led--checking {
  background: var(--text-muted);
  box-shadow: none;
  animation: led-pulse 1.2s ease-in-out infinite;
}

@keyframes led-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.connection-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.connection-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.connection-server {
  font-size: 10px;
  color: var(--text-muted);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Server card actions collapse to icon-only on narrow viewports — labels
 * remain available as native tooltips via the existing `data-tooltip` /
 * `aria-label` attributes. Breakpoint is tuned to where the action row
 * starts overflowing on the default Settings layout. */
@media (max-width: 1100px) {
  .server-card-btn-label {
    display: none;
  }
}
