/* Centered top-level switch between AI and manual creation. */
#studioView {
  padding-top: calc(62px + env(safe-area-inset-top, 0px));
}

#studioView .studio-mode-switch {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 92;
  display: flex;
  gap: 0;
  width: fit-content;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.09);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

#appPanel #studioView .studio-mode-switch #switchAgentCreateBtn,
#appPanel #studioView .studio-mode-switch #switchManualCreateBtn {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 104px !important;
  width: 104px !important;
  min-width: 98px;
  max-width: none !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 10px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  color: #718096 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  transform: none !important;
  white-space: nowrap;
}

#appPanel #studioView .studio-mode-switch #switchManualCreateBtn {
  border-left: 1px solid rgba(37, 99, 235, 0.14);
}

#appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active {
  background: #eaf3ff !important;
  color: #2879df !important;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.10) !important;
}

#studioView .studio-mode-switch button:active { transform: scale(0.97); }

#appPanel #studioView #uploadWorkBtn.studio-upload-work {
  position: fixed !important;
  top: calc(19px + env(safe-area-inset-top, 0px)) !important;
  right: max(14px, calc((100vw - var(--app-width)) / 2 + 14px)) !important;
  left: auto !important;
  z-index: 93 !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
}

#appPanel #studioView #uploadWorkBtn.studio-upload-work.busy {
  width: 76px !important;
  min-width: 76px !important;
  font-size: 12px !important;
}

#appPanel #studioView .studio-top-my-works {
  position: fixed !important;
  top: calc(19px + env(safe-area-inset-top, 0px)) !important;
  left: max(14px, calc((100vw - var(--app-width)) / 2 + 14px)) !important;
  right: auto !important;
  z-index: 93 !important;
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(37, 99, 235, 0.16) !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #4f8ff7 !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08) !important;
}

#appPanel #studioView .studio-top-my-works svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#appPanel #studioView .studio-top-my-works:active { transform: scale(0.94) !important; }

html.theme-dark #studioView .studio-mode-switch {
  border-color: rgba(217, 169, 87, 0.28);
  background: rgba(24, 21, 17, 0.94);
  box-shadow: none;
}

html.theme-dark #appPanel #studioView .studio-top-my-works {
  border-color: rgba(217, 169, 87, 0.38) !important;
  background: rgba(24, 21, 17, 0.94) !important;
  color: #e6c47c !important;
  box-shadow: none !important;
}

html.theme-dark #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn) { color: #b9ac91 !important; }
html.theme-dark #appPanel #studioView .studio-mode-switch #switchManualCreateBtn { border-left-color: rgba(217, 169, 87, 0.22) !important; }
html.theme-dark #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active {
  background: rgba(217, 169, 87, 0.16) !important;
  color: #ecd398 !important;
  box-shadow: inset 0 0 0 1px rgba(217, 169, 87, 0.20) !important;
}

@media (max-width: 360px) {
  #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn) {
    flex-basis: 96px !important;
    width: 96px !important;
    min-width: 96px !important;
    padding: 0 8px !important;
  }
  #appPanel #studioView #uploadWorkBtn.studio-upload-work {
    right: max(9px, calc((100vw - var(--app-width)) / 2 + 9px)) !important;
  }
  #appPanel #studioView .studio-top-my-works {
    left: max(9px, calc((100vw - var(--app-width)) / 2 + 9px)) !important;
  }
}

/* studio top controls lift v7 */
#studioView .studio-mode-switch {
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
}

#appPanel #studioView #uploadWorkBtn.studio-upload-work,
#appPanel #studioView .studio-top-my-works {
  top: calc(11px + env(safe-area-inset-top, 0px)) !important;
}

/* light-studio-my-works-inline-v20260720 */
html:not(.theme-dark) #studioView .manual-prompt-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

html:not(.theme-dark) #studioView .manual-prompt-actions #studioTopMyWorksBtn.manual-my-works {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  flex: 0 0 auto !important;
  width: auto !important;
  height: 34px !important;
  min-width: 82px !important;
  min-height: 34px !important;
  margin: 0 0 0 auto !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
}

html:not(.theme-dark) #studioView .manual-prompt-actions #studioTopMyWorksBtn.manual-my-works span {
  display: inline !important;
  color: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
  font-size: 12px !important;
  font-weight: 750 !important;
}

html:not(.theme-dark) #studioView .manual-prompt-actions #studioTopMyWorksBtn.manual-my-works svg {
  width: 15px !important;
  height: 15px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
}

/* Android 9 projector keeps the selected creation mode visibly highlighted. */
html.mahua-apk-android9 #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active,
body.mahua-apk-android9 #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active,
html.mahua-apk-projector-720 #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active,
body.mahua-apk-projector-720 #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active {
  border-left-color: transparent !important;
  background: #e4ff3d !important;
  background-color: #e4ff3d !important;
  color: #101312 !important;
  -webkit-text-fill-color: #101312 !important;
  box-shadow: inset 0 0 0 1px rgba(16, 19, 18, 0.12) !important;
}

html.mahua-apk-android9 #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active *,
body.mahua-apk-android9 #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active *,
html.mahua-apk-projector-720 #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active *,
body.mahua-apk-projector-720 #appPanel #studioView .studio-mode-switch :is(#switchAgentCreateBtn, #switchManualCreateBtn).active * {
  color: #101312 !important;
  -webkit-text-fill-color: #101312 !important;
}
