/* =========================================================================
   Nexus · offline.css — banner + queue pill for offline / fallback mode.
   Aligned with Studio-Soft tokens used elsewhere (see styles.css /
   components/toasts.css).
   ========================================================================= */

.nx-offline-banner {
  position: relative;
  z-index: 220;
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 6px 14px;
  min-height: 28px;

  /* Warn-tinted strip; subtle so it doesn't yell. */
  background: color-mix(in oklab, var(--nx-warn, #d8a04a) 18%, var(--nx-surface, #1a1714));
  color: var(--nx-text, #f1ebdf);
  border-bottom: 1px solid color-mix(in oklab, var(--nx-warn, #d8a04a) 55%, transparent);
  box-shadow: 0 1px 0 color-mix(in oklab, var(--nx-warn, #d8a04a) 40%, transparent);

  font-family: var(--nx-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;

  transform: translateY(-110%);
  opacity: 0;
  transition:
    transform 220ms cubic-bezier(.22,.65,.18,1),
    opacity 220ms ease-out;
  will-change: transform, opacity;
}

.nx-offline-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.nx-offline-banner.is-leaving {
  transform: translateY(-110%);
  opacity: 0;
}

.nx-offline-banner .nx-offline-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: color-mix(in oklab, var(--nx-warn, #d8a04a) 70%, var(--nx-text, #f1ebdf));
}

.nx-offline-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in oklab, var(--nx-warn, #d8a04a) 80%, transparent);
  border-top-color: transparent;
  animation: nx-offline-spin 1.1s linear infinite;
  flex: 0 0 auto;
}

@keyframes nx-offline-spin {
  to { transform: rotate(360deg); }
}

.nx-offline-retry {
  background: transparent;
  color: var(--nx-text, #f1ebdf);
  border: 1px solid color-mix(in oklab, var(--nx-warn, #d8a04a) 50%, transparent);
  padding: 2px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.nx-offline-retry:hover {
  background: color-mix(in oklab, var(--nx-warn, #d8a04a) 12%, transparent);
  border-color: var(--nx-warn, #d8a04a);
}

/* Reduced motion — no spinner rotation, no slide. */
@media (prefers-reduced-motion: reduce) {
  .nx-offline-banner { transition: opacity 120ms linear; transform: none; }
  .nx-offline-banner.is-leaving { transform: none; }
  .nx-offline-spinner { animation: none; border-top-color: var(--nx-warn, #d8a04a); }
}

/* =========================================================================
   Queue pill — sits next to / above compose, shows "↑ N queued".
   ========================================================================= */

.nx-queue-pill {
  position: absolute;
  top: -10px;
  right: 14px;
  z-index: 5;

  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;

  background: color-mix(in oklab, var(--nx-accent, #5ee0c8) 18%, var(--nx-surface, #1a1714));
  color: color-mix(in oklab, var(--nx-accent, #5ee0c8) 90%, var(--nx-text, #f1ebdf));
  border: 1px solid color-mix(in oklab, var(--nx-accent, #5ee0c8) 45%, transparent);
  box-shadow: 0 4px 14px -8px color-mix(in oklab, var(--nx-accent, #5ee0c8) 60%, transparent);

  font-family: var(--nx-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;

  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition:
    opacity 200ms ease,
    transform 200ms cubic-bezier(.22,.65,.18,1);
}

.nx-queue-pill.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Compose host needs `position: relative` for the pill to anchor. We don't
   set it on the project's compose container directly to avoid touching that
   component's styles; instead we provide a helper class agents can apply. */
.nx-compose-shell, #nx-compose, #composer {
  /* Soft, override-safe — only adds positioning context if not already set. */
  position: relative;
}
