:root {
  color-scheme: dark;
  --bg: #090b14;
  --panel: rgba(17, 19, 31, 0.76);
  --panel-strong: rgba(27, 29, 44, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --line-hot: rgba(19, 232, 210, 0.45);
  --text: #f7f7fb;
  --muted: #858899;
  --cyan: #12ead8;
  --blue: #5c7cff;
  --pink: #f65b9b;
  --danger: #ff6868;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -10%, rgba(67, 110, 255, 0.16), transparent 34rem),
    linear-gradient(180deg, #080a12 0%, #0c0d18 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Microsoft YaHei", sans-serif;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
}

body.auth-pending .shell {
  display: none;
}

button,
textarea,
select,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 78px 0 40px;
}

.hero {
  position: relative;
  text-align: center;
  margin-bottom: 42px;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(360px, 1.04fr) minmax(420px, 0.96fr);
  background: #f8f8fb;
}

.auth-screen.is-hidden {
  display: none;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(430px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  color: #1d2030;
}

.auth-panel h1 {
  margin: 18px 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
}

.auth-panel label,
.admin-grid label {
  display: grid;
  gap: 8px;
  color: #a5a8b6;
  font-weight: 800;
}

.auth-panel label {
  margin-top: 26px;
  color: #252633;
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-panel input,
.admin-grid input,
.admin-grid select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #171928;
}

.auth-panel input {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #dddddf;
  border-radius: 0;
  color: #1d2030;
  background: transparent;
}

.auth-panel input::placeholder {
  color: #bfc0c5;
}

.auth-panel input:focus {
  outline: 0;
  border-color: #6f3eed;
}

.auth-panel .primary {
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  color: #fff;
  background: #1d1c31;
  border-radius: 26px;
}

.auth-action {
  position: relative;
  overflow: hidden;
  transition: background 0.28s ease, color 0.28s ease, transform 0.28s ease;
}

.auth-action::after {
  content: attr(data-hover);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: #6d3bf2;
  transform: translateX(-105%);
  transition: transform 0.28s ease;
}

.auth-action:hover {
  color: transparent;
  transform: translateY(-1px);
}

.auth-action:hover::after {
  transform: translateX(0);
}

.auth-subtitle {
  margin: 0 0 8px;
  color: #84848c;
  text-align: center;
}

.auth-spark {
  color: #111;
  text-align: center;
  font-size: 1.8rem;
}

.auth-art {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 42%, rgba(255, 255, 255, 0.28), transparent 18rem),
    #c9c6d1;
}

.auth-brand {
  position: absolute;
  top: 38px;
  left: 40px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
}

.toy-stage {
  position: absolute;
  left: 50%;
  top: 53%;
  width: min(520px, 72%);
  height: 420px;
  --look-x: 0px;
  --look-y: 0px;
  --tilt: 0deg;
  transform: translate(-50%, -50%) rotate(var(--tilt));
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.character {
  position: absolute;
  bottom: 26px;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 18px 42px rgba(56, 50, 75, 0.12);
  transition:
    transform 0.7s ease-in-out,
    height 0.7s ease-in-out;
}

.char-purple {
  left: 116px;
  width: 170px;
  height: 370px;
  background: #6c3ff5;
  z-index: 1;
}

.char-black {
  left: 260px;
  width: 116px;
  height: 292px;
  background: #2d2d2d;
  z-index: 2;
}

.char-orange {
  left: 68px;
  width: 232px;
  height: 192px;
  border-radius: 50% 50% 0 0;
  background: #ff9b6b;
  z-index: 3;
}

.char-yellow {
  left: 348px;
  width: 140px;
  height: 218px;
  border-radius: 70px 70px 0 0;
  background: #e8d754;
  z-index: 4;
}

.eyes {
  position: absolute;
  display: flex;
  transition: all 0.7s ease-in-out;
}

#purple-eyes {
  left: 45px;
  top: 40px;
  gap: 28px;
}

#black-eyes {
  left: 26px;
  top: 32px;
  gap: 20px;
}

#orange-eyes {
  left: 82px;
  top: 90px;
  gap: 28px;
}

#yellow-eyes {
  left: 52px;
  top: 40px;
  gap: 20px;
}

.eyeball {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  transition: height 0.15s ease;
}

.purple-eye {
  width: 18px;
  height: 18px;
}

.black-eye {
  width: 16px;
  height: 16px;
}

.pupil {
  border-radius: 50%;
  background: #2d2d2d;
  transition: transform 0.1s ease-out;
}

#purple-pupil-l,
#purple-pupil-r {
  width: 7px;
  height: 7px;
}

#black-pupil-l,
#black-pupil-r {
  width: 6px;
  height: 6px;
}

.bare-pupil {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2d2d2d;
  transition: transform 0.7s ease-in-out;
}

.yellow-mouth {
  position: absolute;
  left: 40px;
  top: 88px;
  width: 50px;
  height: 4px;
  border-radius: 2px;
  background: #2d2d2d;
  transition: all 0.7s ease-in-out;
}

.orange-mouth {
  position: absolute;
  left: 90px;
  top: 120px;
  width: 28px;
  height: 14px;
  border: 3px solid #2d2d2d;
  border-top: 0;
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 0 0 28px 28px;
  opacity: 0;
  transform: rotate(180deg);
  transition: all 0.7s ease-in-out, opacity 0.25s ease;
}

.eyes.shake-head,
.yellow-mouth.shake-head,
.orange-mouth.shake-head {
  animation: shakeHead 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.toy {
  position: absolute;
  display: block;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 18px 42px rgba(56, 50, 75, 0.12);
  transition:
    transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1),
    left 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.toy b {
  position: absolute;
  top: 32px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f9f9fb;
  overflow: hidden;
  transition: transform 0.28s ease, opacity 0.2s ease;
}

.toy b::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2b2b2f;
  transform: translate(var(--look-x), var(--look-y));
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.toy span {
  position: absolute;
  z-index: 6;
  width: 62px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translate(-10px, 30px) rotate(-28deg);
  transform-origin: left center;
  transition:
    opacity 0.18s ease,
    transform 0.42s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.toy span:nth-of-type(1) {
  left: 18px;
  top: 28px;
}

.toy span:nth-of-type(2) {
  left: 66px;
  top: 28px;
}

.toy b:first-child {
  left: 34px;
}

.toy b:nth-child(2) {
  left: 86px;
}

.toy-purple {
  left: 116px;
  top: 22px;
  width: 170px;
  height: 280px;
  background: #6d3bf2;
  --toy-rotate: -2deg;
  transform: rotate(-2deg);
}

.toy-black {
  left: 260px;
  top: 96px;
  z-index: 2;
  width: 116px;
  height: 292px;
  background: #2d2d30;
  --toy-rotate: -2deg;
  transform: rotate(-2deg);
}

.toy-orange {
  left: 68px;
  top: 202px;
  z-index: 3;
  width: 232px;
  height: 192px;
  border-radius: 50% 50% 0 0;
  background: #ff9668;
  --toy-rotate: 0deg;
}

.toy-orange b {
  top: 78px;
  background: #29292c;
}

.toy-orange b:first-child {
  left: 64px;
}

.toy-orange b:nth-child(2) {
  left: 106px;
}

.toy-orange b::after,
.toy-yellow b::after {
  content: none;
}

.toy-yellow {
  left: 348px;
  top: 176px;
  z-index: 4;
  width: 140px;
  height: 218px;
  border-radius: 50% 50% 0 0;
  background: #eadb4c;
  --toy-rotate: -4deg;
  transform: rotate(-4deg);
}

.toy-yellow b {
  top: 32px;
  width: 13px;
  height: 13px;
  background: #2a2a2d;
}

.toy-yellow b:first-child {
  left: 34px;
}

.toy-yellow b:nth-child(2) {
  left: 66px;
}

.toy-yellow em {
  position: absolute;
  left: 28px;
  top: 78px;
  width: 54px;
  height: 4px;
  background: #2a2a2d;
}

.auth-screen.is-email .toy-stage,
.auth-screen.is-peeking .toy-stage {
  transform: translate(-47%, -50%) rotate(0.5deg);
}

.auth-screen.is-email .toy,
.auth-screen.is-peeking .toy {
  animation: toyPeek 1.7s ease-in-out infinite;
}

.auth-screen.is-email .toy-black,
.auth-screen.is-peeking .toy-black {
  animation-delay: 0.12s;
}

.auth-screen.is-email .toy-orange,
.auth-screen.is-peeking .toy-orange {
  animation-delay: 0.22s;
}

.auth-screen.is-email .toy-yellow,
.auth-screen.is-peeking .toy-yellow {
  animation-delay: 0.32s;
}

.auth-screen.is-email .toy-purple b::after {
  transform: translate(4px, 4px);
}

.auth-screen.is-email .toy-black b::after {
  transform: translate(-4px, -4px);
}

.auth-screen.is-email .toy-orange b,
.auth-screen.is-email .toy-yellow b {
  transform: translateX(5px);
}

.auth-screen.is-peeking .toy b::after {
  transform: translate(4px, 0);
}

.auth-screen.is-password-hidden .toy-stage,
.auth-screen.is-hiding .toy-stage {
  transform: translate(-66%, -50%) rotate(-2deg);
}

.auth-screen.is-password-hidden .toy,
.auth-screen.is-hiding .toy {
  animation: none;
}

.auth-screen.is-password-hidden .toy-purple,
.auth-screen.is-hiding .toy-purple {
  transform: translateX(-26px) rotate(-8deg);
}

.auth-screen.is-password-hidden .toy-black,
.auth-screen.is-hiding .toy-black {
  transform: translateX(-42px) rotate(-9deg);
}

.auth-screen.is-password-hidden .toy-orange,
.auth-screen.is-hiding .toy-orange {
  transform: translateX(-34px) rotate(-4deg);
}

.auth-screen.is-password-hidden .toy-yellow,
.auth-screen.is-hiding .toy-yellow {
  transform: translateX(-48px) rotate(-12deg);
}

.auth-screen.is-password-hidden .toy b,
.auth-screen.is-hiding .toy b {
  transform: translate(-4px, -3px);
}

.auth-screen.is-password-hidden .toy b::after {
  transform: translate(-4px, -4px);
}

.auth-screen.is-password-visible .toy-stage {
  transform: translate(-57%, -50%) rotate(-0.8deg);
}

.auth-screen.is-password-visible .toy b::after {
  transform: translate(-5px, -4px);
}

.auth-screen.is-password-visible.is-purple-peek .toy-purple b::after {
  transform: translate(5px, 4px);
}

.auth-screen.is-error-state .toy-stage {
  animation: authShake 0.78s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.auth-screen.is-error-state .toy b::after {
  transform: translate(-3px, 4px);
}

.auth-screen.is-error-state .toy-yellow em {
  transform: rotate(-8deg);
}

.auth-screen.is-blinking-purple .toy-purple b,
.auth-screen.is-blinking-black .toy-black b {
  transform: scaleY(0.14);
}

.toy-orange span {
  top: 74px;
  width: 70px;
  background: #ffb088;
}

.toy-orange span:nth-of-type(1) {
  left: 42px;
}

.toy-orange span:nth-of-type(2) {
  left: 88px;
}

.toy-yellow span {
  top: 30px;
  width: 48px;
  background: #f2e779;
}

.toy-yellow span:nth-of-type(1) {
  left: 24px;
}

.toy-yellow span:nth-of-type(2) {
  left: 54px;
}

.toy-black span {
  background: #48484d;
}

.toy-purple span {
  background: #8c66ff;
}

@keyframes toyPeek {
  0%, 100% {
    transform: translateY(0) rotate(var(--toy-rotate, 0deg));
  }
  50% {
    transform: translateY(-8px) rotate(var(--toy-rotate, 0deg));
  }
}

@keyframes authShake {
  0%, 100% { transform: translate(-50%, -50%) translateX(0); }
  10% { transform: translate(-50%, -50%) translateX(-9px); }
  20% { transform: translate(-50%, -50%) translateX(8px); }
  30% { transform: translate(-50%, -50%) translateX(-7px); }
  40% { transform: translate(-50%, -50%) translateX(6px); }
  50% { transform: translate(-50%, -50%) translateX(-5px); }
  60% { transform: translate(-50%, -50%) translateX(4px); }
  80% { transform: translate(-50%, -50%) translateX(-2px); }
}

.auth-links {
  position: absolute;
  left: 38px;
  bottom: 34px;
  display: flex;
  gap: 30px;
}

.auth-links a {
  color: rgba(34, 34, 42, 0.48);
  font-size: 0.85rem;
  text-decoration: none;
}

.password-row {
  position: relative;
  display: block;
}

.password-row button {
  position: absolute;
  right: 0;
  top: 50%;
  border: 0;
  color: #6f7180;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.auth-options,
.auth-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  color: #6d6d76;
  font-size: 0.88rem;
}

.auth-options button,
.auth-switch button {
  border: 0;
  color: #5d3397;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.remember-row {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  margin: 0 !important;
  font-size: 0.88rem !important;
}

.remember-row input {
  width: 16px;
  min-height: 16px;
  accent-color: #6f3eed;
}

.social-login {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 1px solid #e1e1e5;
  border-radius: 26px;
  color: #30313a;
  background: #f6f6f7;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.auth-switch {
  justify-content: center;
  margin-top: 30px;
}

.auth-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--danger);
  font-weight: 800;
  text-align: center;
}

.account-bar {
  position: absolute;
  top: -48px;
  right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  color: #a5a8b6;
  font-weight: 800;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.user-menu-arrow {
  color: var(--cyan);
  font-size: 0.95rem;
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 15, 26, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.user-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 24px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: rgba(13, 15, 26, 0.98);
  transform: rotate(45deg);
}

.user-menu-logout {
  width: 100%;
  margin-top: 12px;
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.hero h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(3.4rem, 8vw, 6rem);
  line-height: 0.9;
  letter-spacing: 0;
  background: linear-gradient(92deg, #13ead8 8%, #7e62ff 54%, #16d8f4 96%);
  -webkit-background-clip: text;
  color: transparent;
}

.hero p {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.3rem;
  font-weight: 700;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  margin-bottom: 44px;
  padding: 18px 24px;
  border-radius: 8px;
  background: rgba(14, 16, 27, 0.72);
  box-shadow: var(--shadow);
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 144px;
  justify-content: center;
  border: 0;
  color: #5f6374;
  background: transparent;
  font-weight: 800;
}

.step span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
}

.step.is-active {
  color: var(--cyan);
}

.step.is-active span {
  color: #071016;
  border-color: var(--cyan);
  background: var(--cyan);
}

.steps i {
  width: min(92px, 12vw);
  height: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.panel {
  margin-bottom: 32px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.input-panel {
  border-color: rgba(19, 232, 210, 0.22);
}

.admin-panel {
  border-color: rgba(246, 91, 155, 0.22);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.admin-nav-button {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.admin-nav-button.is-active {
  color: #081018;
  border-color: transparent;
  background: var(--cyan);
}

.admin-page {
  margin-top: 26px;
}

.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-page-head h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.admin-page-head p {
  margin: 0;
  color: var(--muted);
}

.admin-create-user {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(130px, 0.5fr) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-create-user input,
.admin-create-user select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #171928;
}

.admin-create-user .primary {
  min-height: 44px;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-top: 24px;
}

.account-menu-form {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.account-menu-form .primary {
  width: 100%;
  min-height: 44px;
}

.account-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.account-form input,
.admin-user-username {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.account-form input:focus,
.admin-user-username:focus {
  outline: 2px solid rgba(19, 232, 210, 0.35);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.admin-save {
  align-self: end;
}

.admin-users-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-users-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.admin-users-table th,
.admin-users-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-users-table th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-users-table tr:last-child td {
  border-bottom: 0;
}

.admin-users-table select {
  min-height: 38px;
  min-width: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #171928;
}

.user-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #081018;
  background: var(--cyan);
  font-size: 0.72rem;
}

.user-status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
  color: var(--text);
}

.admin-user-actions {
  display: flex;
  gap: 8px;
}

.danger-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 104, 104, 0.35);
  border-radius: 8px;
  color: #ffb3b3;
  background: rgba(255, 104, 104, 0.08);
  cursor: pointer;
}

.danger-button:disabled,
.admin-users-table select:disabled,
.user-status-toggle input:disabled,
.ghost-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.upload-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 610px;
  margin-bottom: 32px;
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.upload-empty {
  display: grid;
  gap: 12px;
  text-align: center;
  color: var(--muted);
}

.upload-empty strong {
  color: var(--text);
  font-size: 1.35rem;
}

.upload-preview {
  position: relative;
  z-index: 3;
  width: min(1040px, calc(100% - 40px));
  min-height: min(540px, 68vw);
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
}

.upload-preview img {
  display: block;
  width: 100%;
  height: min(560px, 64vw);
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.upload-preview span {
  display: block;
  margin-top: 14px;
  color: #666b7a;
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.icon-button,
.round {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.icon-button svg,
.download-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.remove-image {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 40px;
  height: 40px;
  pointer-events: auto;
  border-radius: 50%;
  border: 0;
  background: var(--danger);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.25rem;
  line-height: 1;
}

.prompt-head,
.section-title,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

h2 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.section-title p {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
}

textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  margin: 22px 0 28px;
  padding: 24px 28px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  line-height: 1.8;
  font-weight: 700;
}

textarea:focus,
select:focus {
  outline: 2px solid rgba(19, 232, 210, 0.35);
}

select {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #171928;
  font-weight: 700;
}

.user-provider-controls select {
  display: none;
}

.actions.user-provider-controls {
  justify-content: center;
}

.primary,
.download-button,
.custom-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 28px;
  border: 0;
  border-radius: 8px;
  color: #071016;
  background: linear-gradient(90deg, var(--cyan), #6b63ff);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.status {
  margin: 26px 0 0;
  color: #a5a8b6;
  font-weight: 800;
}

#storageStatus {
  display: none;
}

.generated-panel {
  position: relative;
}

.history-controls {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}

.round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #8c90a1;
  background: rgba(8, 10, 18, 0.82);
  backdrop-filter: blur(12px);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.45rem;
  line-height: 40px;
  pointer-events: auto;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.generated-card {
  position: relative;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
}

.generated-card.is-selected {
  box-shadow: none;
}

.generated-image-button,
.gallery-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  cursor: zoom-in;
}

.generated-image-button {
  display: grid;
  place-items: center;
  min-height: 280px;
  max-height: min(78vh, 760px);
  background: #f8fbff;
}

.generated-card img,
.gallery-image-button img {
  display: block;
  width: 100%;
}

.generated-card img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(78vh, 760px);
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
}

.generated-tools {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.selected-badge,
.select-image,
.image-download,
.gallery-tag {
  padding: 8px 12px;
  border-radius: 8px;
  border: 0;
  color: #061015;
  background: var(--cyan);
  font-size: 0.88rem;
  font-weight: 900;
}

.selected-badge,
.select-image,
.image-download {
  position: static;
  pointer-events: auto;
}

.select-image {
  color: var(--text);
  background: rgba(8, 10, 18, 0.72);
  cursor: pointer;
}

.image-download {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
}

.image-download svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.empty-note {
  margin-top: 36px;
  padding: 50px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.model-action {
  display: flex;
  width: fit-content;
}

.model-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 42px auto 0;
}

.model-panel {
  border-color: rgba(19, 232, 210, 0.18);
}

.download-button {
  min-height: 44px;
  padding: 0 18px;
  background: var(--cyan);
}

.download-button.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.model-history-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  margin-top: 26px;
  color: #a5a8b6;
  font-weight: 800;
}

.model-history-button {
  width: 40px;
  height: 40px;
  font-size: 1.45rem;
}

.model-history-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.viewer-wrap {
  position: relative;
  height: min(620px, 62vw);
  min-height: 360px;
  margin-top: 34px;
  overflow: hidden;
  border-radius: 8px;
  background: #30313d;
}

#modelCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 800;
  pointer-events: none;
}

.custom-button {
  display: flex;
  width: fit-content;
  min-width: 220px;
  margin: 30px auto 0;
  color: #fff;
  background: linear-gradient(90deg, #ff62b0, #d94d73);
}

.masonry {
  columns: 2 300px;
  column-gap: 24px;
  margin-top: 34px;
}

.gallery-item {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  break-inside: avoid;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-tag {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 18px;
  left: 18px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(5, 7, 14, 0.88);
}

.lightbox-image {
  display: block;
  max-width: min(1120px, 100%);
  max-height: min(82vh, 880px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(8, 10, 18, 0.86);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(8, 10, 18, 0.82);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.lightbox-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

.generation-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px;
  color: var(--text);
  text-align: center;
  background: rgba(2, 5, 8, 0.78);
  backdrop-filter: blur(12px);
}

.generation-overlay strong {
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.generation-overlay p {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  font-weight: 700;
}

.generation-loader {
  position: relative;
  width: 86px;
  height: 86px;
}

.generation-loader span {
  position: absolute;
  inset: 8px;
  border: 4px solid transparent;
  border-radius: 50%;
  animation: generation-spin 1.1s linear infinite;
}

.generation-loader span:nth-child(1) {
  border-top-color: #ffffff;
  transform: rotate(16deg);
}

.generation-loader span:nth-child(2) {
  border-right-color: var(--cyan);
  animation-delay: -0.18s;
  transform: rotate(138deg);
}

.generation-loader span:nth-child(3) {
  border-bottom-color: #7c3cff;
  animation-delay: -0.36s;
  transform: rotate(252deg);
}

body.is-generating {
  overflow: hidden;
}

@keyframes generation-spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  max-width: min(520px, calc(100% - 32px));
  transform: translateX(-50%) translateY(120px);
  padding: 14px 18px;
  border: 1px solid var(--line-hot);
  border-radius: 8px;
  color: var(--text);
  background: rgba(10, 12, 20, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: 0.24s ease;
  font-weight: 800;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 760px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }

  .auth-art {
    display: none;
  }

  .auth-panel {
    width: min(100% - 32px, 430px);
  }

  .shell {
    width: min(100% - 24px, 560px);
    padding-top: 44px;
  }

  .hero h1 {
    font-size: 3.4rem;
  }

  .steps {
    padding: 14px 10px;
  }

  .step {
    min-width: auto;
    flex-direction: column;
    gap: 8px;
    font-size: 0.82rem;
  }

  .steps i {
    width: 24px;
  }

  .panel {
    padding: 22px;
  }

  .upload-zone {
    min-height: 360px;
  }

  .upload-preview {
    width: calc(100% - 24px);
  }

  .prompt-head,
  .section-title,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-bar {
    position: relative;
    top: auto;
    right: auto;
    justify-content: center;
    margin-bottom: 22px;
  }

  .user-menu {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .history-controls {
    flex-direction: row;
  }

  .primary,
  select {
    width: 100%;
  }

  .custom-button {
    width: 100%;
  }

  .model-controls {
    flex-direction: column;
  }

  .admin-create-user {
    grid-template-columns: 1fr;
  }
}
