.next-step-host[hidden] {
  display: none !important;
}

.next-step-host {
  width: 100%;
  position: relative;
  overflow: visible;
}

.controls > .next-step-host--compact {
  width: auto;
  flex: 0 0 auto;
  order: -20;
  margin-left: var(--next-step-inline-offset, 0px);
  margin-right: auto;
  align-self: center;
}

.assistant-message + .next-step-host {
  margin: 10px 0 8px;
}

.next-step-gate,
.next-step-note {
  border-radius: 16px;
}
.next-step-gate__button {
  flex: none;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.next-step-gate__button:hover {
  transform: translateY(-1px);
}

.next-step-gate__button[data-loading="true"] {
  opacity: 0.78;
  cursor: wait;
}

.next-step-gate {
  padding: 8px 0 0;
}

.next-step-gate__button {
  color: #9a3412;
  background: rgba(255, 237, 213, 0.9);
  border: 1px solid rgba(251, 146, 60, 0.38);
}

.next-step-note {
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  background: rgba(241, 245, 249, 0.92);
  border: 1px dashed rgba(148, 163, 184, 0.5);
}

.next-step-host.is-error .next-step-note {
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.95);
  border-color: rgba(248, 113, 113, 0.55);
}

.next-step-host.is-consumed .next-step-note {
  color: #0f766e;
  background: rgba(240, 253, 250, 0.95);
  border-color: rgba(45, 212, 191, 0.55);
}

.next-step-host--island {
  z-index: 16;
  --next-step-surface-start: rgba(12, 38, 109, 0.98);
  --next-step-surface-end: rgba(30, 64, 175, 0.98);
  --next-step-surface-glow: rgba(59, 130, 246, 0.18);
  --next-step-surface-shadow: rgba(15, 23, 42, 0.24);
  --next-step-state-start: rgba(18, 52, 128, 0.94);
  --next-step-state-end: rgba(29, 78, 216, 0.94);
}

.next-step-host--island.is-open {
  z-index: 24;
}

.next-step-island {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

.next-step-island__launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px 0 14px;
  border: 0;
  border-radius: 999px;
  color: #f8fafc;
  cursor: pointer;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.18), transparent 34%),
    radial-gradient(circle at 82% 20%, var(--next-step-surface-glow), transparent 30%),
    linear-gradient(135deg, var(--next-step-surface-start), var(--next-step-surface-end));
  box-shadow:
    0 14px 28px rgba(16, 24, 40, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.next-step-island__launcher:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 32px rgba(19, 42, 95, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.next-step-island__launcher-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fb923c;
  box-shadow: 0 0 0 5px rgba(251, 146, 60, 0.16);
}

.next-step-island.is-pending .next-step-island__launcher-dot {
  background: #fbbf24;
  animation: next-step-pulse 1.2s ease-in-out infinite;
}

.next-step-island__launcher-text {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.next-step-island__launcher-chevron {
  font-size: 14px;
  font-weight: 800;
  opacity: 0.86;
}

.next-step-island__panel {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  width: max-content;
  min-width: 0;
  max-width: calc(100vw - 92px);
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.10), transparent 32%),
    radial-gradient(circle at 84% 20%, rgba(96, 165, 250, 0.14), transparent 34%),
    linear-gradient(135deg, var(--next-step-surface-start), var(--next-step-surface-end));
  box-shadow:
    0 18px 34px var(--next-step-surface-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-50%) scale(0.98);
  transform-origin: left center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 26;
}

.next-step-island__panel[hidden] {
  display: none;
}

.next-step-island.is-open .next-step-island__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.next-step-island__route {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(251, 146, 60, 0.42);
  border-radius: 999px;
  color: #fff7ed;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.86), rgba(251, 146, 60, 0.78));
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.next-step-island__route:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(249, 115, 22, 0.28);
}

.next-step-island__route[data-loading="true"] {
  opacity: 0.82;
  cursor: wait;
}

.next-step-island__route--pending,
.next-step-island__route:disabled {
  opacity: 0.76;
  cursor: wait;
  box-shadow: none;
}

.next-step-island__route-prefix {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.88;
}

.next-step-island__route-label {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.next-step-island__collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  color: rgba(248, 250, 252, 0.74);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  transition: background-color 0.16s ease, color 0.16s ease;
}

.next-step-island__collapse:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.10);
}

.assistant-message + .controls .next-step-host--island .next-step-island__launcher,
.assistant-message + .controls .next-step-host--island .next-step-island__route,
.assistant-message + .controls .next-step-host--island .next-step-island__collapse {
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  min-width: 0 !important;
  width: auto !important;
}

.assistant-message + .controls .next-step-host--island .next-step-island__launcher {
  padding: 0 12px 0 14px !important;
  min-height: 42px !important;
  border: 0 !important;
  color: #f8fafc !important;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.18), transparent 34%),
    radial-gradient(circle at 82% 20%, var(--next-step-surface-glow), transparent 30%),
    linear-gradient(135deg, var(--next-step-surface-start), var(--next-step-surface-end)) !important;
  box-shadow:
    0 14px 28px rgba(16, 24, 40, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.assistant-message + .controls .next-step-host--island .next-step-island__route {
  min-height: 34px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(251, 146, 60, 0.42) !important;
  color: #fff7ed !important;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.86), rgba(251, 146, 60, 0.78)) !important;
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.22) !important;
}

.assistant-message + .controls .next-step-host--island .next-step-island__collapse {
  min-height: 30px !important;
  padding: 0 !important;
  border: 0 !important;
  color: rgba(248, 250, 252, 0.74) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: none !important;
}

.next-step-island-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: #e2e8f0;
  background: linear-gradient(135deg, var(--next-step-state-start), var(--next-step-state-end));
  box-shadow: 0 12px 24px rgba(24, 48, 104, 0.22);
}

.next-step-island-state__title {
  font-size: 12px;
  font-weight: 800;
  color: #fb923c;
  white-space: nowrap;
}

.next-step-island-state__text {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.next-step-island-state--consumed .next-step-island-state__title {
  color: #2dd4bf;
}

.next-step-island-state--error .next-step-island-state__title,
.next-step-island-state--error .next-step-island-state__text {
  color: #fecaca;
}

@keyframes next-step-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.14);
  }

  50% {
    transform: scale(1.12);
    box-shadow: 0 0 0 7px rgba(251, 191, 36, 0.22);
  }
}

@media (max-width: 1080px) {
  .controls > .next-step-host--compact {
    margin-right: auto;
  }

  .next-step-island__panel {
    max-width: calc(100vw - 72px);
  }
}

@media (max-width: 720px) {
  .next-step-gate__button {
    width: 100%;
  }

  .next-step-island {
    width: 100%;
  }

  .next-step-island__panel {
    position: static;
    left: auto;
    top: auto;
    width: max-content;
    max-width: 100%;
    min-width: 0;
    margin-left: 8px;
    transform: scale(0.98);
  }

  .next-step-island.is-open .next-step-island__panel {
    transform: scale(1);
  }

  .next-step-island__launcher-text {
    font-size: 12px;
  }

  .next-step-island__route-label {
    font-size: 12px;
  }
}
