/* Gateway loading skeleton (frontend/connection/gateway-loading.js). Geometry from the Control UI's connect splash
   and loading skeleton (ui/src/styles/components.css, base.css .skeleton). */
.gw-skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(var(--ink), 0.09);
  border-radius: 8px;
}
.gw-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 25%, rgba(var(--ink), 0.14) 50%, transparent 75%);
  transform: translateX(-100%);
  animation: gw-skeleton-sweep 2s ease-in-out infinite;
}
@keyframes gw-skeleton-sweep { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .gw-skeleton::after { animation: none; } }
.gw-skeleton-line { height: 14px; border-radius: 6px; }
.gw-skeleton-line--medium { width: 65%; }
.gw-skeleton-line--long { width: 85%; }

/* Chat area: over the panes and their headers (.header z-index 600; it draws its own), under the lock and the offline card. */
.gw-loading {
  position: absolute;
  inset: 0;
  z-index: 700;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}
.gw-loading__chat {
  box-sizing: border-box;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 32px;
  min-height: 0;
  padding: 24px 32px 40px;
}
.gw-loading__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.gw-loading__avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; }
.gw-loading__title { width: 140px; }
.gw-loading__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 48px;
  width: min(100%, 760px);
  margin: 24px auto 0;
}
.gw-loading__message { display: grid; gap: 14px; width: 85%; }
.gw-loading__message--user { align-self: flex-end; width: 48%; }
.gw-loading__composer {
  flex: none;
  width: min(100%, 760px);
  height: 112px;
  margin: auto auto 0;
  border: 1px solid var(--border-color);
  border-radius: 16px;
}
.gw-loading__status {
  position: absolute;
  inset: auto 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.gw-loading__status.is-shown { opacity: 1; }
/* The lock (pairing, errors), the offline card and the gateway picker say what's happening themselves. */
body:has(#authModal.visible) .gw-loading__status,
body:has(.gw-offline-scrim) .gw-loading__status { visibility: hidden; }

/* Sidebar and rail: placeholders where the chats and projects go. */
.is-gw-loading #chatList,
.is-gw-loading #chatIconsCollapsed,
.is-gw-loading #projectRailItems,
.is-gw-loading #projectRailAdd { display: none; }
.is-gw-loading .sidebar-header { opacity: 0.45; } /* New chat and search don't respond yet (inert) */
.gw-loading__sidebar {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 16px 20px;
  overflow: hidden;
}
.gw-loading__heading { width: 40%; height: 10px; margin-bottom: 4px; }
.sidebar.collapsed .gw-loading__sidebar { display: none; }
.gw-loading__rail { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gw-loading__rail .gw-skeleton { width: 36px; height: 36px; border-radius: 10px; }

@media (max-width: 768px) {
  .gw-loading__chat { gap: 24px; padding: 20px 20px 40px; }
}
