.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  background:
    linear-gradient(90deg, rgba(156, 0, 255, 0.1), rgba(0, 200, 255, 0.07)),
    rgba(5, 5, 13, 0.94);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  box-shadow: inset 0 -1px 0 rgba(191, 0, 255, 0.35), inset 0 -2px 0 rgba(0, 191, 255, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-logo,
.brand-team {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-copy strong {
  font-family: var(--font-display);
  letter-spacing: 0.16em;
  font-size: 0.95rem;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn-site {
  border-radius: 12px;
  min-height: 42px;
  padding: 0.45rem 1rem;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: #fff;
}

.menu-toggle .nav-ico {
  width: 20px;
  height: 20px;
}

.sidebar {
  border-right: 1px solid rgba(170, 0, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(156, 0, 255, 0.08), transparent 28%),
    #080713;
  padding: 1rem 0.75rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  overflow-y: auto;
}

.sidebar-kicker {
  margin: 0.15rem 0.55rem 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1;
}

.sidebar-support {
  position: relative;
  margin-top: auto;
  padding: 0.9rem 0.8rem 0;
  border-radius: 16px;
  border: 1px solid rgba(106, 0, 255, 0.28);
  background:
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(191, 0, 255, 0.1), transparent 68%),
    linear-gradient(180deg, rgba(10, 10, 24, 0.96) 0%, rgba(5, 5, 14, 0.98) 100%);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.sidebar-support-head {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.sidebar-support-ico {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--protv-cyan);
  background: rgba(0, 200, 255, 0.06);
  border: 1px solid rgba(0, 200, 255, 0.35);
  box-shadow: 0 0 14px rgba(0, 200, 255, 0.12);
  flex-shrink: 0;
}

.sidebar-support-ico svg {
  width: 18px;
  height: 18px;
}

.sidebar-support-head strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  letter-spacing: 0.01em;
}

.sidebar-support-head p {
  margin: 0;
  color: rgba(200, 200, 210, 0.82);
  font-size: 0.74rem;
  line-height: 1.4;
}

.sidebar-support-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0.58rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid rgba(191, 0, 255, 0.55);
  background: rgba(8, 8, 18, 0.35);
  color: #f0e6ff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease), transform 0.22s var(--ease), color 0.22s var(--ease);
}

.sidebar-support-btn span {
  opacity: 0.85;
  font-size: 1rem;
  line-height: 1;
}

.sidebar-support-btn:hover {
  border-color: rgba(0, 191, 255, 0.65);
  color: #fff;
  box-shadow: 0 0 18px rgba(191, 0, 255, 0.22), 0 0 24px rgba(0, 191, 255, 0.12);
  transform: translateY(-1px);
}

.sidebar-support-art {
  margin: 0.85rem -0.8rem 0;
  padding: 0.15rem 0.35rem 0.45rem;
  min-height: 86px;
  position: relative;
  pointer-events: none;
}

.sidebar-support-art::before {
  content: "";
  position: absolute;
  inset: 0 10% 0;
  background: radial-gradient(ellipse 70% 80% at 50% 100%, rgba(191, 0, 255, 0.18), transparent 72%);
  pointer-events: none;
}

.sidebar-support-art svg {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 10px rgba(191, 0, 255, 0.35)) drop-shadow(0 0 18px rgba(0, 191, 255, 0.2));
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-support-btn:hover {
    transform: none;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.85rem;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.nav-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(170, 0, 255, 0.22);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(176, 0, 255, 0.62), rgba(0, 184, 255, 0.38));
  border-color: transparent;
  box-shadow: 0 0 18px rgba(176, 0, 255, 0.22);
}

.nav-link.active .nav-ico {
  opacity: 1;
}

.content {
  padding: 1.4rem clamp(1rem, 2vw, 2rem) 2.5rem;
  background:
    var(--team-banner),
    radial-gradient(900px 400px at 90% -10%, color-mix(in srgb, var(--team-primary) 22%, transparent), transparent 55%),
    radial-gradient(700px 300px at 0% 100%, color-mix(in srgb, var(--team-secondary) 16%, transparent), transparent 50%),
    var(--bg);
  background-size: cover, auto, auto, auto;
  background-blend-mode: overlay, normal, normal, normal;
}

body.is-analysis .content {
  padding: 1.65rem clamp(1rem, 2.2vw, 1.85rem) 2.4rem;
  background:
    radial-gradient(620px 280px at 0% 8%, rgba(176, 0, 255, 0.14), transparent 58%),
    radial-gradient(720px 320px at 100% 0%, rgba(0, 184, 255, 0.11), transparent 52%),
    #05050d;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0.75rem 0.32rem 0.32rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.user-chip > img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.account-crest {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.account-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0a12;
}

.account-crest em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.75rem 0.28rem 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: left;
  min-height: 44px;
}

.account-chip:hover {
  border-color: rgba(0, 191, 255, 0.45);
}

.account-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.account-copy strong {
  font-size: 0.84rem;
  font-weight: 600;
}

.account-copy small {
  font-size: 0.68rem;
  color: var(--muted);
}

.user-chip-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-chip-copy strong {
  font-size: 0.82rem;
  font-weight: 600;
}

.user-chip-copy span {
  font-size: 0.68rem;
  color: var(--muted);
}

.app-shell {
  scrollbar-color: #5a1a88 #080812;
  scrollbar-width: thin;
}

.app-shell::-webkit-scrollbar,
.app-shell *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.app-shell::-webkit-scrollbar-track,
.app-shell *::-webkit-scrollbar-track {
  background: #080812;
}

.app-shell::-webkit-scrollbar-thumb,
.app-shell *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7a00cc, #0077aa);
  border-radius: 99px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    inset: var(--header-h) auto 0 0;
    width: min(280px, 86vw);
    transform: translateX(-110%);
    transition: transform 0.25s var(--ease);
  }

  .sidebar.open {
    transform: none;
  }

  .user-chip-copy span {
    display: none;
  }
}

@media (max-width: 1100px) and (min-width: 901px) {
  :root {
    --sidebar-w: 220px;
  }
}

.team-switch-label {
  display: block;
  margin: 0.2rem 0.35rem 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.team-switch {
  width: 100%;
  margin-bottom: 0.65rem;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--protv-cyan);
  border: 1px solid rgba(0, 200, 255, 0.35);
  background: rgba(0, 200, 255, 0.08);
}

.user-row {
  align-items: center;
}

.user-role-badges {
  min-width: 120px;
}

.role-checks {
  display: grid;
  gap: 0.65rem;
}

.role-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.role-check input {
  margin-top: 0.2rem;
}

.role-check strong,
.role-check em {
  display: block;
}

.role-check em {
  margin-top: 0.15rem;
  color: var(--muted);
  font-style: normal;
  font-size: 0.85rem;
}
