/* Main destinations fade through; modal tasks retain their own vertical axis. */
.page, .wizard-stage { animation: none; }
.app-shell main {
  transform: none;
}
.support-window {
  contain: layout style;
  width: min(660px, calc(100% - 40px));
  height: min(780px, calc(var(--app-visible-height,100dvh) - 50px));
  max-height: calc(var(--app-visible-height,100dvh) - 24px);
  max-width: 100%;
  margin: auto auto 24px;
  inset-block-end: var(--app-keyboard-inset,0px);
  padding: 0;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 32px;
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(145deg,#f9eee7,#e9edf6 47%,#c9e0f1);
  box-shadow: 0 24px 100px rgba(31,58,87,.28), inset 0 1px white;
}
.support-window::backdrop {
  background: rgba(28,48,72,.22);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  transition: opacity 280ms ease;
}
.support-window[data-motion=open]::backdrop { opacity: 1; }
@starting-style { .support-window[data-motion=open]::backdrop { opacity: 0; } }
.support-window .chat-layout {
  height: 100%; min-height: 0; margin: 0; max-width: none;
  border: 0; border-radius: inherit; background: transparent; box-shadow: none;
}
.support-window .chat-header { position: relative; flex-shrink: 0; padding: 22px; }
.chat-close { margin-left: auto; background: rgba(255,255,255,.7); }
.support-window .messages { min-height: 0; }
.typing-bubble { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; color: #3d607e; }
.typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: typing-dot 900ms ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: 120ms; }
.typing-dots i:nth-child(3) { animation-delay: 240ms; }
@keyframes typing-dot {
  0%, 65%, 100% { opacity: .45; transform: translateY(0); }
  32% { opacity: 1; transform: translateY(-2px); }
}
.support-window .chat-form { flex-shrink: 0; }
.support-window .chat-note { flex-shrink: 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); }

/* WAAPI controls travel across WebViews; CSS controls only the backdrop. */
.sheet, .sheet[open] { transform: none; opacity: 1; transition: none; }
.sheet {
  inset-block-end: var(--app-keyboard-inset,0px);
  max-height: min(calc(var(--app-visible-height,100dvh) - 24px),850px);
}
.sheet-top { position: sticky; top: 0; z-index: 2; background: linear-gradient(110deg,#f5f2f1,#e9edf5); border-radius: 16px; }
.sheet::backdrop { opacity: 0; transition: opacity 240ms ease; }
.sheet::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
.sheet[data-motion=open]::backdrop { opacity: 1; }
@starting-style { .sheet[data-motion=open]::backdrop { opacity: 0; } }
.sheet-handle { width: 100%; height: 22px; margin: -8px auto 0; background: none; display: grid; place-items: center; }
.sheet-handle::after { content: ''; width: 34px; height: 4px; border-radius: 6px; background: #9cafc057; }
.support-window .chat-header::before { content: ''; position: absolute; top: 5px; left: calc(50% - 17px); width: 34px; height: 4px; border-radius: 6px; background: #9cafc057; }
.sheet-handle, .sheet-top, .support-window .chat-header { touch-action: pan-x pinch-zoom; }
.sheet[data-dragging], .support-window[data-dragging] { will-change: transform; }
.sheet[data-dragging]::backdrop, .support-window[data-dragging]::backdrop { transition: none; }
html[data-modal-locked] body { position: fixed; top: var(--modal-scroll-top); left: 0; right: 0; width: 100%; }
html[data-modal-locked] { min-height: var(--modal-page-height); }
.sheet[data-view=wizard] { height: min(760px,calc(var(--app-visible-height,100dvh) - 32px)); }
.sheet[data-view=wizard] #sheet-content { min-height: calc(100% - 70px); display: flex; flex-direction: column; }
.wizard-stage { flex: 1; display: flex; flex-direction: column; }
.wizard-stage>* { flex-shrink: 0; }
.wizard-stage>.sheet-actions { margin-top: auto; padding-top: 20px; }
.wizard-stage .wizard-art { height: 110px; }
.wizard-stage .platform-options { grid-template-columns: repeat(3,1fr); }
.success-icon { animation: success-arrive 300ms var(--ease-out); }
@keyframes success-arrive {
  from { opacity: .2; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}

/* Static gradients carry color. Only transform and opacity change from frame to frame. */
.fracture-svg { filter: none; }
.glass-art::before {
  content: ""; position: absolute; inset: 8% 0 5% 40%; z-index: -1;
  background: radial-gradient(ellipse at 32% 24%,rgba(255,163,118,.29),transparent 59%),
              radial-gradient(ellipse at 67% 73%,rgba(86,172,239,.35),transparent 60%);
  border-radius: 45%;
  animation: glass-light 12s var(--ease-in-out) infinite alternate;
}
.glass-orbit {
  transform-box: fill-box; transform-origin: center;
  animation: glass-drift 6.8s ease-in-out -2.4s infinite alternate;
}
.glass-orbit.orbit-1 { animation-duration: 8.4s; animation-delay: -4s; animation-name: glass-drift-reverse; }
.glass-orbit.orbit-2 { animation-duration: 9.2s; animation-delay: -6s; }
.glass-orbit.orbit-3 { animation: glass-turn 26s linear -3s infinite; }
.glass-orbit.orbit-4 { animation: glass-turn 32s linear -8s infinite reverse; }
.glass-orbit.orbit-5 { animation-duration: 7.5s; animation-delay: -3s; animation-name: glass-drift-reverse; }
.glass-orbit.orbit-6 { animation: glass-turn 23s linear -6s infinite; }
@keyframes glass-drift {
  from { transform: translate(-6px,9px) rotate(-14deg) scaleX(.91); }
  to { transform: translate(8px,-10px) rotate(16deg) scaleX(1.03); }
}
@keyframes glass-drift-reverse {
  from { transform: translate(6px,-8px) rotate(15deg) scaleX(1.02); }
  to { transform: translate(-6px,9px) rotate(-13deg) scaleX(.93); }
}
@keyframes glass-turn {
  from { transform: rotate(0deg) translateY(4px); }
  to { transform: rotate(360deg) translateY(4px); }
}
@keyframes glass-light { from { opacity: .55; } to { opacity: 1; } }
.soundwave i {
  transform-origin: center;
  animation: wave-breathe 2.1s ease-in-out infinite alternate;
  animation-play-state: paused;
}
.soundwave i:nth-child(2n) { animation-delay: -.9s; }
.soundwave i:nth-child(3n) { animation-duration: 1.65s; animation-delay: -.35s; }
.soundwave i:nth-child(4n + 1) { animation-delay: -1.5s; }
.soundwave[data-running=true] i { animation-play-state: running; }
@keyframes wave-breathe { from { transform: scaleY(.55); } to { transform: scaleY(1.08); } }
.glass-art[data-running=false] .glass-orbit,
.glass-art[data-running=false]::before { animation-play-state: paused; }
.art-motion-toggle {
  position: absolute; z-index: 4; left: 43%; bottom: 0;
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: transparent; color: #547b9e;
}
.art-motion-toggle svg { width: 12px; height: 12px; }
.art-motion-toggle .play-symbol { display: none; }
.art-motion-toggle[data-paused=true] .pause-symbol { display: none; }
.art-motion-toggle[data-paused=true] .play-symbol { display: block; }

.intro-screen {
  position: fixed; inset: 0; margin: 0; padding: 0;
  width: 100%; height: 100dvh; max-width: none; max-height: none;
  border: 0; color: var(--ink); overflow: hidden;
  background: radial-gradient(ellipse at 13% 24%,#f5d5c2,transparent 54%),
              radial-gradient(ellipse at 87% 76%,#a9cae8,transparent 60%),#edeaf0;
}
.intro-screen::backdrop { background: #edeaf0; }
.intro-layout { width: min(440px,100%); height: 100%; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.intro-art { width: 260px; height: 310px; margin-bottom: 24px; }
.intro-art .glass-orbit { animation: none; }
.intro-art .fracture-svg { overflow: visible; }
.intro-wordmark { text-align: center; }
.intro-wordmark strong { display: block; font-size: 58px; font-weight: 650; letter-spacing: 12px; padding-left: 12px; }
.intro-wordmark span { display: block; font-size: 9px; letter-spacing: 3.5px; margin-top: 16px; color: #486780; }
.intro-skip { position: absolute; top: max(25px,env(safe-area-inset-top)); right: 25px; min-height: 44px; background: #ffffff50; border: 1px solid #ffffffb3; border-radius: 25px; padding: 12px 18px; font-size: 11px; color: #496b89; }

@media (max-width:720px) {
  .support-window { --chat-top-gap: max(32px,env(safe-area-inset-top)); width: 100%; inset-block-start: calc(var(--app-visible-top,0px) + var(--chat-top-gap)); inset-block-end: auto; height: calc(var(--app-visible-height,100dvh) - var(--chat-top-gap)); max-height: none; margin: 0 auto; border-radius: 30px 30px 0 0; }
  .support-window[data-keyboard-transition] { transition: height 250ms var(--ease-drawer); }
  .support-window .chat-header { padding: 20px 17px 17px; }
  .support-window .chat-header h1 { font-size: 15px; }
  .support-window .chat-header>div>span { font-size: 9px; }
  .support-window .messages { padding: 22px 17px; }
  .support-window .message p { font-size: 13px; line-height: 1.55; }
  .support-window .faq-chips { padding: 8px 13px; }
  .support-window .faq-chips button { font-size: 10px; }
  .support-window .chat-form { margin: 8px 13px 0; }
  .support-window .chat-note { padding-bottom: max(16px,env(safe-area-inset-bottom)); }
  .intro-art { width: 230px; height: 280px; }
  .intro-wordmark strong { font-size: 52px; }
  .art-motion-toggle { left: 43%; bottom: -1px; }
}
@media (prefers-reduced-motion:reduce) { .support-window[data-keyboard-transition] { transition: none; } }
@media (hover:hover) and (pointer:fine) {
  .art-motion-toggle:hover { background: #ffffff77; }
  .intro-skip:hover { background: #ffffffaa; }
}
@media (prefers-reduced-motion:reduce) {
  .glass-art .glass-orbit, .glass-art::before, .success-icon, .soundwave i, .typing-dots i { animation: none; }
  .app-shell main { transform: none !important; transition: none; }
}
@media (prefers-reduced-transparency:reduce) {
  .support-window::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; background: #263b5080; }
}

.wizard-stage { position: relative; }
.setup-overlay { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: linear-gradient(135deg,#f3efed,#dce8f3); border-radius: 24px; color: #446781; font-size: 13px; }
.setup-overlay svg, .success-icon svg { width: 80px; height: 80px; }
.setup-ring, .setup-check { stroke: #527f9f; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.setup-overlay .setup-ring { stroke-dasharray: 1; animation: draw-ring 650ms cubic-bezier(.3,0,.2,1) both; transform: rotate(-90deg); transform-origin: center; }
.setup-overlay .setup-check { stroke-dasharray: 1; animation: draw-ring 330ms ease-out 620ms both; }
@keyframes draw-ring { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.wizard-stage .success-icon { width: 80px; height: 80px; border: 0; background: transparent; margin: 24px auto; animation: none; }
.device-confirm {
  width: min(300px, calc(100% - 40px)); padding: 22px 14px 12px;
  border: 1px solid #ffffffa6; border-radius: 32px; color: #20364a;
  background: linear-gradient(125deg, #f8fff95c, #d9eafb70 55%, #e3f3ff94);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: inset 0 1px 1px #fffffff0, inset 1px 0 2px #ffffff6b,
    inset 0 -1px 1px #94afc375, 0 18px 56px -12px #16384c4d;
}
.device-confirm::backdrop { background: #1f344d24; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.device-confirm h2 { font-size: 17px; font-weight: 650; line-height: 1.3; letter-spacing: -.3px; text-align: left; margin: 0 12px; overflow-wrap: anywhere; }
.device-confirm p { font-size: 13px; line-height: 1.45; text-align: left; color: #4b6274; margin: 8px 12px 20px; }
.device-confirm button {
  width: 100%; min-height: 46px; margin-top: 6px; padding: 10px 16px;
  border: 1px solid #ffffff50; border-radius: 25px; color: #263e52;
  background: linear-gradient(160deg, #a3b5c62b, #8ba5bb36 58%, #e4f3ff52);
  box-shadow: inset 0 1px 1px #ffffff73, inset 0 -1px 2px #6d8da622, 0 1px 2px #375d7710;
  font-size: 14px; font-weight: 550;
}
.device-confirm button:active { background: #7c9bb750; }
.device-confirm .destructive { color: #b7343e; }
@media (prefers-reduced-transparency: reduce) {
  .device-confirm { background: #e6eff4; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) { .setup-overlay .setup-ring, .setup-overlay .setup-check { animation: none; } }

.sheet[data-view=wizard] #sheet-content { position: relative; overflow-x: clip; }
.wizard-stage { width: 100%; }
.wizard-stage.wizard-outgoing { position: absolute; inset: 0; pointer-events: none; }

/* Keep the light inside the dialog's own paint surface. */
.device-confirm {
  overflow: hidden;
  background:
    radial-gradient(ellipse 170px 130px at var(--glass-x,50%) var(--glass-y,35%), #ffffff52, transparent 75%),
    linear-gradient(125deg, #f8fff95c, #d9eafb70 55%, #e3f3ff94);
}
.device-confirm button {
  position: relative; isolation: isolate; overflow: hidden;
}
.device-confirm button::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse 120px 55px at var(--glass-x,50%) var(--glass-y,50%), #ffffffa3, #ffffff2b 50%, transparent 85%);
  opacity: 0; transition: opacity 220ms ease;
}
@media (hover:hover) and (pointer:fine) {
  .device-confirm button { transition: scale 360ms cubic-bezier(.22,1,.36,1), box-shadow 260ms ease, border-color 260ms ease; }
  .device-confirm button:hover {
    scale: 1.025;
    border-color: #ffffffd1;
    box-shadow: inset 0 1px 2px #fffffff0, inset 0 -2px 4px #779ab84d, 0 4px 12px -6px #244b7770;
  }
  .device-confirm button:hover::before { opacity: 1; }
  .device-confirm button:active { scale: .985; }
}
.device-confirm button:focus-visible::before { opacity: 1; }
@media (prefers-reduced-motion:reduce) {
  .device-confirm button, .device-confirm button::before { transition: none; }
  .device-confirm button:hover, .device-confirm button:active { scale: 1; }
}
