:root {
  --bg: #07090f;
  --panel: rgba(13, 20, 31, 0.74);
  --panel-strong: rgba(20, 31, 44, 0.92);
  --line: rgba(122, 242, 255, 0.24);
  --text: #eef8ff;
  --muted: #8ca5b8;
  --cyan: #63f6ff;
  --green: #92ffb7;
  --rose: #ff5c9f;
  --amber: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  font-family: "Bahnschrift", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(99, 246, 255, 0.24), transparent 28rem),
    radial-gradient(circle at 82% 10%, rgba(255, 92, 159, 0.2), transparent 30rem),
    linear-gradient(135deg, #07090f 0%, #0a1117 48%, #08080c 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.aurora,
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.aurora {
  z-index: -2;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(99, 246, 255, 0.08) 18% 19%, transparent 19% 42%, rgba(146, 255, 183, 0.08) 42% 43%, transparent 43%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 90px);
  animation: drift 12s linear infinite;
}

.scanline {
  z-index: 20;
  opacity: 0.25;
  mix-blend-mode: screen;
  background: repeating-linear-gradient(180deg, transparent 0 8px, rgba(255, 255, 255, 0.04) 9px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 15, 0.78);
  backdrop-filter: blur(20px);
}

.brand,
.account-pill,
.nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--cyan);
  background: linear-gradient(145deg, rgba(99, 246, 255, 0.22), rgba(255, 92, 159, 0.12));
  box-shadow: 0 0 32px rgba(99, 246, 255, 0.35);
  color: var(--cyan);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.small-note {
  color: var(--muted);
}

.nav {
  gap: 8px;
}

.nav a,
.ghost-button,
.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav a,
.ghost-button,
.secondary-button {
  padding: 10px 14px;
}

.account-pill {
  gap: 12px;
  color: var(--muted);
}

.credit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 210, 96, 0.34);
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 210, 96, 0.1);
  color: #ffe7a3;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

button,
.primary-button,
.secondary-button,
.ghost-button,
.upload-zone {
  min-height: 42px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.upload-zone:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 246, 255, 0.7);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(99, 246, 255, 0.8);
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(99, 246, 255, 0.95), rgba(146, 255, 183, 0.88));
  box-shadow: 0 0 38px rgba(99, 246, 255, 0.3);
  color: #031014;
  font-weight: 800;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(380px, 0.92fr) minmax(360px, 0.88fr);
  gap: clamp(28px, 4vw, 64px);
  min-height: calc(100vh - 92px);
  padding: clamp(34px, 5vw, 68px) clamp(18px, 5vw, 72px) 42px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 20px;
  font-size: clamp(3.1rem, 6.8vw, 6.4rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  line-height: 1;
}

.hero-text {
  max-width: 640px;
  color: #b9cad6;
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.orbit-composer {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto auto;
  gap: 10px;
  max-width: 520px;
  margin-top: 18px;
  margin-left: clamp(180px, 14vw, 250px);
  padding: 10px;
  border: 1px solid rgba(99, 246, 255, 0.24);
  background:
    linear-gradient(90deg, rgba(99, 246, 255, 0.08), rgba(255, 92, 159, 0.05)),
    rgba(3, 8, 13, 0.58);
  box-shadow: 0 0 34px rgba(99, 246, 255, 0.1);
  backdrop-filter: blur(12px);
}

.orbit-composer input {
  min-height: 42px;
  border-color: rgba(99, 246, 255, 0.22);
  background: rgba(0, 0, 0, 0.3);
}

.barrage-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(99, 246, 255, 0.28);
  border-radius: 6px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 900;
}

.barrage-toggle span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
}

.barrage-toggle b {
  font: inherit;
}

.barrage-toggle.is-on {
  border-color: rgba(146, 255, 183, 0.44);
  background: rgba(146, 255, 183, 0.1);
  color: var(--green);
}

.hero-stage {
  position: relative;
  display: grid;
  min-height: min(62vh, 590px);
  max-height: 620px;
  aspect-ratio: 1 / 1;
  place-items: center;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 42%, rgba(99, 246, 255, 0.18), transparent 20rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow), inset 0 0 80px rgba(99, 246, 255, 0.08);
  overflow: hidden;
}

.hero-stage::before {
  content: "";
  position: absolute;
  inset: 10%;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(99, 246, 255, 0.32) 50%, transparent 50.3%),
    linear-gradient(0deg, transparent 49.7%, rgba(255, 92, 159, 0.22) 50%, transparent 50.3%);
  transform: perspective(600px) rotateX(62deg);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(99, 246, 255, 0.38);
  transform: rotate(-12deg);
  animation: pulse 3s ease-in-out infinite;
}

.orbit-one {
  width: 72%;
  height: 52%;
}

.orbit-two {
  width: 48%;
  height: 72%;
  border-color: rgba(255, 92, 159, 0.3);
  animation-delay: -1.2s;
}

.pet-hologram {
  position: relative;
  width: min(30vw, 300px);
  aspect-ratio: 0.68;
  border-bottom: 2px solid rgba(99, 246, 255, 0.65);
  filter: drop-shadow(0 0 32px rgba(99, 246, 255, 0.35));
  animation: hover 2.6s ease-in-out infinite;
}

.pet-hologram img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.telemetry {
  position: absolute;
  width: 132px;
  border: 1px solid var(--line);
  padding: 12px;
  background: rgba(7, 9, 15, 0.72);
}

.telemetry span,
.telemetry strong {
  display: block;
}

.telemetry strong {
  font-size: 2rem;
  color: var(--green);
}

.telemetry-left {
  left: 9%;
  top: 20%;
}

.telemetry-right {
  right: 9%;
  bottom: 18%;
}

.feature-band,
.workspace,
.community {
  padding: 70px clamp(18px, 5vw, 72px);
}

.page-shell {
  min-height: calc(100vh - 80px);
  padding: clamp(34px, 5vw, 72px) clamp(18px, 5vw, 72px) 76px;
}

.page-hero {
  max-width: 960px;
  margin-bottom: 30px;
}

.page-hero h1 {
  margin-bottom: 16px;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
}

.page-hero p:not(.eyebrow) {
  max-width: 720px;
  color: #b9cad6;
  font-size: 1.08rem;
  line-height: 1.8;
}

.compact-hero,
.community-hero {
  padding-top: 8px;
}

.route-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 0 clamp(18px, 5vw, 72px) 76px;
}

.route-card {
  min-height: 240px;
  border: 1px solid var(--line);
  padding: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(135deg, rgba(99, 246, 255, 0.12), rgba(255, 92, 159, 0.05)),
    rgba(13, 20, 31, 0.74);
  box-shadow: var(--shadow);
}

.route-card span {
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
}

body[data-page="home"] {
  background:
    radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 35%), rgba(99, 246, 255, 0.18), transparent 18rem),
    radial-gradient(circle at 82% 18%, rgba(255, 92, 159, 0.2), transparent 34rem),
    linear-gradient(135deg, #03050a 0%, #071116 46%, #0b0710 100%);
}

.spectacle-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 80px);
  padding: clamp(44px, 6vw, 82px) clamp(18px, 5vw, 72px);
  overflow: hidden;
  isolation: isolate;
}

.constellation-canvas {
  position: absolute;
  inset: 0;
  z-index: -4;
  width: 100%;
  height: 100%;
}

.spectacle-hero::before,
.spectacle-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.spectacle-hero::before {
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(99, 246, 255, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(99, 246, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 54% 48%, black, transparent 72%);
}

.spectacle-hero::after {
  inset: 10% -8% auto auto;
  z-index: -2;
  width: 62vw;
  height: 62vw;
  border: 1px solid rgba(99, 246, 255, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 246, 255, 0.08), transparent 62%);
  animation: spin-slow 22s linear infinite;
}

.spectacle-copy {
  position: relative;
  z-index: 2;
  align-self: start;
  max-width: min(860px, 62vw);
  padding-top: clamp(38px, 5vh, 64px);
}

.spectacle-copy h1 {
  max-width: 900px;
  font-size: clamp(3.8rem, 7vw, 7.6rem);
  line-height: 1.02;
  overflow-wrap: break-word;
  text-shadow: 0 0 42px rgba(99, 246, 255, 0.2);
}

.spectacle-copy .hero-text {
  max-width: 690px;
  color: #c4d7e2;
}

.big-button {
  min-height: 58px;
  padding-inline: 28px;
  font-size: 1rem;
}

.magnetic {
  will-change: transform;
}

.holo-lab {
  position: absolute;
  right: clamp(18px, 8vw, 128px);
  bottom: clamp(64px, 10vh, 118px);
  z-index: 1;
  display: grid;
  width: min(34vw, 470px);
  aspect-ratio: 1;
  place-items: center;
  transform-style: preserve-3d;
  transition: transform 180ms ease;
}

.holo-dial,
.hero-rings > span {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.holo-dial {
  inset: 4%;
  border: 1px solid rgba(99, 246, 255, 0.28);
  background:
    conic-gradient(from 90deg, transparent 0 16%, rgba(99, 246, 255, 0.32) 17% 18%, transparent 19% 42%, rgba(255, 92, 159, 0.28) 43% 44%, transparent 45%),
    radial-gradient(circle, rgba(99, 246, 255, 0.08), transparent 58%);
  animation: spin-slow 12s linear infinite;
}

.holo-dial::before,
.holo-dial::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.holo-dial::before {
  inset: 14%;
  border: 1px dashed rgba(146, 255, 183, 0.28);
  animation: spin-reverse 16s linear infinite;
}

.holo-dial::after {
  inset: 35%;
  background: radial-gradient(circle, rgba(99, 246, 255, 0.26), rgba(255, 92, 159, 0.08), transparent 68%);
  filter: blur(12px);
}

.holo-pet {
  position: relative;
  z-index: 2;
  width: 48%;
  aspect-ratio: 0.68;
  filter: drop-shadow(0 0 34px rgba(99, 246, 255, 0.38));
  animation: hover 2.6s ease-in-out infinite;
}

.holo-pet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.core-button {
  position: absolute;
  right: 11%;
  bottom: 17%;
  z-index: 4;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid rgba(99, 246, 255, 0.58);
  border-radius: 50%;
  background: rgba(3, 9, 14, 0.78);
  box-shadow: 0 0 42px rgba(99, 246, 255, 0.28), inset 0 0 22px rgba(99, 246, 255, 0.16);
}

.core-button span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff, var(--cyan) 38%, transparent 72%);
  animation: core-pulse 1.8s ease-in-out infinite;
}

.hero-rings {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  perspective: 900px;
}

.hero-rings > span {
  position: absolute;
  border: 1px solid rgba(99, 246, 255, 0.13);
  border-radius: 50%;
  box-shadow: inset 0 0 28px rgba(99, 246, 255, 0.035), 0 0 22px rgba(99, 246, 255, 0.045);
  transform: rotateX(68deg) rotateZ(-18deg);
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

.hero-rings > span:nth-child(1) {
  right: 8%;
  bottom: 7%;
  width: 42vw;
  height: 42vw;
  animation: orbit-ring-spin 28s linear infinite, pulse 4s ease-in-out infinite;
}

.hero-rings > span:nth-child(2) {
  right: 17%;
  bottom: 18%;
  width: 24vw;
  height: 24vw;
  border-color: rgba(255, 92, 159, 0.16);
  animation: orbit-ring-spin-reverse 20s linear infinite, pulse 4s ease-in-out -1.4s infinite;
}

.hero-rings > span:nth-child(3) {
  left: -12vw;
  top: 14%;
  width: 38vw;
  height: 38vw;
  border-color: rgba(146, 255, 183, 0.14);
  animation: orbit-ring-spin 34s linear infinite, pulse 5.6s ease-in-out -2s infinite;
}

.hero-rings > span:nth-child(4) {
  right: -4%;
  top: 5%;
  width: 64vw;
  height: 64vw;
  border-color: rgba(99, 246, 255, 0.1);
  animation: orbit-ring-spin-reverse 46s linear infinite;
}

.hero-rings > span:nth-child(5) {
  right: 5%;
  top: 17%;
  width: 48vw;
  height: 48vw;
  border-style: dashed;
  border-color: rgba(146, 255, 183, 0.14);
  animation: orbit-ring-spin 32s linear infinite;
}

.hero-rings > span:nth-child(6) {
  right: 24%;
  top: 27%;
  width: 30vw;
  height: 30vw;
  border-color: rgba(255, 92, 159, 0.13);
  animation: orbit-ring-spin-reverse 24s linear infinite;
}

.hero-rings > span:nth-child(7) {
  right: 34%;
  bottom: -12%;
  width: 52vw;
  height: 52vw;
  border-color: rgba(99, 246, 255, 0.08);
  animation: orbit-ring-spin 52s linear infinite;
}

.orbit-barrage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.orbit-message {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  animation: orbit-message var(--orbit-duration, 13s) linear forwards;
  will-change: transform, opacity;
}

.orbit-message::before,
.orbit-message::after {
  display: none;
}

.meteor-tail {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: var(--orbit-trail, 180px);
  height: calc(var(--orbit-capsule, 2.1rem) * 1.05);
  pointer-events: none;
  background:
    radial-gradient(ellipse at 100% 50%, color-mix(in srgb, var(--orbit-color, #63f6ff) 58%, transparent) 0 16%, transparent 55%),
    linear-gradient(90deg, transparent 0 8%, color-mix(in srgb, var(--orbit-color, #63f6ff) 5%, transparent) 28%, color-mix(in srgb, var(--orbit-color, #63f6ff) 42%, transparent) 76%, color-mix(in srgb, var(--orbit-color, #63f6ff) 78%, transparent) 100%);
  clip-path: polygon(0 50%, 100% 4%, 100% 96%);
  filter: blur(7px);
  opacity: 0.68;
  transform: translate(-100%, -50%) rotate(var(--orbit-trail-angle, 0deg));
  transform-origin: right center;
}

.meteor-tail::before,
.meteor-tail::after {
  position: absolute;
  content: "";
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.meteor-tail::before {
  width: 78%;
  height: max(2px, calc(var(--orbit-capsule, 2.1rem) * 0.1));
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), color-mix(in srgb, var(--orbit-color, #63f6ff) 80%, white 20%));
  box-shadow: 0 0 18px color-mix(in srgb, var(--orbit-color, #63f6ff) 54%, transparent);
  opacity: 0.9;
}

.meteor-tail::after {
  width: calc(var(--orbit-capsule, 2.1rem) * 0.72);
  height: calc(var(--orbit-capsule, 2.1rem) * 0.72);
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--orbit-color, #63f6ff) 72%, white 18%), transparent 62%);
  filter: blur(5px);
  opacity: 0.72;
}

.meteor-tail b {
  position: absolute;
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--orbit-color, #63f6ff) 74%, white 18%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--orbit-color, #63f6ff) 54%, transparent);
}

.meteor-tail b:nth-child(1) { left: 18%; top: 35%; opacity: 0.48; }
.meteor-tail b:nth-child(2) { left: 42%; top: 64%; opacity: 0.62; }
.meteor-tail b:nth-child(3) { left: 68%; top: 28%; opacity: 0.42; }

.orbit-message span::before {
  position: absolute;
  inset: -8px -12px;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--orbit-color, #63f6ff) 24%, transparent), transparent 70%);
  content: "";
  filter: blur(10px);
}

.orbit-message span {
  position: relative;
  z-index: 2;
  display: inline-flex;
  width: auto;
  height: auto;
  min-height: calc(var(--orbit-font-size, 0.92rem) * 2.2);
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--orbit-color, #63f6ff) 72%, transparent);
  border-radius: 999px;
  padding: 0.45em 0.9em;
  background: rgba(4, 12, 18, 0.74);
  box-shadow:
    0 0 20px color-mix(in srgb, var(--orbit-color, #63f6ff) 42%, transparent),
    0 0 44px color-mix(in srgb, var(--orbit-color, #63f6ff) 16%, transparent);
  color: #f2fffb;
  font-size: var(--orbit-font-size, 0.92rem);
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 0 12px color-mix(in srgb, var(--orbit-color, #63f6ff) 54%, transparent);
  white-space: nowrap;
}

.orbit-message.is-fading {
  opacity: 0;
  transition: opacity 600ms ease;
}

.hud-panel {
  position: absolute;
  z-index: 3;
  min-width: 190px;
  border: 1px solid rgba(99, 246, 255, 0.24);
  padding: 14px;
  background: linear-gradient(135deg, rgba(6, 13, 20, 0.76), rgba(20, 31, 44, 0.42));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.hud-panel span,
.hud-panel small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hud-panel strong {
  display: block;
  margin: 4px 0;
  color: var(--green);
  font-size: 2.3rem;
}

.hud-left {
  left: clamp(18px, 5vw, 72px);
  bottom: 8vh;
}

.hud-right {
  right: clamp(18px, 5vw, 72px);
  top: 12vh;
}

.status-rail {
  position: absolute;
  right: clamp(18px, 5vw, 72px);
  bottom: 24px;
  left: clamp(18px, 5vw, 72px);
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(99, 246, 255, 0.16);
  background: rgba(99, 246, 255, 0.12);
}

.status-rail span {
  padding: 12px;
  background: rgba(3, 7, 12, 0.8);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-align: center;
}

.spectacle-band {
  position: relative;
  z-index: 2;
  margin-top: 0;
}

.spectacle-routes {
  background:
    radial-gradient(circle at 25% 50%, rgba(99, 246, 255, 0.08), transparent 26rem),
    linear-gradient(180deg, rgba(7, 9, 15, 0.1), rgba(7, 9, 15, 0.8));
}

.hyperspace .holo-lab {
  animation: lab-jump 820ms cubic-bezier(.2, .8, .2, 1);
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(99, 246, 255, 0.14);
}

.feature-band article {
  min-height: 220px;
  padding: clamp(22px, 4vw, 38px);
  background: rgba(7, 9, 15, 0.94);
}

.feature-band span,
.status-chip {
  color: var(--amber);
}

.console-content-stack {
  display: grid;
  gap: clamp(38px, 5vw, 72px);
  position: relative;
  padding: 10px 0 44px;
}

.console-content-stack::before {
  position: absolute;
  top: 12px;
  bottom: 0;
  left: clamp(10px, 1.6vw, 22px);
  width: 1px;
  pointer-events: none;
  content: "";
  background: linear-gradient(
    180deg,
    transparent,
    rgba(99, 246, 255, 0.42) 12%,
    rgba(255, 92, 159, 0.18) 48%,
    rgba(146, 255, 183, 0.34) 88%,
    transparent
  );
  box-shadow: 0 0 22px rgba(99, 246, 255, 0.2);
}

.deck-panel {
  position: relative;
  overflow: hidden;
  margin-left: clamp(0px, 2vw, 18px);
  border-color: rgba(99, 246, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 34%),
    var(--panel);
}

.deck-panel::after {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 1px;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(99, 246, 255, 0.76), rgba(255, 92, 159, 0.44), transparent);
  opacity: 0.68;
}

.deck-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(99, 246, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 160px);
  opacity: 0.75;
}

.deck-panel > * {
  position: relative;
  z-index: 1;
}

.deck-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(99, 246, 255, 0.16);
}

.module-divider {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  margin: -12px clamp(8px, 3vw, 42px);
  padding: 0 clamp(12px, 2vw, 24px);
  color: var(--muted);
}

.module-divider::before {
  position: absolute;
  inset: 50% 0 auto;
  height: 42px;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 14% 50%, rgba(99, 246, 255, 0.18), transparent 9rem),
    linear-gradient(90deg, transparent, rgba(99, 246, 255, 0.05), transparent);
  transform: translateY(-50%) skewX(-12deg);
}

.module-divider-index {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(99, 246, 255, 0.42);
  background: rgba(5, 12, 20, 0.82);
  box-shadow: 0 0 22px rgba(99, 246, 255, 0.16);
  color: var(--cyan);
  font-weight: 900;
}

.module-divider-line {
  position: relative;
  height: 1px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(99, 246, 255, 0.16), rgba(255, 92, 159, 0.28), rgba(146, 255, 183, 0.16));
}

.module-divider-line::after {
  position: absolute;
  inset: 0;
  width: 120px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(99, 246, 255, 0.86), transparent);
  animation: divider-scan 3.6s ease-in-out infinite;
}

.module-divider-copy {
  position: relative;
  color: rgba(238, 248, 255, 0.68);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.module-divider-pulse {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(146, 255, 183, 0.82);
  animation: divider-pulse 1.8s ease-in-out infinite;
}

.deck-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2.2rem);
}

.control-deck .console-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(520px, 1.38fr);
  gap: 16px;
  align-items: stretch;
}

.generator-panel {
  display: grid;
  gap: 12px;
}

.generator-panel textarea {
  min-height: 132px;
}

.generator-mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px;
  width: min(100%, 430px);
  padding: 5px;
  border: 1px solid rgba(99, 246, 255, 0.2);
  background: rgba(2, 8, 14, 0.58);
}

.generator-mode-tabs button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.generator-mode-tabs button.active {
  background: linear-gradient(135deg, rgba(99, 246, 255, 0.22), rgba(146, 255, 183, 0.12));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(99, 246, 255, 0.28);
}

.builtin-prompt-toggle {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  width: min(100%, 780px);
  padding: 10px 12px;
  border: 1px solid rgba(146, 255, 183, 0.2);
  background:
    linear-gradient(90deg, rgba(146, 255, 183, 0.1), rgba(99, 246, 255, 0.05)),
    rgba(2, 8, 14, 0.5);
  color: var(--text);
  font-size: 0.86rem;
}

.builtin-prompt-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.builtin-prompt-toggle span {
  font-weight: 800;
}

.builtin-prompt-toggle small {
  color: var(--muted);
  line-height: 1.5;
}

.generator-workspace {
  display: grid;
  gap: 16px;
}

.generator-body {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.generator-card,
.generator-output {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(99, 246, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(99, 246, 255, 0.08), transparent 32%),
    rgba(4, 10, 18, 0.48);
}

.generator-card[hidden] {
  display: none;
}

.generator-card::before,
.generator-output::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(146, 255, 183, 0.08);
  pointer-events: none;
}

.generator-upload {
  min-height: 76px;
}

.reference-preview {
  display: grid;
  place-items: center;
  min-height: 130px;
  border: 1px dashed rgba(99, 246, 255, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    rgba(0, 0, 0, 0.18);
  background-size: 16px 16px;
  color: var(--muted);
}

.reference-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.generator-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
}

.generator-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.generated-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  min-height: 156px;
}

.generated-empty {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  min-height: 132px;
  border: 1px dashed rgba(99, 246, 255, 0.2);
  color: var(--muted);
}

.generated-tile {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 7, 12, 0.72);
  color: var(--text);
  text-align: left;
}

.generated-tile.selected {
  border-color: rgba(146, 255, 183, 0.92);
  box-shadow: 0 0 24px rgba(146, 255, 183, 0.14), inset 0 0 0 1px rgba(146, 255, 183, 0.35);
}

.generated-tile img {
  width: 100%;
  height: 124px;
  object-fit: contain;
  background:
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 12px 12px;
}

.generated-tile span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-tile small {
  overflow: hidden;
  color: rgba(146, 255, 183, 0.72);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.image-preview-card {
  width: min(92vw, 980px);
  max-height: 88vh;
  padding: 18px;
  border: 1px solid rgba(99, 246, 255, 0.26);
  background:
    radial-gradient(circle at 18% 0%, rgba(99, 246, 255, 0.16), transparent 34%),
    rgba(3, 8, 14, 0.96);
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.image-preview-stage {
  display: grid;
  place-items: center;
  min-height: 320px;
  max-height: 72vh;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.055) 1px, transparent 1px),
    rgba(0, 0, 0, 0.2);
  background-size: 18px 18px;
}

.image-preview-stage img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.status-chip[data-ready="true"] {
  border-color: rgba(146, 255, 183, 0.44);
  color: #92ffb7;
}

.login-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
}

.login-gate[hidden] {
  display: none;
}

.is-locked {
  pointer-events: none;
  opacity: 0.42;
  filter: saturate(0.65);
}

.panel,
.share-panel,
.auth-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  padding: 18px;
}

.panel-title,
.share-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.desktop-pet-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.desktop-pet-controls .small-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgba(99, 246, 255, 0.16);
  background: rgba(0, 0, 0, 0.18);
}

.local-agent-card {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 209, 102, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(99, 246, 255, 0.04));
  box-shadow: inset 0 0 26px rgba(255, 209, 102, 0.055);
}

.local-agent-card div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.local-agent-card span {
  color: var(--text);
  font-weight: 800;
}

.local-agent-card small {
  color: var(--yellow);
  text-align: right;
}

.local-agent-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.agent-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 10px;
  padding: 7px 12px;
  border: 1px solid rgba(99, 246, 255, 0.28);
  background: rgba(99, 246, 255, 0.1);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.agent-download-link:hover {
  border-color: rgba(146, 255, 183, 0.42);
  color: var(--green);
}

.local-agent-card.is-ready {
  border-color: rgba(146, 255, 183, 0.34);
  background:
    radial-gradient(circle at 12% 0%, rgba(146, 255, 183, 0.2), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(99, 246, 255, 0.06));
}

.local-agent-card.is-ready small {
  color: var(--green);
}

.persona-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(99, 246, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(99, 246, 255, 0.08), rgba(255, 92, 159, 0.06)),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 28px rgba(99, 246, 255, 0.06);
}

.persona-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 800;
}

.persona-card-head small {
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0;
}

.persona-card textarea {
  width: 100%;
  min-height: 122px;
  resize: vertical;
  border: 1px solid rgba(99, 246, 255, 0.28);
  border-radius: 6px;
  padding: 12px;
  color: var(--text);
  background: rgba(2, 8, 14, 0.58);
  outline: none;
}

.persona-card textarea:focus {
  border-color: rgba(99, 246, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(99, 246, 255, 0.12);
}

.persona-card .small-note {
  margin: 10px 0 0;
}

.package-name-row {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(99, 246, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.compact-input {
  min-height: 36px;
  max-width: 240px;
  padding: 8px 10px;
}

.asset-workbench-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.4fr) minmax(240px, 0.6fr);
  gap: 16px;
  margin-top: 16px;
}

.crop-canvas-shell {
  position: relative;
  margin-top: 14px;
  border: 1px solid rgba(99, 246, 255, 0.18);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    rgba(0, 0, 0, 0.22);
  background-size: 24px 24px;
  overflow: hidden;
}

#sheetCanvas {
  display: block;
  width: 100%;
  min-height: 280px;
  cursor: default;
}

.crop-canvas-shell .small-note {
  display: block;
  padding: 10px 12px;
  border-top: 1px solid rgba(99, 246, 255, 0.12);
}

.asset-save-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(99, 246, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.slice-tool-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(99, 246, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(99, 246, 255, 0.08), transparent 42%),
    rgba(4, 12, 20, 0.38);
}

.crop-tool-card {
  border-color: rgba(255, 210, 96, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 210, 96, 0.1), transparent 44%),
    rgba(4, 12, 20, 0.42);
}

.slice-tool-heading {
  display: grid;
  gap: 4px;
}

.slice-tool-heading strong {
  color: var(--text);
  font-size: 0.94rem;
}

.slice-tool-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.slice-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(99, 246, 255, 0.2);
  background: rgba(2, 8, 14, 0.58);
}

.slice-mode-tabs button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.slice-mode-tabs button.active {
  background: linear-gradient(135deg, rgba(99, 246, 255, 0.24), rgba(125, 229, 164, 0.18));
  color: var(--cyan);
}

.slice-mode-panel {
  display: grid;
  gap: 12px;
}

.slice-mode-panel[hidden] {
  display: none;
}

.grid-slice-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(99, 246, 255, 0.14);
  background: rgba(4, 12, 20, 0.36);
}

.grid-slice-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.grid-slice-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.grid-slice-fields input {
  min-height: 34px;
  padding: 7px 9px;
}

.grid-nudge-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.grid-nudge-row button {
  min-width: 0;
  padding-inline: 8px;
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.28fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.temp-slice-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(99, 246, 255, 0.14);
  background: rgba(255, 255, 255, 0.028);
}

.temp-slices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  max-height: 300px;
  margin-top: 12px;
  overflow: auto;
}

.library-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.library-toolbar select {
  max-width: 220px;
}

.library-groups,
.library-assets,
.frame-library-pick {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.library-group-button {
  min-height: 44px;
  border: 1px solid rgba(99, 246, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
}

.library-group-button.active {
  border-color: rgba(99, 246, 255, 0.78);
  background: rgba(99, 246, 255, 0.12);
}

.library-assets,
.frame-library-pick {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}

.asset-tile {
  display: grid;
  gap: 6px;
  min-height: 124px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px;
  background: rgba(8, 14, 22, 0.72);
  color: var(--text);
}

.asset-tile.selected {
  border-color: rgba(146, 255, 183, 0.86);
  box-shadow: inset 0 0 0 1px rgba(146, 255, 183, 0.35);
}

.asset-tile .asset-actions {
  display: flex;
  gap: 4px;
}

.asset-tile .asset-actions button {
  min-height: 26px;
  padding: 2px 6px;
  font-size: 0.68rem;
}

.asset-tile img {
  width: 100%;
  height: 76px;
  object-fit: contain;
  background:
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 12px 12px;
}

.asset-tile span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-tools,
.frame-player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.frame-editor-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(260px, 1fr);
  gap: 14px;
}

.frame-player {
  display: grid;
  min-height: 210px;
  place-items: center;
  border: 1px solid rgba(99, 246, 255, 0.18);
  background:
    radial-gradient(circle, rgba(99, 246, 255, 0.1), transparent 9rem),
    rgba(0, 0, 0, 0.22);
}

.frame-player img {
  max-width: 78%;
  max-height: 180px;
  object-fit: contain;
}

.publish-row,
.community-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.publish-row input {
  min-width: 0;
}

.publish-row select {
  min-width: 132px;
}

.community-scope-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(99, 246, 255, 0.2);
  background: rgba(2, 8, 14, 0.58);
}

.community-scope-tabs button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.community-scope-tabs button.active {
  background: rgba(99, 246, 255, 0.18);
  color: var(--cyan);
}

.image-transform-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sprite-preview {
  position: relative;
  display: grid;
  height: clamp(280px, 32vw, 340px);
  margin: 20px 0;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid rgba(99, 246, 255, 0.12);
  overflow: hidden;
}

.sprite-preview img {
  position: relative;
  z-index: 1;
  width: auto;
  height: clamp(150px, 16vw, 210px);
  max-width: 58%;
  max-height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.42));
  transition: transform 120ms ease;
}

.debug-stage {
  cursor: crosshair;
  outline: none;
}

.debug-stage:focus {
  border-color: rgba(99, 246, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(99, 246, 255, 0.3), 0 0 34px rgba(99, 246, 255, 0.14);
}

.debug-stage.playing img {
  filter: drop-shadow(0 20px 34px rgba(99, 246, 255, 0.26));
}

.debug-grid {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 68%, rgba(99, 246, 255, 0.12), transparent 8rem),
    linear-gradient(180deg, transparent 70%, rgba(99, 246, 255, 0.08) 70%);
}

.debug-status {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  z-index: 2;
  border: 1px solid rgba(99, 246, 255, 0.34);
  padding: 9px 12px;
  background: rgba(5, 10, 16, 0.72);
  color: var(--muted);
  font-size: 0.86rem;
}

.upload-zone {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(99, 246, 255, 0.54);
  padding: 18px;
  color: var(--cyan);
}

.upload-zone input {
  display: none;
}

.action-table {
  display: grid;
  gap: 10px;
}

.action-head,
.action-row {
  display: grid;
  grid-template-columns: minmax(104px, 0.82fr) minmax(96px, 0.82fr) minmax(116px, 0.88fr) minmax(124px, 0.92fr) 68px 62px;
  gap: 10px;
  align-items: center;
}

.frame-mirror-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 12px;
}

.frame-mirror-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(99, 246, 255, 0.28);
  padding: 9px 12px;
  background: rgba(99, 246, 255, 0.07);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.frame-mirror-controls input {
  width: 16px;
  height: 16px;
}

.library-picker-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.library-picker-card {
  width: min(92vw, 900px);
  max-height: 86vh;
  padding: 18px;
  border: 1px solid rgba(99, 246, 255, 0.26);
  background: rgba(3, 8, 14, 0.97);
  color: var(--text);
}

.library-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  max-height: 58vh;
  margin: 14px 0;
  overflow: auto;
}

.action-head {
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-row {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.action-row.is-active {
  border-color: rgba(99, 246, 255, 0.72);
  background: rgba(99, 246, 255, 0.08);
}

.key-capture-button,
.frame-detail-button,
.delete-action-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(99, 246, 255, 0.3);
  border-radius: 6px;
  background: rgba(99, 246, 255, 0.08);
  color: var(--cyan);
  font-weight: 800;
}

.frame-detail-button {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-action-button {
  border-color: rgba(255, 92, 159, 0.36);
  background: rgba(255, 92, 159, 0.08);
  color: #ff9ac1;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 188px;
  margin: 18px 0 12px;
  resize: vertical;
}

.icon-button {
  width: 42px;
  height: 42px;
  font-weight: 900;
}

.compact {
  min-height: 36px;
  padding: 8px 12px;
}

.full {
  width: 100%;
}

.share-panel {
  margin: 0 0 18px;
  padding: 14px;
}

.community-toolbar {
  justify-content: space-between;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(13, 20, 31, 0.52);
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.community-card {
  display: grid;
  min-height: 306px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel-strong);
  padding: 14px;
  overflow: hidden;
}

.community-open {
  display: grid;
  grid-template-rows: 180px auto auto auto;
  align-content: start;
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: 278px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.community-art {
  display: grid;
  height: 180px;
  place-items: center;
  background: radial-gradient(circle, rgba(99, 246, 255, 0.18), rgba(255, 255, 255, 0.03));
  overflow: hidden;
}

.community-art > img {
  width: auto;
  height: 132px;
  max-width: 78%;
  max-height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.36));
}

.community-card h3 {
  margin: 12px 0 4px;
  line-height: 1.22;
}

.community-card .small-note {
  margin-bottom: 0;
  line-height: 1.45;
}

.auth-modal,
.frame-modal,
.package-modal {
  max-width: 440px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.frame-modal,
.package-modal {
  width: min(720px, calc(100vw - 32px));
  max-width: 720px;
}

.auth-modal::backdrop,
.frame-modal::backdrop,
.model-modal::backdrop,
.package-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.auth-card,
.frame-card,
.model-card,
.package-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.model-card {
  width: min(760px, calc(100vw - 32px));
  overflow: hidden;
}

.admin-system-card {
  width: min(980px, calc(100vw - 32px));
}

.model-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 18% 0%, rgba(99, 246, 255, 0.16), transparent 18rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 46%);
}

.model-card > * {
  position: relative;
  z-index: 1;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.model-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
}

.model-grid label span {
  font-weight: 800;
}

.model-wide {
  grid-column: 1 / -1;
}

.model-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-credit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-source-section {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  border: 1px solid rgba(99, 246, 255, 0.14);
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-source-list {
  display: grid;
  gap: 12px;
}

.admin-source-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(99, 246, 255, 0.2);
  padding: 14px;
  background:
    radial-gradient(circle at 88% 0%, rgba(99, 246, 255, 0.1), transparent 12rem),
    rgba(2, 8, 14, 0.55);
}

.admin-source-card-head,
.admin-source-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-source-enabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-source-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-source-wide {
  grid-column: span 2;
}

.package-preview-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.admin-shell {
  display: grid;
  gap: 22px;
}

.admin-hero {
  position: relative;
  overflow: hidden;
}

.admin-hero::after {
  position: absolute;
  right: 28px;
  bottom: -42px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(99, 246, 255, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 246, 255, 0.12), transparent 62%);
  content: "";
  animation: spin-slow 24s linear infinite;
}

.admin-dashboard {
  display: grid;
  gap: 18px;
}

.admin-dashboard[hidden] {
  display: none;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.admin-metric-card {
  min-height: 132px;
  border: 1px solid rgba(99, 246, 255, 0.2);
  padding: 16px;
  background:
    radial-gradient(circle at 80% 20%, rgba(99, 246, 255, 0.12), transparent 7rem),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 28px rgba(99, 246, 255, 0.04);
}

.admin-metric-card span,
.admin-list-item small,
.admin-kv span {
  color: var(--muted);
}

.admin-metric-card strong {
  display: block;
  margin: 12px 0 6px;
  color: var(--cyan);
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.admin-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-panel {
  min-height: 280px;
}

.admin-health-list,
.admin-list,
.admin-kv {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-health-row,
.admin-list-item,
.admin-kv div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(99, 246, 255, 0.13);
  padding: 11px 12px;
  background: rgba(0, 0, 0, 0.18);
}

.admin-health-row span {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 14px currentColor;
}

.admin-health-row.online span,
.admin-health-row.ready span,
.admin-health-row.active span {
  background: var(--green);
}

.admin-health-row.idle span,
.admin-health-row.empty span {
  background: var(--amber);
}

.admin-health-row.missing span {
  background: var(--rose);
}

.admin-health-row strong {
  flex: 1;
}

.admin-list-item div {
  min-width: 0;
}

.admin-list-item strong,
.admin-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-item span {
  flex: 0 0 auto;
  border: 1px solid rgba(99, 246, 255, 0.22);
  padding: 4px 7px;
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 900;
}

.admin-manage-list {
  max-height: 520px;
  overflow: auto;
}

.admin-manage-item {
  align-items: flex-start;
}

.admin-row-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 230px;
}

.ghost-button.danger {
  border-color: rgba(255, 92, 159, 0.36);
  background: rgba(255, 92, 159, 0.08);
  color: #ff9ac1;
}

.admin-kv strong {
  max-width: 62%;
  overflow: hidden;
  color: var(--text);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-stage {
  display: grid;
  min-height: 310px;
  place-items: center;
  border: 1px solid rgba(99, 246, 255, 0.18);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
}

.package-stage img {
  max-width: 68%;
  max-height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.38));
}

.package-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.field-label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.frame-card textarea {
  min-height: 168px;
  margin: 0;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.88rem;
}

.frame-preview-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 10px;
  max-height: 190px;
  margin: 16px 0;
  overflow: auto;
}

.frame-thumb {
  display: grid;
  min-height: 86px;
  place-items: center;
  border: 1px solid rgba(99, 246, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.frame-thumb.selected {
  border-color: rgba(146, 255, 183, 0.88);
  background: rgba(146, 255, 183, 0.1);
}

.frame-thumb img {
  max-width: 58px;
  max-height: 58px;
  object-fit: contain;
}

.frame-thumb span {
  color: var(--muted);
  font-size: 0.72rem;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.segmented button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.segmented .active {
  background: rgba(99, 246, 255, 0.18);
  color: var(--cyan);
}

.auth-card input {
  margin-bottom: 10px;
}

@keyframes hover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.48; transform: rotate(-12deg) scale(1); }
  50% { opacity: 0.88; transform: rotate(-12deg) scale(1.04); }
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-90px); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes orbit-ring-spin {
  from { transform: rotateX(68deg) rotateZ(-18deg); }
  to { transform: rotateX(68deg) rotateZ(342deg); }
}

@keyframes orbit-ring-spin-reverse {
  from { transform: rotateX(68deg) rotateZ(342deg); }
  to { transform: rotateX(68deg) rotateZ(-18deg); }
}

@keyframes orbit-message {
  0% {
    opacity: 0;
    transform: translate3d(var(--from-x, -18vw), var(--from-y, 18vh), 0);
  }
  8%, 92% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--to-x, 118vw), var(--to-y, 18vh), 0);
  }
}

@keyframes core-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.72; }
  50% { transform: scale(1.16); opacity: 1; }
}

@keyframes lab-jump {
  0% { transform: scale(1) rotate(0deg); filter: brightness(1); }
  45% { transform: scale(1.08) rotate(2deg); filter: brightness(1.5); }
  100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
}

@keyframes divider-scan {
  0% { transform: translateX(-130px); opacity: 0; }
  18% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateX(calc(100vw + 130px)); opacity: 0; }
}

@keyframes divider-pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.72; }
  50% { transform: scale(1.28); opacity: 1; }
}

@media (max-width: 1080px) {
  .hero,
  .console-grid,
  .asset-workbench-grid,
  .library-layout,
  .admin-metric-grid,
  .admin-grid,
  .admin-grid.three,
  .frame-editor-layout,
  .generator-body {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    width: min(100%, 560px);
    min-height: auto;
    margin: 0 auto;
  }

  .community-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-cards {
    grid-template-columns: 1fr;
  }

  .spectacle-copy {
    max-width: 100%;
    padding-top: 26px;
  }

  .holo-lab {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(72vw, 420px);
    margin: 16px auto 90px;
  }

  .hud-right {
    top: auto;
    right: 18px;
    bottom: 138px;
  }

  .console-content-stack {
    gap: 34px;
    padding-bottom: 28px;
  }

  .console-content-stack::before {
    display: none;
  }

  .deck-panel {
    margin-left: 0;
  }

  .module-divider {
    grid-template-columns: auto minmax(50px, 1fr) auto;
    margin: -8px 0;
  }

  .module-divider-copy {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
  }

  .module-divider-pulse {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar,
  .nav,
  .account-pill,
  .feature-band,
  .share-panel,
  .community-toolbar,
  .publish-row,
  .login-gate,
  .desktop-pet-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .desktop-pet-controls {
    grid-template-columns: 1fr;
  }

  .orbit-composer {
    grid-template-columns: 1fr;
    max-width: 100%;
    margin-left: 0;
  }

  .model-grid {
    grid-template-columns: 1fr;
  }

  .model-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .builtin-prompt-toggle {
    grid-template-columns: auto 1fr;
  }

  .builtin-prompt-toggle small {
    grid-column: 1 / -1;
  }

  .module-divider {
    grid-template-columns: auto 1fr;
  }

  .module-divider-copy {
    display: none;
  }

  .nav {
    display: none;
  }

  h1 {
    font-size: 3.2rem;
  }

  .feature-band,
  .community-grid {
    grid-template-columns: 1fr;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .telemetry {
    display: none;
  }

  .spectacle-copy h1 {
    font-size: 3.6rem;
    line-height: 1.08;
  }

  .hud-panel,
  .status-rail {
    display: none;
  }

  .holo-lab {
    width: min(86vw, 360px);
    margin-bottom: 24px;
  }
}
