:root {
  color-scheme: dark;
  --sapp-color-bg: #020617;
  --sapp-color-bg-soft: #07111f;
  --sapp-color-surface-card: #0f172a;
  --sapp-color-surface-raised: #111c2f;
  --sapp-color-surface-active: #1e293b;
  --sapp-color-border-subtle: rgba(148, 163, 184, 0.14);
  --sapp-color-border-default: rgba(148, 163, 184, 0.22);
  --sapp-color-border-focus: rgba(249, 115, 22, 0.6);
  --sapp-color-text: #f8fafc;
  --sapp-color-text-soft: #cbd5e1;
  --sapp-color-text-muted: #94a3b8;
  --sapp-color-secondary: #f97316;
  --sapp-sidebar-width: 280px;
  --sapp-topbar-height: 64px;
  --sapp-bottom-nav-height: 84px;
  --sapp-radius-2xl: 24px;
  --sapp-shadow-card: 0 18px 60px rgba(0, 0, 0, 0.28);
}

html {
  scroll-behavior: smooth;
}

body[data-private-shell] {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 0%, rgba(249, 115, 22, 0.16), transparent 34rem),
    radial-gradient(circle at 92% 10%, rgba(59, 130, 246, 0.14), transparent 32rem),
    radial-gradient(circle at 70% 95%, rgba(139, 92, 246, 0.11), transparent 30rem),
    var(--sapp-color-bg);
  color: var(--sapp-color-text);
}

body.sapp-shell-locked {
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
}

.focus-ring:focus-visible,
.sapp-focus-ring:focus-visible {
  outline: 3px solid var(--sapp-color-border-focus);
  outline-offset: 3px;
}

.sapp-private-app {
  min-height: 100vh;
}

.sapp-private-content {
  min-width: 0;
  min-height: 100vh;
  padding-bottom: calc(var(--sapp-bottom-nav-height) + env(safe-area-inset-bottom) + 0.75rem);
}

.sapp-page-main {
  max-width: 1440px;
  margin-inline: auto;
  padding: 1rem 1rem calc(var(--sapp-bottom-nav-height) + env(safe-area-inset-bottom) + 1.25rem);
}

.sapp-shell-card {
  border: 1px solid var(--sapp-color-border-subtle);
  background: rgba(15, 23, 42, 0.82);
  box-shadow: var(--sapp-shadow-card);
  backdrop-filter: blur(16px);
}

.sapp-card {
  border: 1px solid var(--sapp-color-border-subtle);
  background: rgba(15, 23, 42, 0.76);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.sapp-card-hover {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.sapp-card-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(249, 115, 22, 0.32);
  background: rgba(30, 41, 59, 0.82);
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.7);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: sapp-shimmer 1.35s infinite;
}

@keyframes sapp-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.sapp-shell-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.sapp-shell-overlay.is-open {
  display: block;
}

.sapp-private-sidebar {
  position: fixed;
  inset-block: 0;
  left: 0;
  z-index: 60;
  display: flex;
  width: var(--sapp-sidebar-width);
  max-width: 88vw;
  transform: translateX(-100%);
  flex-direction: column;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.96);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.5);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.sapp-private-sidebar.is-open {
  transform: translateX(0);
}

.sapp-shell-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  padding: 0.9rem 0.85rem 0.9rem 1.05rem;
}

.sapp-shell-brand {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 0.75rem;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.sapp-shell-sidebar-head .sapp-shell-brand {
  padding: 0;
  border-bottom: 0;
}

.sapp-shell-brand-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 1rem;
  border: 1px solid rgba(59, 130, 246, 0.22);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
}

.sapp-shell-nav {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.sapp-shell-nav-group {
  margin-top: 1rem;
}

.sapp-shell-nav-label {
  margin: 0 0 0.5rem;
  padding-inline: 0.75rem;
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sapp-shell-link,
.sapp-shell-button {
  display: flex;
  min-height: 2.85rem;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border-radius: 1rem;
  border: 1px solid transparent;
  padding: 0.75rem 0.85rem;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 850;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.sapp-shell-link:hover,
.sapp-shell-button:hover,
.sapp-shell-link.is-active {
  border-color: rgba(249, 115, 22, 0.28);
  background: rgba(249, 115, 22, 0.12);
  color: #fff;
}

.sapp-shell-link.is-active {
  color: #fb923c;
}

.sapp-shell-link-icon {
  width: 1.25rem;
  text-align: center;
}

.sapp-shell-badge {
  margin-left: auto;
  min-width: 1.25rem;
  border-radius: 999px;
  padding: 0.08rem 0.38rem;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.sapp-shell-badge.is-community {
  background: #f97316;
  color: #020617;
}

.sapp-shell-badge.is-hidden {
  display: none;
}

.sapp-shell-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding: 1rem;
}

.sapp-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(18px);
}

.sapp-topbar-inner {
  display: flex;
  min-height: var(--sapp-topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.sapp-topbar-title {
  min-width: 0;
  max-width: min(52vw, 34rem);
}

.sapp-topbar-overline {
  margin: 0;
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sapp-topbar-heading {
  margin: 0.15rem 0 0;
  overflow: hidden;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sapp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sapp-shell-icon-button,
.sapp-shell-pill-button {
  display: inline-grid;
  min-width: 2.75rem;
  min-height: 2.75rem;
  place-items: center;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.82);
  color: #cbd5e1;
  font-weight: 900;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.sapp-shell-pill-button {
  display: inline-flex;
  gap: 0.5rem;
  padding-inline: 1rem;
}

.sapp-shell-icon-button:hover,
.sapp-shell-pill-button:hover {
  border-color: rgba(249, 115, 22, 0.45);
  color: #fff;
}

.sapp-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.82);
  padding: 0.35rem 0.55rem;
  color: #fff;
}

.sapp-shell-icon-button:focus-visible,
.sapp-shell-pill-button:focus-visible,
.sapp-profile-trigger:focus-visible,
.sapp-shell-link:focus-visible,
.sapp-shell-button:focus-visible,
.sapp-bottom-link:focus-visible,
.sapp-profile-menu-link:focus-visible {
  outline: 3px solid var(--sapp-color-border-focus);
  outline-offset: 3px;
}

.sapp-avatar {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.sapp-profile-menu {
  position: fixed;
  top: 4.45rem;
  right: 1rem;
  z-index: 70;
  width: min(20rem, calc(100vw - 2rem));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.5rem;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.5);
  padding: 0.85rem;
}

.sapp-profile-menu-handle {
  display: none;
}

.sapp-profile-menu-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
}

.sapp-profile-menu[hidden] {
  display: none;
}

.sapp-profile-menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.9rem;
  padding: 0.75rem;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 800;
}

.sapp-profile-menu-link:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #fff;
}

.sapp-role-chip {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  padding: 0.2rem 0.55rem;
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sapp-bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 45;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.94);
  padding: 0.58rem 0.75rem calc(env(safe-area-inset-bottom) + 0.58rem);
  backdrop-filter: blur(18px);
}

.sapp-bottom-nav-inner {
  display: grid;
  max-width: 31rem;
  margin-inline: auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.sapp-bottom-link {
  display: grid;
  min-height: 3.75rem;
  min-width: 0;
  place-items: center;
  gap: 0.15rem;
  border: 1px solid transparent;
  border-radius: 1.15rem;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 900;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.sapp-bottom-link.is-active {
  border-color: rgba(249, 115, 22, 0.34);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.17), rgba(249, 115, 22, 0.08));
  color: #fff;
}

.sapp-bottom-link:active {
  transform: scale(0.98);
}

.sapp-bottom-icon-wrap {
  position: relative;
  font-size: 1.02rem;
}

.sapp-bottom-link.is-active .sapp-bottom-icon-wrap {
  color: #fb923c;
}

@media (min-width: 1024px) {
  .sapp-private-app {
    display: flex;
  }

  .sapp-private-sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 var(--sapp-sidebar-width);
    transform: none;
    box-shadow: none;
  }

  .sapp-private-content {
    flex: 1;
    padding-bottom: 0;
  }

  .sapp-shell-sidebar-head {
    padding: 1.25rem;
  }

  .sapp-shell-sidebar-head .sapp-shell-brand {
    padding: 0;
  }

  .sapp-shell-sidebar-head .sapp-shell-icon-button {
    display: none;
  }

  .sapp-shell-overlay,
  .sapp-bottom-nav {
    display: none !important;
  }

  .sapp-page-main {
    padding: 1.25rem 2rem 2rem;
  }
}

@media (max-width: 640px) {
  .sapp-topbar-inner {
    gap: 0.45rem;
    padding: 0.65rem 0.75rem;
  }

  .sapp-topbar-title {
    max-width: min(48vw, 16rem);
  }

  .sapp-topbar-actions {
    gap: 0.35rem;
  }

  .sapp-shell-icon-button,
  .sapp-shell-pill-button,
  .sapp-profile-trigger {
    min-width: 2.65rem;
    min-height: 2.65rem;
    border-radius: 0.95rem;
  }

  .sapp-profile-menu {
    top: auto;
    right: 0.75rem;
    bottom: calc(var(--sapp-bottom-nav-height) + env(safe-area-inset-bottom) + 0.75rem);
    left: 0.75rem;
    width: auto;
    max-height: min(72vh, 32rem);
    overflow: auto;
    border-radius: 1.75rem;
    padding: 1.1rem 0.9rem 0.9rem;
  }

  .sapp-profile-menu-handle {
    display: block;
    width: 2.5rem;
    height: 0.24rem;
    margin: 0 auto 0.75rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.38);
  }
}

@media (max-width: 420px) {
  .sapp-topbar-inner {
    padding-inline: 0.75rem;
  }

  .sapp-topbar-overline {
    font-size: 0.58rem;
    letter-spacing: 0.18em;
  }

  .sapp-topbar-heading {
    max-width: 11rem;
    font-size: 0.96rem;
  }

  .sapp-shell-pill-button span,
  .sapp-profile-trigger-name {
    display: none;
  }

  .sapp-bottom-nav {
    padding-inline: 0.45rem;
  }

  .sapp-bottom-nav-inner {
    gap: 0.2rem;
  }

  .sapp-bottom-link {
    min-height: 3.55rem;
    border-radius: 1rem;
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
