:root {
  --splash-bg: #f4f7fb;
  --splash-panel: rgba(255, 255, 255, 0.78);
  --splash-panel-strong: rgba(255, 255, 255, 0.96);
  --splash-text: #0d1b34;
  --splash-muted: #63728a;
  --splash-line: rgba(20, 72, 157, 0.13);
  --splash-primary: #245bdb;
  --splash-cyan: #05a8f0;
  --splash-glow: rgba(36, 91, 219, 0.2);
}

html.chat-theme-dark {
  --splash-bg: #060b18;
  --splash-panel: rgba(13, 24, 48, 0.78);
  --splash-panel-strong: rgba(11, 20, 41, 0.96);
  --splash-text: #f4f7ff;
  --splash-muted: #9aa9c2;
  --splash-line: rgba(109, 164, 255, 0.15);
  --splash-primary: #6b91ff;
  --splash-cyan: #20c8ff;
  --splash-glow: rgba(55, 121, 255, 0.28);
}

.chatrdc-app-splash {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  place-items: center;
  align-content: center;
  gap: 24px;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow: hidden;
  color: var(--splash-text);
  background:
    linear-gradient(90deg, transparent 31px, var(--splash-line) 32px, transparent 33px),
    linear-gradient(0deg, transparent 31px, var(--splash-line) 32px, transparent 33px),
    radial-gradient(circle at 50% 34%, var(--splash-glow), transparent 42%),
    var(--splash-bg);
  background-size: 32px 32px, 32px 32px, auto, auto;
  isolation: isolate;
  opacity: 1;
  transition: opacity 280ms ease, transform 280ms ease, filter 280ms ease;
}

.chatrdc-app-splash::before,
.chatrdc-app-splash::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(70vw, 680px);
  aspect-ratio: 1;
  border: 1px solid var(--splash-line);
  border-radius: 50%;
  opacity: 0.72;
}

.chatrdc-app-splash::before { transform: scale(0.68); }
.chatrdc-app-splash::after { transform: scale(1.04); opacity: 0.35; }

html.show-chatrdc-splash,
html.show-chatrdc-splash body {
  overflow: hidden !important;
}

html.show-chatrdc-splash .chatrdc-app-splash { display: grid; }

.chatrdc-app-splash.is-exiting {
  opacity: 0;
  transform: scale(1.018);
  filter: blur(4px);
}

.chatrdc-splash-stage {
  position: relative;
  width: min(88vw, 430px);
  height: 260px;
}

.chatrdc-splash-core {
  position: absolute;
  top: 12px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 126px;
  aspect-ratio: 1;
  transform: translateX(-50%);
}

.chatrdc-splash-core img {
  width: 70px;
  height: 70px;
  border: 1px solid var(--splash-line);
  border-radius: 23px;
  box-shadow: 0 18px 52px var(--splash-glow), inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.chatrdc-splash-orbit {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--splash-primary) 44%, transparent);
  border-radius: 50%;
}

.chatrdc-splash-orbit::after {
  content: "";
  position: absolute;
  top: -4px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--splash-cyan);
  box-shadow: 0 0 18px var(--splash-cyan);
}

.chatrdc-splash-orbit.orbit-one { animation: chatrdc-splash-spin 2.4s linear infinite; }
.chatrdc-splash-orbit.orbit-two {
  inset: 13px;
  border-left-color: transparent;
  border-right-color: transparent;
  animation: chatrdc-splash-spin 3.4s linear infinite reverse;
}
.chatrdc-splash-orbit.orbit-three {
  inset: -13px;
  border-top-color: transparent;
  border-bottom-color: transparent;
  opacity: 0.55;
  animation: chatrdc-splash-spin 5s linear infinite;
}

.chatrdc-splash-node {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--splash-primary);
  box-shadow: 0 0 15px var(--splash-primary);
  animation: chatrdc-node-pulse 1.5s ease-in-out infinite;
}
.chatrdc-splash-node.node-one { top: 9px; right: 18px; }
.chatrdc-splash-node.node-two { bottom: 15px; left: 6px; animation-delay: 400ms; }
.chatrdc-splash-node.node-three { right: -6px; bottom: 38px; animation-delay: 800ms; }

.chatrdc-splash-conversation {
  position: absolute;
  inset: 118px 0 auto;
  height: 142px;
  overflow: hidden;
  mask-image: linear-gradient(transparent, #000 14%, #000 82%, transparent);
}

.chatrdc-splash-message {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(84%, 330px);
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid var(--splash-line);
  border-radius: 17px;
  color: var(--splash-text);
  background: var(--splash-panel);
  box-shadow: 0 14px 38px rgba(18, 42, 84, 0.1);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translate(-50%, 72px) scale(0.96);
  animation: chatrdc-message-rise 4.2s cubic-bezier(0.2, 0.72, 0.25, 1) infinite;
}

.chatrdc-splash-message.is-question { margin-left: -22px; }
.chatrdc-splash-message.is-answer {
  margin-left: 22px;
  border-color: color-mix(in srgb, var(--splash-primary) 28%, transparent);
  background: var(--splash-panel-strong);
}
.chatrdc-splash-message.message-two { animation-delay: 850ms; }
.chatrdc-splash-message.message-three { animation-delay: 1700ms; }
.chatrdc-splash-message.message-four { animation-delay: 2550ms; }

.message-avatar {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, var(--splash-primary), var(--splash-cyan));
  font-size: 11px;
  font-weight: 800;
}

.message-lines { display: grid; flex: 1; gap: 5px; }
.message-lines i {
  display: block;
  width: 88%;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--splash-line), var(--splash-primary), var(--splash-line));
  background-size: 200% 100%;
  animation: chatrdc-skeleton 1.1s linear infinite;
}
.message-lines i:nth-child(2) { width: 67%; }
.message-lines i:nth-child(3) { width: 76%; }

.chatrdc-splash-copy {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}
.chatrdc-splash-eyebrow {
  color: var(--splash-primary) !important;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 0.2em;
}
.chatrdc-splash-copy strong { font-size: clamp(26px, 7vw, 34px); letter-spacing: -0.04em; }
.chatrdc-splash-copy > span:last-child { min-height: 20px; color: var(--splash-muted); font-size: 13px; }

.chatrdc-splash-progress {
  width: min(70vw, 250px);
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--splash-line);
}
.chatrdc-splash-progress i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--splash-primary), var(--splash-cyan));
  transform: scaleX(0);
  transform-origin: left;
  animation: chatrdc-progress 4.6s cubic-bezier(0.18, 0.72, 0.22, 1) forwards;
}

@keyframes chatrdc-splash-spin { to { transform: rotate(360deg); } }
@keyframes chatrdc-node-pulse { 50% { opacity: 0.32; transform: scale(0.6); } }
@keyframes chatrdc-skeleton { to { background-position: -200% 0; } }
@keyframes chatrdc-progress { to { transform: scaleX(1); } }
@keyframes chatrdc-message-rise {
  0% { opacity: 0; transform: translate(-50%, 72px) scale(0.96); }
  12%, 38% { opacity: 1; transform: translate(-50%, 42px) scale(1); }
  62% { opacity: 0.56; transform: translate(-50%, -10px) scale(0.98); }
  78%, 100% { opacity: 0; transform: translate(-50%, -62px) scale(0.94); }
}

@media (max-width: 480px) {
  .chatrdc-app-splash { gap: 18px; }
  .chatrdc-splash-stage { height: 244px; }
  .chatrdc-splash-message { width: min(92%, 330px); font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .chatrdc-splash-orbit,
  .chatrdc-splash-node,
  .chatrdc-splash-message,
  .message-lines i,
  .chatrdc-splash-progress i { animation: none !important; }
  .chatrdc-splash-message.message-two { opacity: 1; transform: translate(-50%, 20px); }
  .chatrdc-app-splash { transition: none; }
}
