:root {
  --global-sidebar-width: 224px;
}

body.has-global-background {
  background:
    radial-gradient(circle at 9% 19%, rgba(255, 214, 191, 0.22), transparent 24%),
    radial-gradient(circle at 91% 27%, rgba(205, 246, 232, 0.42), transparent 26%),
    linear-gradient(180deg, #fbfbfc 0%, #f7f8fa 100%);
}

body.has-global-background::before {
  display: none;
}

.global-page-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.global-page-background .global-liquid {
  top: 0;
}

body.is-ip-universe .global-page-background {
  display: none;
}

.liquid-field {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.liquid-field::before {
  position: absolute;
  inset: 11% 7%;
  content: "";
  background:
    radial-gradient(circle at 42% 15%, rgba(255, 155, 128, 0.36), transparent 22%),
    radial-gradient(circle at 78% 33%, rgba(114, 189, 255, 0.34), transparent 24%),
    radial-gradient(circle at 74% 74%, rgba(111, 224, 182, 0.3), transparent 27%);
  filter: blur(34px);
  opacity: 0.9;
  animation: liquidGlow 8s ease-in-out infinite;
}

.liquid-field::after {
  position: absolute;
  inset: 8% 4%;
  content: "";
  border: 2px solid transparent;
  border-radius: 44% 56% 58% 42% / 44% 42% 58% 56%;
  background:
    linear-gradient(120deg, rgba(255, 162, 132, 0.5), rgba(255, 255, 255, 0.1) 27%, rgba(121, 192, 255, 0.42) 48%, rgba(104, 226, 177, 0.44) 72%, rgba(255, 255, 255, 0.28)) border-box;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  filter: blur(0.6px) drop-shadow(0 12px 30px rgba(105, 153, 184, 0.12));
  animation: liquidBreathe 9s ease-in-out infinite;
}

.create-liquid {
  top: 0;
  width: min(1160px, 86vw);
  height: min(820px, 74vh);
}

.create-liquid::after {
  inset: 3% 2%;
  border-width: 3px;
  border-radius: 48% 52% 57% 43% / 45% 38% 62% 55%;
}

@keyframes liquidBreathe {
  0%,
  100% {
    transform: rotate(-5deg) scale(0.98);
    border-radius: 44% 56% 58% 42% / 44% 42% 58% 56%;
    opacity: 0.62;
  }

  50% {
    transform: rotate(3deg) scale(1.04);
    border-radius: 52% 48% 43% 57% / 48% 56% 44% 52%;
    opacity: 0.86;
  }
}

@keyframes liquidGlow {
  0%,
  100% {
    transform: translate3d(-1%, 0, 0) scale(0.98);
    opacity: 0.66;
  }

  50% {
    transform: translate3d(1.8%, -1.2%, 0) scale(1.05);
    opacity: 0.94;
  }
}

body.has-global-background .hero-liquid,
body.has-global-background .role-liquid,
body.has-global-background .visual-liquid,
body.has-global-background .studio-liquid,
body.has-global-background .universe-liquid,
body.has-global-background .evolve-liquid {
  display: none;
}

body.has-global-background > main,
body.has-global-background > .app,
body.has-global-background > .shell,
body.has-global-background > .stage,
body.has-global-background > .page,
body.has-global-background > .home-layout {
  position: relative;
  z-index: 1;
}

body.has-global-sidebar {
  padding-left: var(--global-sidebar-width);
}

.global-sidebar {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--global-sidebar-width);
  height: 100vh;
  flex-direction: column;
  padding: 22px 14px 18px;
  border-right: 1px solid rgba(18, 19, 22, 0.075);
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

body.has-shell-sidebar .global-sidebar {
  position: sticky;
  top: 0;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: 1;
  height: 100vh;
}

.global-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: none;
  padding: 4px 10px 24px;
  color: #121316;
  font-size: 24px;
  font-weight: 520;
  letter-spacing: 0;
  text-decoration: none;
}

.global-sidebar .brand-mark {
  display: inline-block;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 136, 112, 0.72), transparent 25%),
    radial-gradient(circle at 78% 38%, rgba(118, 190, 255, 0.7), transparent 31%),
    radial-gradient(circle at 44% 82%, rgba(95, 225, 180, 0.68), transparent 29%),
    rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 30px rgba(65, 85, 115, 0.12);
}

.global-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.global-nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #4a4f57;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.6;
  text-align: left;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.global-nav-item.is-placeholder {
  cursor: default;
}

.global-nav-item svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  opacity: 0.85;
}

.global-nav-item:hover {
  background: #f3f5f8;
  color: #121316;
}

.global-nav-item.is-active {
  background: #ffffff;
  color: #121316;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(31, 35, 45, 0.06);
}

.global-nav-item.is-active svg {
  color: #4a86e8;
  opacity: 1;
}

.global-nav-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: #f0506e;
}

.global-nav-sep {
  height: 1px;
  margin: 18px 12px;
  background: rgba(18, 19, 22, 0.075);
}

.global-sidebar-foot {
  position: relative;
  margin-top: auto;
  padding: 16px 12px 6px;
}

.global-sidebar-glow {
  position: absolute;
  right: -6px;
  bottom: 34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, rgba(160, 200, 255, 0.85), transparent 58%),
    radial-gradient(circle at 70% 36%, rgba(240, 190, 215, 0.8), transparent 56%),
    radial-gradient(circle at 48% 74%, rgba(180, 230, 210, 0.78), transparent 58%);
  filter: blur(5px);
  pointer-events: none;
}

.global-sidebar-foot h4 {
  position: relative;
  margin: 0;
  color: #4a4f57;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
}

.global-sidebar-foot p {
  position: relative;
  margin: 10px 0 0;
  color: #9aa0a8;
  font-size: 10.5px;
  line-height: 1.55;
}

.topbar-brand-spacer {
  display: block;
  width: 1px;
  height: 1px;
}

.profile-icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 32px rgba(31, 35, 45, 0.06);
  color: #111827;
  cursor: pointer;
}

.profile-icon-button svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.has-global-sidebar .universe-shell {
  padding-left: 0;
}

@media (min-width: 861px) {
  body.has-global-background.has-global-sidebar .global-page-background,
  body.has-global-background.has-shell-sidebar .global-page-background,
  body.has-global-background.has-home-sidebar .global-page-background {
    left: var(--global-sidebar-width);
  }
}

body.has-global-background .role-shell,
body.has-global-background .visual-shell,
body.has-global-background .studio-shell,
body.has-global-background .create-shell,
body.has-global-background .inspiration-shell,
body.has-global-background .evolve-shell,
body.has-global-background .universe-shell {
  background: transparent;
}

body.has-global-sidebar > .stage {
  width: auto;
}

body.has-global-sidebar .creation-entry-button {
  min-width: min(360px, 100%);
}

body.has-global-sidebar .workflow {
  width: min(1140px, 100%);
}

body.has-global-sidebar .create-content {
  width: min(990px, 100%);
}

body.has-global-sidebar .role-stage {
  width: min(1340px, 100%);
}

body.has-global-sidebar .visual-canvas {
  width: min(1480px, 100%);
}

body.has-global-sidebar .selected-style {
  max-width: min(920px, calc(100% - 96px));
}

body.has-global-sidebar .studio-flow {
  width: min(1180px, 100%);
}

body.has-global-sidebar .studio-workspace,
body.has-global-sidebar .asset-strip,
body.has-global-sidebar .evolve-grid,
body.has-global-sidebar .recent-strip {
  width: min(1280px, 100%);
}

body.has-global-sidebar .ip-studio {
  width: min(860px, 100%);
}

@media (max-width: 860px) {
  body.has-global-sidebar {
    padding-left: 0;
    overflow: auto;
  }

  .global-sidebar,
  body.has-shell-sidebar .global-sidebar {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: auto;
    padding: 16px 18px 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(18, 19, 22, 0.075);
  }

  .global-sidebar-brand {
    padding-bottom: 14px;
  }

  .global-sidebar-foot {
    display: none;
  }

  body.has-shell-sidebar .shell {
    display: block;
  }

  body.has-global-sidebar > .stage {
    width: 100%;
    height: auto;
    min-height: 100vh;
  }
}

@media (max-width: 640px) {
  :root {
    --global-sidebar-width: 0px;
  }

  body.has-global-background {
    background: linear-gradient(180deg, #fbfbfc 0%, #f7f8fa 100%);
  }

  .global-sidebar,
  body.has-shell-sidebar .global-sidebar {
    padding: 12px 12px 10px;
    background: rgba(255, 255, 255, 0.82);
  }

  .global-sidebar-brand {
    gap: 10px;
    padding: 0 4px 10px;
    font-size: 20px;
  }

  .global-sidebar .brand-mark {
    width: 34px;
    height: 34px;
  }

  .global-sidebar-nav {
    flex-flow: row nowrap;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .global-sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .global-nav-item {
    width: auto;
    min-width: max-content;
    min-height: 40px;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.74);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
  }

  .global-nav-item svg {
    width: 16px;
    height: 16px;
  }

  .global-nav-sep {
    display: none;
  }

  body.has-global-sidebar .selected-style,
  body.has-global-sidebar .creation-entry-button,
  body.has-global-sidebar .workflow,
  body.has-global-sidebar .create-content,
  body.has-global-sidebar .role-stage,
  body.has-global-sidebar .visual-canvas,
  body.has-global-sidebar .studio-flow,
  body.has-global-sidebar .studio-workspace,
  body.has-global-sidebar .asset-strip,
  body.has-global-sidebar .evolve-grid,
  body.has-global-sidebar .recent-strip,
  body.has-global-sidebar .ip-studio {
    width: min(100%, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }
}
