:root {
  --wn-loader-bg: rgba(250, 250, 250, 0.88);
  --wn-skeleton-base: rgba(26, 22, 20, 0.08);
  --wn-skeleton-shine: rgba(255, 255, 255, 0.72);
  --wn-shell-bg: rgba(250, 250, 250, 0.94);
  --wn-shell-text: #171514;
  --wn-shell-muted: #77716d;
  --wn-shell-line: rgba(23, 21, 20, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --wn-loader-bg: rgba(12, 12, 12, 0.88);
    --wn-skeleton-base: rgba(255, 255, 255, 0.09);
    --wn-skeleton-shine: rgba(255, 255, 255, 0.08);
    --wn-shell-bg: rgba(12, 12, 12, 0.94);
    --wn-shell-text: #f7f5f3;
    --wn-shell-muted: #aaa39e;
    --wn-shell-line: rgba(255, 255, 255, 0.13);
  }
}

html.wn-shell-mounted,
html.wn-shell-mounted body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

html.wn-shell-mounted body {
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
}

#wn-shell-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 64px;
  padding: max(10px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
  border-bottom: 0;
  background: var(--wn-shell-bg);
  color: var(--wn-shell-text);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-sizing: border-box;
  view-transition-name: wn-shell-header;
}

#wn-shell-header a,
#wn-shell-header button,
#wn-shell-footer a {
  font-family: 'IBM Plex Sans', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif !important;
  color: inherit !important;
  text-decoration: none !important;
  box-sizing: border-box;
}

.wn-shell-wordmark {
  font-size: 1.28rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.055em !important;
  line-height: 1 !important;
}

.wn-shell-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wn-shell-activities,
.wn-shell-language {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  padding: 0 11px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--wn-shell-muted) !important;
  font-size: 0.79rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer;
  white-space: nowrap;
}

.wn-shell-language {
  min-width: 48px;
}

.wn-shell-activities:focus-visible,
.wn-shell-language:focus-visible,
#wn-shell-footer a:focus-visible {
  outline: 2px solid #8a2bfd !important;
  outline-offset: 2px !important;
}

#wn-route-outlet {
  position: relative;
  z-index: 25;
  display: block;
  flex: 1 0 auto;
  width: 100%;
  min-height: calc(100dvh - 196px);
  isolation: isolate;
}

#wn-route-outlet > * {
  box-sizing: border-box;
}

#wn-route-outlet > .stage,
#wn-route-outlet > #page,
#wn-route-outlet > .wrap {
  height: auto !important;
  min-height: calc(100dvh - 196px) !important;
}

#wn-route-outlet header.bar,
#wn-route-outlet footer.base,
#wn-route-outlet .app-strip {
  display: none !important;
}

#wn-route-outlet > #loading {
  position: absolute !important;
  inset: 0 !important;
}

#wn-shell-footer {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 12px;
  padding: 14px max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  border-top: 0;
  background: var(--wn-shell-bg);
  color: var(--wn-shell-text);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-sizing: border-box;
  view-transition-name: wn-shell-footer;
}

.wn-shell-app,
.wn-shell-meta,
.wn-shell-legal {
  display: flex;
  align-items: center;
}

.wn-shell-app {
  gap: 10px;
}

.wn-shell-app-icon {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px;
  border-radius: 10px !important;
  object-fit: cover;
}

@media (prefers-color-scheme: dark) {
  .wn-shell-app-icon {
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.2);
  }
}

.wn-shell-app-title {
  flex: 1 1 auto;
  font-family: 'IBM Plex Sans', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.wn-shell-app-link {
  display: block !important;
  min-height: 44px;
  padding: 6px 0;
}

.wn-shell-app-link img {
  display: block !important;
  width: auto !important;
  height: 32px !important;
}

.wn-shell-meta {
  justify-content: space-between;
  gap: 14px;
  color: var(--wn-shell-muted);
  font-family: 'IBM Plex Sans', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.7rem;
}

.wn-shell-legal {
  gap: 14px;
}

.wn-shell-legal a {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 32px !important;
  color: var(--wn-shell-muted) !important;
}

#wn-route-skeleton {
  position: absolute;
  z-index: 15;
  inset: 0;
  display: flex;
  justify-content: center;
  padding: 22px 20px;
  overflow: hidden;
  background: var(--wn-loader-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

html.wn-is-navigating {
  cursor: progress;
}

.wn-route-focus:focus {
  outline: none;
}

/* Authentication and checkout sheets always sit above the persistent shell. */
html.wn-shell-mounted .wn-ovl {
  z-index: 1000 !important;
  padding-top: max(16px, env(safe-area-inset-top));
  background: rgba(0, 0, 0, 0.66) !important;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

html.wn-shell-mounted .wn-sheet {
  max-height: calc(100dvh - max(16px, env(safe-area-inset-top))) !important;
  padding: 22px 20px max(26px, calc(18px + env(safe-area-inset-bottom))) !important;
  border: 1px solid var(--wn-shell-line) !important;
  border-bottom: 0 !important;
  border-radius: 24px 24px 0 0 !important;
  box-shadow: 0 -22px 70px rgba(0, 0, 0, 0.34) !important;
  overscroll-behavior: contain;
}

html.wn-shell-mounted .wn-top {
  min-height: 44px;
  margin-bottom: 18px !important;
}

html.wn-shell-mounted .wn-title {
  font-size: 1.28rem !important;
  letter-spacing: -0.025em !important;
}

html.wn-shell-mounted .wn-x {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  margin-inline-end: -10px;
  padding: 0 !important;
  border-radius: 999px !important;
}

html.wn-shell-mounted .wn-row {
  margin-bottom: 20px !important;
}

html.wn-shell-mounted .wn-lab {
  margin-bottom: 9px !important;
  font-size: 0.84rem !important;
}

html.wn-shell-mounted .wn-inp,
html.wn-shell-mounted .wn-sel,
html.wn-shell-mounted .wn-cc {
  min-height: 52px !important;
  border-radius: 14px !important;
  font-size: 16px !important;
}

html.wn-shell-mounted .wn-inp:focus-visible,
html.wn-shell-mounted .wn-sel:focus-visible {
  border-color: #9552da !important;
  box-shadow: 0 0 0 3px rgba(149, 82, 218, 0.2) !important;
}

html.wn-shell-mounted .wn-hint {
  margin-top: 9px !important;
  font-size: 0.82rem !important;
}

html.wn-shell-mounted .wn-btn {
  min-height: 52px !important;
  padding: 14px 18px !important;
  font-size: 1rem !important;
}

html.wn-shell-mounted .wn-btn:focus-visible,
html.wn-shell-mounted .wn-x:focus-visible,
html.wn-shell-mounted .wn-link:focus-visible {
  outline: 2px solid #9552da !important;
  outline-offset: 2px !important;
}

/* A focused, mobile-first visual treatment for phone authentication only. */
html.wn-shell-mounted .wn-sheet:has(#wn-ph),
html.wn-shell-mounted .wn-sheet:has(#wn-otp) {
  position: relative;
  overflow: hidden;
  padding-top: 24px !important;
  background:
    radial-gradient(circle at 86% 0%, rgba(149, 82, 218, 0.16), transparent 38%),
    radial-gradient(circle at 8% 18%, rgba(90, 195, 154, 0.12), transparent 34%),
    var(--wn-bg, #fff) !important;
  transform-origin: bottom center;
}

html.wn-shell-mounted .wn-ovl.on:has(#wn-ph),
html.wn-shell-mounted .wn-ovl.on:has(#wn-otp) {
  animation: wn-auth-backdrop-in 220ms ease-out both;
}

html.wn-shell-mounted .wn-ovl.on .wn-sheet:has(#wn-ph),
html.wn-shell-mounted .wn-ovl.on .wn-sheet:has(#wn-otp) {
  animation: wn-auth-sheet-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.wn-shell-mounted .wn-sheet:has(#wn-ph) .wn-title,
html.wn-shell-mounted .wn-sheet:has(#wn-otp) .wn-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 1.52rem !important;
}

html.wn-shell-mounted .wn-sheet:has(#wn-ph) .wn-title::before,
html.wn-shell-mounted .wn-sheet:has(#wn-otp) .wn-title::before {
  content: 'whatsnext';
  color: var(--wn-fg, #111);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

html.wn-shell-mounted .wn-sheet:has(#wn-ph) .wn-row,
html.wn-shell-mounted .wn-sheet:has(#wn-otp) .wn-row {
  padding: 15px;
  border: 1px solid var(--wn-line, rgba(0, 0, 0, 0.1));
  border-radius: 19px;
  background: color-mix(in srgb, var(--wn-field, #fafafa) 82%, transparent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07);
}

html.wn-shell-mounted .wn-sheet:has(#wn-ph) .wn-btn,
html.wn-shell-mounted .wn-sheet:has(#wn-otp) .wn-btn {
  background: linear-gradient(110deg, var(--wn-action), color-mix(in srgb, var(--wn-action) 76%, #9552da)) !important;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--wn-action) 22%, transparent);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

html.wn-shell-mounted .wn-sheet:has(#wn-ph) .wn-btn:active,
html.wn-shell-mounted .wn-sheet:has(#wn-otp) .wn-btn:active {
  transform: scale(0.985);
}

@media (min-width: 560px) {
  html.wn-shell-mounted .wn-sheet {
    border-bottom: 1px solid var(--wn-shell-line) !important;
    border-radius: 24px !important;
  }
}

#wn-route-skeleton.visible { opacity: 1; }

.wn-skeleton-spinner {
  width: 100%;
  min-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wn-sk-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--wn-shell-line);
  border-top-color: #9552da;
  border-radius: 50%;
  animation: wn-sk-roll 720ms linear infinite;
}

.wn-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wn-soft-enter {
  animation: wn-soft-enter 230ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.wn-language-switching #wn-route-outlet {
  animation: wn-language-soft 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: opacity, filter;
  transform: translateZ(0);
}

html.wn-language-switching #wn-shell-header,
html.wn-language-switching #wn-shell-footer {
  animation: wn-language-shell 220ms ease both;
  will-change: opacity;
}

@keyframes wn-sk-roll {
  to { transform: rotate(360deg); }
}

@keyframes wn-soft-enter {
  from { opacity: 0.62; filter: blur(7px); }
  to { opacity: 1; filter: blur(0); }
}

@keyframes wn-language-soft {
  0%, 100% { opacity: 1; filter: blur(0); }
  40% { opacity: 0.82; filter: blur(2px); }
}

@keyframes wn-language-shell {
  0%, 100% { opacity: 1; }
  40% { opacity: 0.82; }
}

@keyframes wn-auth-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes wn-auth-sheet-in {
  from { opacity: 0; transform: translateY(28px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wn-view-old {
  to { opacity: 0; filter: blur(7px); transform: scale(0.995); }
}

@keyframes wn-view-new {
  from { opacity: 0; filter: blur(7px); transform: scale(1.005); }
}

::view-transition-old(root) {
  animation: 150ms ease both wn-view-old;
}

::view-transition-new(root) {
  animation: 230ms cubic-bezier(0.22, 1, 0.36, 1) both wn-view-new;
}

::view-transition-old(wn-shell-header),
::view-transition-new(wn-shell-header),
::view-transition-old(wn-shell-footer),
::view-transition-new(wn-shell-footer) {
  animation: none;
  filter: none;
}

@media (max-width: 420px) {
  .wn-shell-activities { padding-inline: 8px !important; }
  .wn-shell-nav { gap: 2px; }
  .wn-shell-meta { align-items: flex-start; flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  #wn-route-skeleton { transition: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .wn-sk-spinner,
  .wn-soft-enter,
  html.wn-shell-mounted .wn-ovl.on:has(#wn-ph),
  html.wn-shell-mounted .wn-ovl.on:has(#wn-otp),
  html.wn-shell-mounted .wn-ovl.on .wn-sheet:has(#wn-ph),
  html.wn-shell-mounted .wn-ovl.on .wn-sheet:has(#wn-otp),
  html.wn-language-switching #wn-shell-header,
  html.wn-language-switching #wn-route-outlet,
  html.wn-language-switching #wn-shell-footer { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
