:root {
  color-scheme: dark;
  --bg: #10131a;
  --surface: #171c25;
  --surface-strong: #202837;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f7fb;
  --muted: #9ea9bb;
  --soft: #c9d2df;
  --accent: #2bd4a4;
  --accent-strong: #1aa57e;
  --blue: #5a8cff;
  --amber: #f0b94a;
  --danger: #f06f5a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(43, 212, 164, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(90, 140, 255, 0.12), transparent 38%),
    var(--bg);
  color: var(--text);
}

.cosmos-entry {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  background:
    linear-gradient(180deg, rgba(7, 10, 16, 0.12), rgba(7, 10, 16, 0.92)),
    linear-gradient(135deg, #061016 0%, #101923 48%, #1a1510 100%);
}

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

.cosmos-canvas,
.cosmos-grid,
.cosmos-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cosmos-canvas {
  z-index: -3;
  width: 100%;
  height: 100%;
}

.cosmos-grid {
  z-index: -2;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.08));
  transform: perspective(720px) rotateX(58deg) translateY(22vh);
  transform-origin: center bottom;
}

.cosmos-noise {
  z-index: -1;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, transparent, rgba(43, 212, 164, 0.08), transparent);
  mix-blend-mode: screen;
}

.cosmos-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.72fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 24px 48px;
  width: min(1240px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 26px;
}

.cosmos-nav {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cosmos-brand,
.cosmos-nav-actions a,
.cosmos-scroll {
  color: var(--text);
  text-decoration: none;
}

.cosmos-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 900;
}

.cosmos-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2bd4a4, #f0b94a);
  color: #07130f;
  box-shadow: 0 0 28px rgba(43, 212, 164, 0.34);
}

.cosmos-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cosmos-nav-actions a {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: rgba(244, 247, 251, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.cosmos-auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(244, 247, 251, 0.72);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.cosmos-nav-actions a:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.cosmos-auth-button:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.cosmos-auth-user {
  max-width: 180px;
  border-color: rgba(43, 212, 164, 0.44);
  background: rgba(43, 212, 164, 0.14);
  color: #9ff7da;
  box-shadow:
    0 0 0 1px rgba(43, 212, 164, 0.14) inset,
    0 0 24px rgba(43, 212, 164, 0.12);
  cursor: pointer;
}

.cosmos-auth-user span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cosmos-auth-user:hover {
  border-color: rgba(86, 255, 208, 0.7);
  background: rgba(43, 212, 164, 0.22);
  color: #d9fff4;
  box-shadow:
    0 0 0 1px rgba(86, 255, 208, 0.24) inset,
    0 0 30px rgba(86, 255, 208, 0.18);
}

.cosmos-auth-logout {
  color: #ffb2a3;
}

.cosmos-hero {
  align-self: center;
  max-width: 760px;
  padding: 8vh 0 10vh;
}

.cosmos-kicker {
  margin: 0 0 16px;
  color: #7af0ca;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.cosmos-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(46px, 7vw, 92px);
  line-height: 0.98;
  text-wrap: balance;
}

.cosmos-copy {
  max-width: 650px;
  margin: 24px 0 0;
  color: rgba(244, 247, 251, 0.74);
  font-size: 18px;
  line-height: 1.75;
}

.cosmos-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.cosmos-primary,
.cosmos-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 900;
}

.cosmos-primary {
  border: 0;
  background: linear-gradient(135deg, #2bd4a4, #f0b94a);
  color: #07130f;
  box-shadow:
    0 18px 42px rgba(43, 212, 164, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.cosmos-secondary {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  backdrop-filter: blur(14px);
}

.cosmos-primary svg,
.cosmos-secondary svg,
.cosmos-scroll svg {
  width: 18px;
  height: 18px;
}

.cosmos-orbit-panel {
  align-self: center;
  display: grid;
  gap: 22px;
  min-height: 460px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(10, 16, 23, 0.56);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.42),
    0 0 80px rgba(43, 212, 164, 0.08) inset;
  backdrop-filter: blur(18px);
}

.orbit-core {
  position: relative;
  align-self: center;
  width: min(100%, 360px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background:
    conic-gradient(from 130deg, rgba(43, 212, 164, 0.05), rgba(240, 185, 74, 0.42), rgba(90, 140, 255, 0.22), rgba(43, 212, 164, 0.05)),
    radial-gradient(circle at 50% 50%, rgba(43, 212, 164, 0.3), transparent 23%),
    rgba(255, 255, 255, 0.03);
  animation: orbitRotate 18s linear infinite;
}

.orbit-core::before,
.orbit-core::after {
  position: absolute;
  content: "";
  inset: 15%;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.orbit-core::after {
  inset: 31%;
  border-style: solid;
  border-color: rgba(240, 185, 74, 0.42);
}

.orbit-core span {
  position: absolute;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f0b94a;
  box-shadow: 0 0 18px rgba(240, 185, 74, 0.74);
}

.orbit-core span:nth-child(1) {
  top: 13%;
  left: 49%;
}

.orbit-core span:nth-child(2) {
  right: 17%;
  bottom: 25%;
  background: #2bd4a4;
  box-shadow: 0 0 18px rgba(43, 212, 164, 0.74);
}

.orbit-core span:nth-child(3) {
  bottom: 32%;
  left: 16%;
  background: #64b5ff;
  box-shadow: 0 0 18px rgba(100, 181, 255, 0.68);
}

.orbit-timeline {
  display: grid;
  gap: 10px;
}

.orbit-timeline div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.orbit-timeline strong {
  color: var(--text);
  font-size: 13px;
}

.orbit-timeline span {
  color: rgba(244, 247, 251, 0.62);
  font-size: 12px;
}

.cosmos-scroll {
  grid-column: 1 / -1;
  justify-self: center;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  animation: scrollPulse 1.8s ease-in-out infinite;
}

@keyframes orbitRotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scrollPulse {
  50% {
    transform: translateY(6px);
    border-color: rgba(43, 212, 164, 0.46);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orbit-core,
  .cosmos-scroll {
    animation: none;
  }
}

.particle-core-entry {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 48%, rgba(43, 212, 164, 0.14), transparent 26%),
    radial-gradient(circle at 70% 28%, rgba(240, 185, 74, 0.1), transparent 24%),
    linear-gradient(180deg, #020609 0%, #061016 48%, #020507 100%);
}

.particle-core-entry .cosmos-canvas {
  z-index: 0;
  display: block;
  opacity: 1;
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.particle-core-entry .cosmos-grid {
  z-index: 1;
  opacity: 0.5;
  background:
    linear-gradient(rgba(122, 240, 202, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 240, 202, 0.04) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.34) 44%, transparent 100%);
  transform: perspective(900px) rotateX(64deg) translateY(31vh);
}

.particle-core-entry .cosmos-noise {
  z-index: 2;
  opacity: 0.14;
}

.cosmos-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 46%, transparent 0 34%, rgba(2, 6, 9, 0.18) 52%, rgba(2, 6, 9, 0.78) 100%),
    linear-gradient(90deg, rgba(2, 6, 9, 0.64), transparent 26%, transparent 74%, rgba(2, 6, 9, 0.56));
}

.particle-core-entry .cosmos-shell {
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1320px, calc(100% - 48px));
  gap: 18px;
}

.particle-core-entry .cosmos-nav {
  position: relative;
  z-index: 4;
}

.particle-core-entry .cosmos-hero {
  align-self: end;
  max-width: 620px;
  padding: 0 0 clamp(64px, 9vh, 118px);
  transform: translateZ(0);
  transition:
    opacity 0.62s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.62s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.particle-core-entry .cosmos-kicker {
  color: #7af0ca;
  text-shadow: 0 0 18px rgba(43, 212, 164, 0.48);
}

.particle-core-entry .cosmos-hero h1 {
  max-width: 700px;
  font-size: clamp(54px, 8vw, 112px);
  letter-spacing: 0;
  text-shadow:
    0 0 32px rgba(244, 247, 251, 0.18),
    0 18px 70px rgba(0, 0, 0, 0.7);
}

.particle-core-entry .cosmos-copy {
  max-width: 560px;
  color: rgba(244, 247, 251, 0.72);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.particle-core-entry .cosmos-actions {
  margin-top: 30px;
}

.particle-core-entry .cosmos-primary,
.particle-core-entry .cosmos-secondary,
.particle-core-entry .cosmos-nav-actions a,
.particle-core-entry .cosmos-auth-button,
.particle-core-entry .cosmos-scroll {
  transition:
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.28s ease,
    background 0.28s ease,
    box-shadow 0.28s ease,
    color 0.28s ease;
}

.particle-core-entry .cosmos-primary {
  min-height: 52px;
  padding: 0 22px;
  background: linear-gradient(135deg, #56ffd0, #f7cc54);
  box-shadow:
    0 20px 54px rgba(43, 212, 164, 0.28),
    0 0 42px rgba(247, 204, 84, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

.particle-core-entry .cosmos-secondary {
  min-height: 52px;
  padding: 0 18px;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.particle-core-entry .cosmos-primary:hover,
.particle-core-entry .cosmos-secondary:hover,
.particle-core-entry .cosmos-nav-actions a:hover,
.particle-core-entry .cosmos-scroll:hover {
  transform: translateY(-3px);
}

.particle-core-entry .cosmos-primary:hover {
  box-shadow:
    0 26px 72px rgba(43, 212, 164, 0.36),
    0 0 60px rgba(247, 204, 84, 0.24),
    0 0 0 1px rgba(255, 255, 255, 0.32) inset;
}

.cosmos-core-readout {
  position: absolute;
  right: clamp(20px, 5vw, 72px);
  bottom: clamp(82px, 10vh, 132px);
  display: grid;
  gap: 6px;
  min-width: 190px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(5, 11, 16, 0.42);
  box-shadow:
    0 20px 54px rgba(0, 0, 0, 0.34),
    0 0 30px rgba(43, 212, 164, 0.08) inset;
  backdrop-filter: blur(18px);
}

.cosmos-core-readout span,
.cosmos-core-readout small {
  color: rgba(244, 247, 251, 0.58);
  font-size: 12px;
  font-weight: 800;
}

.cosmos-core-readout strong {
  color: #f4f7fb;
  font-size: 18px;
}

.particle-core-entry.is-entering .cosmos-canvas {
  transform: scale(1.24);
  filter: brightness(1.25) saturate(1.28);
}

.particle-core-entry.is-entering .cosmos-hero,
.particle-core-entry.is-entering .cosmos-core-readout,
.particle-core-entry.is-entering .cosmos-nav {
  opacity: 0;
  transform: translateY(-14px);
}

body.is-entry-visible .feedback-launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

body.has-entered-workspace:not(.is-transitioning-to-workspace) .particle-core-entry {
  display: none;
}

body.is-transitioning-to-workspace {
  overflow: hidden;
}

body.is-entry-visible:not(.has-entered-workspace) {
  overflow: hidden;
}

body.is-transitioning-to-workspace .particle-core-entry {
  position: fixed;
  inset: 0;
  z-index: 20;
}

body.is-transitioning-to-workspace .app-shell {
  position: fixed !important;
  inset: 0;
  z-index: 32;
  height: 100vh;
  min-height: 100vh;
  overflow: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(28px) scale(0.985);
  filter: saturate(0.96) brightness(1.04);
  background: var(--bg);
  will-change: opacity, transform, filter;
  animation: workspaceMaterialize 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

body.is-transitioning-to-workspace .workspace {
  animation: workspaceContentRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

body.is-transitioning-to-workspace .particle-core-entry::after {
  content: none;
}

@keyframes workspaceMaterialize {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
    filter: saturate(0.96) brightness(1.04);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: none;
  }
}

@keyframes workspaceContentRise {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.995);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  .particle-core-entry .cosmos-shell {
    width: min(100% - 28px, 640px);
  }

  .particle-core-entry .cosmos-hero {
    align-self: end;
    padding-bottom: 86px;
  }

  .particle-core-entry .cosmos-hero h1 {
    font-size: 45px;
  }

  .cosmos-core-readout {
    right: 14px;
    bottom: 24px;
    min-width: 158px;
    padding: 12px;
  }

  .cosmos-core-readout strong {
    font-size: 15px;
  }
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(16, 19, 26, 0.86);
  backdrop-filter: blur(18px);
  isolation: isolate;
  transition:
    padding 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    gap 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.22s ease,
    border-color 0.22s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  min-width: 0;
  transition: gap 0.24s ease, transform 0.24s ease;
}

.brand span:last-child,
.nav-item span {
  display: block;
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  transition:
    max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    transform 0.24s ease;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2bd4a4, #f0b94a);
  color: #07130f;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(43, 212, 164, 0.34);
  flex: 0 0 auto;
}

.nav-list {
  display: grid;
  gap: 8px;
  transition: gap 0.24s ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    padding 0.24s ease,
    width 0.24s ease,
    transform 0.2s ease,
    box-shadow 0.22s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.icon-button.sidebar-toggle {
  position: absolute;
  top: 82px;
  right: -9px;
  z-index: 3;
  width: 18px;
  min-height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(12, 15, 22, 0.82);
  color: rgba(201, 210, 223, 0.62);
  box-shadow: 7px 10px 22px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.icon-button.sidebar-toggle:hover,
.icon-button.sidebar-toggle:focus-visible {
  width: 22px;
  right: -11px;
  border-color: rgba(43, 212, 164, 0.3);
  border-left: 0;
  background:
    linear-gradient(180deg, rgba(43, 212, 164, 0.13), rgba(255, 255, 255, 0.028)),
    rgba(12, 15, 22, 0.96);
  color: var(--text);
  box-shadow:
    8px 12px 24px rgba(0, 0, 0, 0.22),
    0 0 18px rgba(43, 212, 164, 0.09);
}

.icon-button.sidebar-toggle svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.sidebar-toggle svg,
.nav-item svg,
.icon-button svg,
.primary-button svg,
.ghost-button svg,
.play-button svg,
.profile-button svg {
  transition: transform 0.22s ease, color 0.22s ease, opacity 0.22s ease;
}

.usage-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  max-height: 140px;
  transition:
    max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    padding 0.24s ease,
    margin 0.24s ease,
    border-color 0.22s ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 92px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  align-items: center;
  padding: 24px 14px;
}

body.sidebar-collapsed .sidebar-header {
  width: 100%;
  flex-direction: column;
  justify-content: center;
}

body.sidebar-collapsed .brand {
  gap: 0;
}

body.sidebar-collapsed .brand span:last-child,
body.sidebar-collapsed .nav-item span {
  max-width: 0;
  opacity: 0;
  transform: translateX(-8px);
}

body.sidebar-collapsed .nav-list {
  width: 100%;
  justify-items: center;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  width: 48px;
  padding: 0;
}

body.sidebar-collapsed .usage-panel {
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  opacity: 0;
}

body.sidebar-collapsed .sidebar-toggle svg {
  transform: none;
}

.usage-row,
.progress-header,
.slider-label,
.section-heading,
.preview-toolbar,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  position: relative;
  z-index: 20;
}

.usage-row {
  color: var(--muted);
  font-size: 13px;
}

.usage-row strong {
  color: var(--text);
}

.usage-bar,
.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.usage-bar {
  margin: 12px 0 14px;
}

.usage-bar span,
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.usage-bar span {
  width: 68%;
}

.credit-store.is-highlighted {
  border-color: rgba(43, 212, 164, 0.68);
  box-shadow:
    var(--shadow),
    0 0 0 3px rgba(43, 212, 164, 0.16);
}

.workspace {
  width: min(1440px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 26px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: 40px;
  line-height: 1.08;
}

h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

p {
  color: var(--muted);
}

.top-actions,
.preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.play-button,
.ghost-button,
.primary-button,
.profile-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  white-space: nowrap;
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.2s ease,
    opacity 0.22s ease,
    filter 0.22s ease;
}

.icon-button {
  width: 40px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.icon-button svg,
.primary-button svg,
.ghost-button svg,
.play-button svg,
.profile-button svg {
  width: 18px;
  height: 18px;
}

.profile-button {
  padding: 0 14px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 800;
}

.language-button {
  min-width: 58px;
}

.user-menu-button {
  max-width: 220px;
}

.user-menu-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-button {
  color: #ffb2a3;
}

.logout-button.is-login-action {
  color: var(--text);
}

.logout-button.is-login-action svg {
  color: var(--accent);
}

.page-view[hidden] {
  display: none !important;
}

.creator-grid {
  display: grid;
  grid-template-columns: minmax(340px, 500px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.creator-stack {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.workflow-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.generator-panel,
.reference-panel,
.settings-panel,
.submit-panel,
.preview-panel,
.templates,
.project-library,
.video-assets-panel,
.account-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 28, 37, 0.86);
  box-shadow: var(--shadow);
}

.generator-panel,
.reference-panel,
.settings-panel,
.submit-panel,
.preview-panel {
  padding: 20px;
}

.submit-panel {
  display: grid;
  gap: 12px;
  background: rgba(32, 40, 55, 0.94);
}

.panel-heading {
  margin-bottom: 18px;
}

.simple-heading {
  align-items: flex-start;
}

.panel-heading p,
.preview-toolbar p,
.submit-copy p {
  margin-bottom: 0;
  font-size: 13px;
}

.submit-copy h2 {
  margin: 0 0 6px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.workflow-panel > .field:last-child,
.reference-field,
.settings-panel > .field:last-child {
  margin-bottom: 0;
}

.field > span,
.fixed-duration span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.field small {
  justify-self: end;
  color: var(--muted);
}

.prompt-optimizer-panel {
  display: grid;
  gap: 10px;
  margin: -4px 0 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

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

.prompt-optimizer-select {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.prompt-optimizer-select > span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.prompt-optimizer-select select,
.prompt-optimizer-select .custom-select-trigger {
  min-height: 38px;
  font-size: 13px;
}

.prompt-optimizer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-optimizer-options label {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.prompt-optimizer-options input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.prompt-optimizer-options span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.prompt-optimizer-options input:checked + span {
  border-color: rgba(43, 212, 164, 0.68);
  background: rgba(43, 212, 164, 0.14);
  color: var(--text);
}

.prompt-optimizer-options label:focus-within span {
  border-color: rgba(90, 140, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(90, 140, 255, 0.14);
}

.prompt-optimizer-actions {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.prompt-optimizer-button,
.prompt-optimizer-undo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    opacity 0.22s ease;
}

.prompt-optimizer-button {
  border-color: rgba(43, 212, 164, 0.48);
  background: rgba(43, 212, 164, 0.12);
  color: #a9ffe4;
}

.prompt-optimizer-button:hover,
.prompt-optimizer-button:focus-visible {
  border-color: rgba(43, 212, 164, 0.78);
  background: rgba(43, 212, 164, 0.18);
  outline: none;
}

.prompt-optimizer-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.prompt-optimizer-button svg {
  width: 16px;
  height: 16px;
}

.prompt-optimizer-undo {
  color: var(--soft);
}

.prompt-optimizer-undo:hover,
.prompt-optimizer-undo:focus-visible {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

.prompt-optimizer-status {
  justify-self: start;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-optimizer-status.is-success {
  color: #9ff7da;
}

.prompt-optimizer-status.is-error {
  color: #ffb2a3;
}

.prompt-optimizer-status.is-warning {
  color: #ffd98a;
}

.subtitle-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
}

.subtitle-option input {
  position: absolute;
  width: 0;
  height: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
}

.subtitle-switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-strong);
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.subtitle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s ease;
}

.subtitle-option input:checked + .subtitle-switch {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 212, 164, 0.14);
}

.subtitle-option input:checked + .subtitle-switch::after {
  transform: translateX(18px);
}

.subtitle-option:focus-within {
  border-color: rgba(43, 212, 164, 0.58);
}

.subtitle-option-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.subtitle-option-copy strong,
.subtitle-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtitle-option-copy strong {
  color: var(--soft);
  font-size: 13px;
}

.subtitle-option-copy small {
  color: var(--muted);
  font-size: 12px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 156px;
  resize: vertical;
  padding: 13px;
  line-height: 1.55;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

select option {
  color: #111827;
}

select.native-select-hidden {
  position: absolute;
  width: 1px;
  min-width: 0;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 1;
}

.custom-select.open {
  z-index: 120;
}

.custom-select.is-hidden {
  display: none;
}

.custom-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  outline: none;
}

.custom-select-trigger::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--soft);
  border-bottom: 2px solid var(--soft);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  border-color: rgba(43, 212, 164, 0.7);
  box-shadow: 0 0 0 3px rgba(43, 212, 164, 0.14);
}

.custom-select.open .custom-select-trigger::after {
  border-color: var(--accent);
  transform: translateY(2px) rotate(225deg);
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: none;
  max-height: min(320px, 48vh);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(23, 28, 37, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 4px;
}

.custom-select-option {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--soft);
  text-align: left;
  line-height: 1.25;
  white-space: normal;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  outline: none;
}

.custom-select-option.is-selected {
  background: rgba(43, 212, 164, 0.16);
  color: var(--text);
}

.custom-select-option:disabled {
  color: rgba(201, 210, 223, 0.45);
  cursor: not-allowed;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(43, 212, 164, 0.7);
  box-shadow: 0 0 0 3px rgba(43, 212, 164, 0.14);
}

.compact {
  margin-bottom: 14px;
}

.reference-field {
  gap: 10px;
}

.reference-field[hidden] {
  display: none;
}

.upload-box {
  display: grid;
  gap: 6px;
  min-height: 106px;
  padding: 14px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  text-align: center;
  cursor: pointer;
}

.upload-box:hover {
  border-color: rgba(43, 212, 164, 0.68);
  background: rgba(43, 212, 164, 0.08);
}

.upload-box svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.upload-box strong {
  font-size: 14px;
}

.upload-box small,
.reference-field small {
  color: var(--muted);
  line-height: 1.45;
}

.reference-list {
  display: grid;
  gap: 8px;
}

.asset-library {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.asset-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.asset-library-header strong {
  font-size: 13px;
}

.asset-library-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 800;
}

.asset-library-trigger svg {
  width: 15px;
  height: 15px;
}

.asset-library-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.asset-library-popover[hidden] {
  display: none;
}

.asset-library-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.asset-library-popover-head strong {
  font-size: 13px;
}

.asset-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.asset-upload-button:hover {
  border-color: rgba(43, 212, 164, 0.68);
  background: rgba(43, 212, 164, 0.08);
}

.asset-upload-button svg {
  width: 15px;
  height: 15px;
}

.asset-library-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.asset-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.asset-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.asset-card:hover {
  border-color: rgba(43, 212, 164, 0.55);
}

.asset-card.selected {
  border-color: var(--accent);
  background: rgba(43, 212, 164, 0.1);
}

.asset-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.asset-card-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.asset-order-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(43, 212, 164, 0.95);
  color: #06110e;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.asset-card img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  object-fit: cover;
  background: #05070a;
}

.asset-preview-fallback,
.image-asset-preview-fallback {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #05070a;
  text-align: center;
}

.asset-preview-fallback {
  aspect-ratio: 1;
}

.image-asset-preview-fallback {
  aspect-ratio: 4 / 3;
}

.asset-preview-fallback strong,
.asset-preview-fallback span,
.image-asset-preview-fallback strong,
.image-asset-preview-fallback span {
  overflow-wrap: anywhere;
}

.asset-preview-fallback strong,
.image-asset-preview-fallback strong {
  color: var(--text);
  font-size: 13px;
}

.asset-preview-fallback span,
.image-asset-preview-fallback span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.asset-card span {
  overflow: hidden;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.reference-item img {
  width: 58px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: #05070a;
}

.reference-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.reference-item strong,
.reference-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-item strong {
  font-size: 13px;
}

.reference-item span {
  color: var(--muted);
  font-size: 12px;
}

.reference-item .icon-button {
  width: 36px;
  min-height: 36px;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.fixed-duration strong {
  display: grid;
  min-height: 44px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.fixed-duration select {
  min-height: 44px;
}

.fixed-duration [hidden] {
  display: none !important;
}

.fixed-duration small {
  justify-self: start;
}

.segment-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.segment-group label {
  position: relative;
}

.segment-group input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.segment-group span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 800;
}

.segment-group input:checked + span {
  border-color: rgba(43, 212, 164, 0.75);
  background: rgba(43, 212, 164, 0.14);
  color: var(--text);
}

.segment-group label.is-disabled span {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button {
  width: 100%;
  min-height: 50px;
  background: linear-gradient(135deg, var(--accent), #64b5ff);
  color: #06120f;
  font-weight: 900;
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.72;
}

.cost-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  margin: -2px 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(43, 212, 164, 0.42);
  border-radius: var(--radius);
  background: rgba(43, 212, 164, 0.1);
}

.cost-preview-card span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.cost-preview-card strong {
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
  text-align: right;
}

.cost-preview-card small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.cost-summary {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 16px;
  border: 1px solid rgba(100, 181, 255, 0.38);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(43, 212, 164, 0.12), rgba(100, 181, 255, 0.12));
  color: var(--soft);
  font-size: 13px;
}

.submit-cost-summary {
  gap: 0;
  margin-top: 8px;
  padding: 12px 14px;
}

.cost-summary-main,
.cost-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}

.submit-cost-summary .cost-summary-meta {
  gap: 8px 18px;
}

.cost-summary-main span {
  color: var(--text);
  font-weight: 900;
}

.cost-summary-main strong {
  color: var(--accent);
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1;
}

.cost-summary-meta strong {
  color: var(--soft);
  font-weight: 800;
}

.cost-summary.insufficient .cost-summary-main strong,
.cost-summary.insufficient .cost-summary-meta strong {
  color: var(--danger);
}

.cost-summary a {
  width: fit-content;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.ghost-button {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.text-button {
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  color: var(--accent);
}

.feedback-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(43, 212, 164, 0.45);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

.feedback-launcher svg {
  width: 18px;
  height: 18px;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(43, 212, 164, 0.2), transparent 34%),
    rgba(2, 6, 9, 0.78);
  backdrop-filter: blur(14px);
}

.auth-dialog {
  display: grid;
  gap: 16px;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(10, 16, 23, 0.88);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(43, 212, 164, 0.1) inset;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-dialog h2 {
  margin: 0;
  font-size: 28px;
}

.auth-dialog-copy {
  margin: 0;
  color: rgba(244, 247, 251, 0.68);
  font-size: 14px;
  line-height: 1.65;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.auth-tabs.single {
  grid-template-columns: 1fr;
}

.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tabs button.active {
  background: rgba(90, 140, 255, 0.22);
  color: var(--text);
}

.auth-form[hidden] {
  display: none !important;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  align-items: end;
}

.auth-verification-row[hidden] {
  display: none !important;
}

.auth-code-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 900;
}

.auth-code-button:hover:not(:disabled),
.auth-code-button:focus-visible {
  border-color: rgba(43, 212, 164, 0.42);
  background: rgba(43, 212, 164, 0.12);
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(244, 247, 251, 0.62);
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.auth-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-status.error {
  color: #ffb2a3;
}

.announcement-modal {
  position: fixed;
  inset: 0;
  z-index: 118;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
}

.announcement-modal[hidden] {
  display: none;
}

.announcement-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(247, 204, 84, 0.16), transparent 34%),
    rgba(2, 6, 9, 0.74);
  backdrop-filter: blur(14px);
}

.announcement-dialog {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(10, 16, 23, 0.92);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.52),
    0 0 80px rgba(247, 204, 84, 0.08) inset;
}

.announcement-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.announcement-dialog h2 {
  margin: 0;
  padding-right: 36px;
  font-size: 24px;
  line-height: 1.22;
}

.announcement-body {
  display: grid;
  gap: 8px;
  color: rgba(244, 247, 251, 0.72);
  font-size: 14px;
  line-height: 1.7;
}

.announcement-body p {
  margin: 0;
  overflow-wrap: anywhere;
}

.announcement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.feedback-dialog {
  position: absolute;
  right: 22px;
  bottom: 76px;
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feedback-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.feedback-status.ok {
  color: var(--accent);
}

.feedback-status.error {
  color: var(--danger);
}

.video-player-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.video-player-modal[hidden] {
  display: none;
}

.video-player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.video-player-dialog {
  position: absolute;
  top: 5vh;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  width: min(960px, calc(100vw - 32px));
  max-height: 90vh;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.video-player-header,
.video-player-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-player-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.video-player-header p,
.video-player-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.video-player-frame {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #05070b;
}

.video-player-frame video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(90vh - 160px);
  object-fit: contain;
  background: #05070b;
}

.video-player-actions {
  justify-content: flex-end;
}

.video-player-actions .text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.video-player-actions .text-button[hidden] {
  display: none;
}

.result-feedback {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.result-feedback span {
  color: var(--muted);
  font-size: 13px;
}

.result-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 16px 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  background: #0b0d13;
}

.video-stage.is-vertical {
  max-width: 430px;
  margin-inline: auto;
  aspect-ratio: 9 / 16;
}

.video-stage.is-square {
  max-width: 560px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
}

.video-stage img,
.video-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.86;
}

.video-stage video {
  background: #05070a;
  opacity: 1;
}

.video-stage.has-video .stage-overlay {
  pointer-events: none;
}

.video-stage.has-video .play-button {
  display: none;
}

.stage-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.28));
}

.play-button {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
}

.render-status {
  position: absolute;
  left: 14px;
  bottom: 14px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(10, 14, 20, 0.72);
  color: var(--text);
  font-size: 13px;
}

.progress-wrap {
  display: none;
  gap: 10px;
  margin-bottom: 16px;
}

.progress-header {
  color: var(--muted);
  font-size: 13px;
}

.progress-header strong {
  color: var(--text);
}

.progress-track span {
  width: 0;
  transition: width 0.25s ease;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-grid div {
  display: grid;
  gap: 5px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.templates,
.project-library,
.video-assets-panel,
.account-panel {
  margin-top: 18px;
  padding: 18px;
}

.project-library > .section-heading > .text-button {
  display: inline-flex;
}

.project-library > .section-heading:not(.task-center-heading) {
  display: flex;
}

.section-actions,
.project-library > .task-center-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-actions .text-button.is-active,
.project-library > .section-heading > .text-button.is-active {
  color: var(--text);
  background: rgba(43, 212, 164, 0.12);
}

.batch-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.batch-toolbar-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.batch-toolbar-info span {
  color: var(--muted);
  font-size: 12px;
}

.batch-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-text-button {
  color: var(--danger);
}

.batch-select-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: transparent;
  flex: 0 0 auto;
}

.batch-select-control svg {
  width: 14px;
  height: 14px;
  opacity: 0;
}

.batch-select-control.is-selected {
  border-color: rgba(43, 212, 164, 0.62);
  background: rgba(43, 212, 164, 0.18);
  color: var(--accent);
}

.batch-select-control.is-selected svg {
  opacity: 1;
}

.project-library > .task-center-actions {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.section-actions select,
.project-library > .task-center-actions select {
  height: 38px;
  min-width: 126px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--text);
  padding: 0 10px;
}

.section-actions .custom-select,
.project-library > .task-center-actions .custom-select {
  min-width: 126px;
}

.section-actions .custom-select-trigger,
.project-library > .task-center-actions .custom-select-trigger {
  min-height: 38px;
  background: var(--surface-strong);
}

.section-subheading {
  margin: 18px 0 10px;
}

.section-subheading h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.account-dashboard {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.42fr);
  gap: 14px;
  align-items: start;
}

.account-wallet-panel,
.credit-store,
.account-activity-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.account-wallet-panel,
.credit-store {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.wallet-balance-block {
  display: grid;
  gap: 8px;
}

.wallet-balance-block span,
.wallet-balance-block small,
.wallet-hold-row span,
.account-card span,
.ledger-item span {
  color: var(--muted);
}

.wallet-balance-block small {
  font-size: 12px;
}

.wallet-balance-block strong {
  color: var(--text);
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.wallet-hold-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.wallet-hold-row strong {
  font-size: 18px;
}

.account-stat-details {
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.account-stat-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.account-stat-details summary::-webkit-details-marker {
  display: none;
}

.account-stat-details summary svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}

.account-stat-details[open] summary svg {
  transform: rotate(180deg);
}

.account-stat-details .account-grid {
  padding-top: 6px;
}

.account-grid {
  display: grid;
  gap: 10px;
}

.account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0;
}

.account-card strong {
  font-size: 18px;
  text-align: right;
}

.credit-store .section-heading h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.credit-package-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.credit-package-card {
  display: grid;
  gap: 10px;
  min-height: 178px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.credit-package-card strong {
  font-size: 18px;
}

.package-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.package-title-row em {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid rgba(43, 212, 164, 0.45);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  background: rgba(43, 212, 164, 0.08);
}

.credit-package-card span,
.credit-package-card small,
.manual-payment-box span {
  color: var(--muted);
}

.credit-package-card .package-price {
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.package-estimate {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.package-estimate b {
  color: var(--text);
  font-size: 20px;
}

.package-benefits {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.package-benefits li {
  position: relative;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.package-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 900;
}

.manual-payment-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(43, 212, 164, 0.35);
  border-radius: var(--radius);
  background: rgba(43, 212, 164, 0.08);
}

.manual-payment-box[hidden] {
  display: none;
}

.manual-payment-box strong,
.manual-payment-box p {
  margin: 0;
}

.payment-provider-actions,
.order-pay-actions,
.manual-payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.manual-payment-method {
  display: grid;
  gap: 6px;
  min-width: 180px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.mini-pay-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(43, 212, 164, 0.36);
  border-radius: 7px;
  background: rgba(43, 212, 164, 0.1);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.mini-pay-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.payment-qr-image {
  width: 220px;
  height: 220px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #fff;
  padding: 8px;
}

.payment-proof-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-proof-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.payment-proof-form input,
.payment-proof-form select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 0 10px;
}

.payment-proof-form .custom-select-trigger {
  min-height: 38px;
  background: rgba(0, 0, 0, 0.18);
}

.payment-proof-form .wide-field,
.payment-proof-form button {
  grid-column: 1 / -1;
}

.account-activity-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.account-tab:hover,
.account-tab:focus-visible {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.account-tab.is-active {
  color: var(--text);
  border-color: rgba(43, 212, 164, 0.5);
  background: rgba(43, 212, 164, 0.12);
}

.account-tab-pane[hidden] {
  display: none;
}

.account-list {
  min-width: 0;
}

.ledger-list {
  display: grid;
  gap: 10px;
}

.ledger-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.ledger-item div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ledger-item strong,
.ledger-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-item b {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.ledger-item .credit-positive {
  color: var(--accent);
}

.ledger-item .credit-negative {
  color: var(--danger);
}

.task-ledger-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.task-ledger-actions,
.history-actions {
  display: flex;
  gap: 8px;
}

.task-ledger-item.batch-mode {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.task-center-list,
.video-asset-list {
  display: grid;
  gap: 10px;
}

.task-center-card,
.video-asset-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.video-asset-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.task-center-card.batch-mode {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.video-asset-card.batch-mode {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.video-asset-card.deleted {
  opacity: 0.62;
}

.asset-page-status {
  min-height: 20px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.image-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.image-generator-page {
  min-height: calc(100vh - 128px);
}

.image-studio-shell {
  position: relative;
  display: grid;
  min-height: calc(100vh - 156px);
  padding-bottom: 178px;
}

.image-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 540px;
  height: calc(100vh - 220px);
  max-height: calc(100vh - 220px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 12%, rgba(43, 212, 164, 0.16), transparent 26%),
    radial-gradient(circle at 80% 8%, rgba(245, 132, 91, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(20, 24, 30, 0.94), rgba(9, 12, 17, 0.96));
}

.image-stage::before {
  content: "";
  position: absolute;
  inset: 94px 0 0;
  opacity: 0.36;
  background:
    linear-gradient(90deg, transparent 0 5%, rgba(255, 255, 255, 0.13) 5% 5.4%, transparent 5.4% 32%, rgba(255, 255, 255, 0.1) 32% 32.4%, transparent 32.4% 58%, rgba(255, 255, 255, 0.1) 58% 58.4%, transparent 58.4%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 184px);
  pointer-events: none;
}

.image-stage-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}

.image-stage-heading h2 {
  margin: 0;
  font-size: 26px;
}

.image-stage-heading p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.image-stage-grid {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: 0 24px 220px;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
}

.image-stage-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.image-preset-panel {
  position: absolute;
  right: 0;
  bottom: 184px;
  left: 0;
  z-index: 6;
  max-height: min(470px, calc(100vh - 250px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    radial-gradient(circle at 72% 0, rgba(173, 70, 99, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(32, 32, 30, 0.98), rgba(22, 23, 24, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.image-preset-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.image-preset-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.image-preset-kicker svg {
  width: 18px;
  height: 18px;
}

.image-preset-tabs {
  display: flex;
  gap: 34px;
  margin-top: 28px;
}

.image-preset-tabs button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.image-preset-tabs button.active {
  color: var(--text);
}

.image-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 16px;
  max-height: 340px;
  overflow: auto;
  padding: 18px;
}

.image-preset-card {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: linear-gradient(135deg, #3e4754, #0c0f14);
  color: #fff;
  cursor: pointer;
  isolation: isolate;
}

.image-preset-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 52% 32%, rgba(255, 255, 255, 0.7), transparent 0 12%, transparent 35%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
}

.image-preset-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 62%;
  z-index: -1;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.image-preset-card span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  overflow-wrap: anywhere;
  text-align: left;
  font-weight: 800;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

.theme-porcelain { background: linear-gradient(135deg, #f4f1ec, #6d8a8f); }
.theme-studio { background: radial-gradient(circle at 50% 48%, #e5d9c6 0 16%, transparent 17%), linear-gradient(135deg, #3a2d23, #070707); }
.theme-scene { background: linear-gradient(135deg, #0a2133, #081018 42%, #a75a72); }
.theme-model { background: linear-gradient(135deg, #d4b493, #776246 44%, #263a2e); }
.theme-outfit { background: linear-gradient(135deg, #6f4b35, #1f1715 52%, #d8c0a0); }
.theme-reference { background: linear-gradient(135deg, #d7d7d7, #797979 48%, #1b1b1b); }
.theme-street { background: linear-gradient(135deg, #2c332d, #101513 56%, #b7b0a1); }
.theme-hero { background: linear-gradient(135deg, #f0e1c8, #9d7f59 46%, #eee9dd); }
.theme-lifestyle { background: linear-gradient(135deg, #765d49, #2a211b 50%, #c6ad8f); }
.theme-macro { background: radial-gradient(circle at 42% 36%, #d14b84, transparent 0 14%, transparent 36%), linear-gradient(135deg, #f1d7af, #33251d); }
.theme-feature { background: linear-gradient(135deg, #c6ccd4, #1b1e24 52%, #c23d60); }
.theme-detail { background: linear-gradient(135deg, #efe6cf, #a58b69 48%, #251d17); }
.theme-poster { background: linear-gradient(135deg, #2d241c, #101010 55%, #8f6333); }
.theme-ugc { background: linear-gradient(135deg, #c9d6d9, #2b3033 50%, #f0d1cb); }
.theme-swap { background: linear-gradient(135deg, #efe8ee, #c04c82 48%, #1d151b); }
.theme-background { background: linear-gradient(135deg, #dfc79f, #6e4f27 52%, #f2e5ca); }

.image-composer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 7;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(35, 35, 34, 0.98), rgba(18, 19, 20, 0.98));
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.4);
}

.image-composer-main {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.image-upload-button {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.image-upload-button svg {
  width: 28px;
  height: 28px;
}

.image-composer textarea {
  min-height: 70px;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  resize: none;
  box-shadow: none;
}

.image-composer textarea:focus {
  box-shadow: none;
}

.image-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.image-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-control {
  position: relative;
}

.image-chip {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.image-chip svg {
  width: 20px;
  height: 20px;
}

.image-chip:hover,
.image-chip:focus-visible {
  background: rgba(255, 255, 255, 0.13);
}

.image-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  z-index: 9;
  min-width: 210px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(17, 18, 20, 0.98);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

.image-menu button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.image-menu button.active,
.image-menu button:hover {
  background: rgba(43, 212, 164, 0.14);
}

.image-model-menu button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
}

.image-model-menu svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
}

.image-model-menu strong,
.image-model-menu small {
  display: block;
}

.image-model-menu small {
  color: var(--muted);
}

.image-count-menu {
  min-width: 170px;
}

.image-resolution-menu {
  width: min(432px, calc(100vw - 48px));
  padding: 22px;
}

.image-menu-section {
  display: grid;
  gap: 12px;
}

.image-menu-section + .image-menu-section {
  margin-top: 22px;
}

.image-menu-section > span {
  color: var(--muted);
  font-weight: 700;
}

.image-segment-grid {
  display: grid;
  gap: 10px;
}

.resolution-grid {
  grid-template-columns: repeat(3, 1fr);
}

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

.image-segment-grid button {
  display: grid;
  min-height: 56px;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.image-segment-grid svg {
  width: 20px;
  height: 20px;
}

.image-submit-cluster {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.image-prompt-count {
  min-width: 76px;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.image-generate-button {
  display: inline-flex;
  min-width: 108px;
  min-height: 48px;
  padding: 0 16px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(246, 246, 246, 0.72);
  color: #101312;
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.image-generate-button svg {
  width: 21px;
  height: 21px;
  color: #15a37a;
}

.image-generate-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.image-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-reference-list .reference-item {
  max-width: 280px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.image-generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 18px;
}

.image-generator-panel,
.image-results-panel {
  align-content: start;
}

.image-submit-panel {
  margin-top: 0;
}

.image-reference-list {
  margin-top: 12px;
}

.image-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.collapsed-image-group {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.collapsed-image-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
}

.collapsed-image-group summary::-webkit-details-marker {
  display: none;
}

.collapsed-image-group summary strong {
  color: var(--text);
  font-size: 14px;
}

.collapsed-image-group summary span {
  font-size: 12px;
  text-align: right;
}

.collapsed-image-group-body {
  margin-top: 10px;
}

.collapsed-image-group-body-grid {
  margin-bottom: 0;
}

.generated-image-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.generated-image-preview {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.generated-image-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  object-fit: cover;
}

.generated-image-preview-failed {
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.03);
}

.generated-image-fallback {
  display: grid;
  gap: 6px;
  max-width: 100%;
  text-align: center;
}

.generated-image-fallback strong,
.generated-image-fallback span {
  overflow-wrap: anywhere;
}

.generated-image-fallback strong {
  color: var(--text);
  font-size: 14px;
}

.generated-image-fallback span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.generated-image-action-disabled {
  color: var(--muted);
  font-size: 12px;
}

.generated-image-actions .text-button[disabled],
.image-asset-actions .text-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.generated-image-card-pending .image-asset-body strong {
  color: var(--text);
}

.generated-image-card-pending .image-asset-body span,
.generated-image-pending-caption span {
  color: var(--muted);
  font-size: 12px;
}

.generated-image-preview-pending {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(43, 212, 164, 0.16), transparent 42%),
    radial-gradient(circle at 74% 78%, rgba(120, 119, 255, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.generated-image-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.06) 38%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.06) 62%, transparent 100%);
  transform: translateX(-100%);
  animation: image-pending-shimmer 1.8s linear infinite;
}

.generated-image-spinner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.generated-image-spinner span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(43, 212, 164, 0.9);
  box-shadow: 0 0 0 6px rgba(43, 212, 164, 0.06);
  animation: image-pending-bounce 1.2s ease-in-out infinite;
}

.generated-image-spinner span:nth-child(2) {
  animation-delay: 0.15s;
}

.generated-image-spinner span:nth-child(3) {
  animation-delay: 0.3s;
}

.generated-image-wave {
  position: absolute;
  inset: auto 18px 18px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(43, 212, 164, 0.08), rgba(43, 212, 164, 0.22), rgba(120, 119, 255, 0.16), rgba(43, 212, 164, 0.08));
  filter: blur(10px);
  animation: image-pending-wave 2.2s ease-in-out infinite;
}

.generated-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.generated-image-pending-caption {
  min-height: 34px;
  align-items: center;
}

.generated-image-actions .text-button {
  min-height: 34px;
  padding: 0 10px;
}

@keyframes image-pending-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes image-pending-bounce {
  0%, 80%, 100% {
    transform: translateY(0) scale(0.92);
    opacity: 0.56;
  }

  40% {
    transform: translateY(-10px) scale(1);
    opacity: 1;
  }
}

@keyframes image-pending-wave {
  0%, 100% {
    transform: scaleX(0.86);
    opacity: 0.42;
  }

  50% {
    transform: scaleX(1);
    opacity: 0.88;
  }
}

.image-asset-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.image-asset-card.selected {
  border-color: rgba(43, 212, 164, 0.72);
  background: rgba(43, 212, 164, 0.08);
}

.image-asset-card.batch-mode {
  position: relative;
  padding-top: 44px;
}

.image-asset-card.batch-mode > .batch-select-control {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
}

.image-asset-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: #05070a;
}

.generated-image-status-note {
  white-space: normal;
  line-height: 1.45;
}

.image-asset-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.image-asset-body strong,
.image-asset-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-asset-body span {
  color: var(--muted);
  font-size: 12px;
}

.image-asset-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-center-main,
.video-asset-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.task-center-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-center-title strong,
.task-center-main span,
.video-asset-main span,
.video-asset-main small,
.task-center-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-center-main span,
.video-asset-main span,
.video-asset-main small,
.task-center-main small,
.task-center-meta span {
  color: var(--muted);
  font-size: 12px;
}

.task-center-meta {
  display: grid;
  gap: 5px;
  justify-items: end;
}

.task-progress {
  display: grid;
  gap: 6px;
  width: min(420px, 100%);
  margin-top: 2px;
}

.task-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-progress-header small,
.task-progress-header b {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.task-progress-header b {
  color: var(--text);
  font-weight: 800;
}

.task-progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.task-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #8bd3ff, var(--accent));
  background-size: 180% 100%;
  animation: task-progress-flow 1.6s linear infinite;
  transition: width 0.35s ease;
}

@keyframes task-progress-flow {
  from { background-position: 0 0; }
  to { background-position: 180% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .task-progress-track span {
    animation: none;
  }
}

.task-center-actions {
  display: flex;
  gap: 8px;
}

.preview-subtitle-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  margin: 10px 0 0;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preview-subtitle-status.processing,
.subtitle-status-pill.processing,
.subtitle-status-line.processing {
  color: #ffd166;
}

.preview-subtitle-status.ready,
.subtitle-status-pill.ready,
.subtitle-status-line.ready {
  color: var(--accent);
}

.preview-subtitle-status.failed,
.subtitle-status-pill.failed,
.subtitle-status-line.failed {
  color: var(--danger);
}

.subtitle-status-pill {
  flex: 0 0 auto;
  max-width: 128px;
  overflow: hidden;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtitle-status-line {
  display: inline-block;
  max-width: 100%;
  color: var(--muted);
}

.status-pill {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.status-pill.ok {
  color: var(--accent);
}

.status-pill.warn {
  color: #ffd166;
}

.status-pill.fail {
  color: var(--danger);
}

.danger-icon-button {
  color: var(--danger);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.template-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(43, 212, 164, 0.12), transparent),
    rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.2s ease,
    color 0.22s ease;
}

.template-card:hover {
  border-color: rgba(43, 212, 164, 0.52);
}

button:not(:disabled):active,
.nav-item:active,
.template-card:active,
.cosmos-nav-actions a:active {
  transform: translateY(1px) scale(0.985);
}

.template-card span {
  font-weight: 800;
}

.template-card small,
.history-card span {
  color: var(--muted);
  line-height: 1.45;
}

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

.history-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.history-card.batch-mode {
  grid-template-columns: auto 92px minmax(0, 1fr) auto;
}

.history-card:hover {
  border-color: rgba(43, 212, 164, 0.48);
  background: rgba(255, 255, 255, 0.07);
}

.history-card img {
  width: 92px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
}

.history-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-card strong,
.history-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card.batch-mode,
.task-center-card.batch-mode,
.video-asset-card.batch-mode,
.image-asset-card.batch-mode {
  cursor: pointer;
}

.history-card.batch-mode .history-actions,
.task-center-card.batch-mode .task-center-actions,
.video-asset-card.batch-mode .task-center-actions,
.image-asset-card.batch-mode .image-asset-actions {
  visibility: hidden;
  pointer-events: none;
}

.history-card.is-batch-selected,
.task-center-card.is-batch-selected,
.video-asset-card.is-batch-selected,
.image-asset-card.is-batch-selected {
  border-color: rgba(43, 212, 164, 0.68);
  background: rgba(43, 212, 164, 0.08);
}

.history-play {
  width: 40px;
}

.history-empty {
  min-height: 78px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
}

.watermark-section {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.watermark-section.hidden {
  display: none;
}

.watermark-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.watermark-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.watermark-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.watermark-slider {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-strong);
  transition: background 0.2s ease;
}

.watermark-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s ease;
}

.watermark-toggle input:checked + .watermark-slider {
  background: var(--accent);
}

.watermark-toggle input:checked + .watermark-slider::after {
  transform: translateX(18px);
}

.watermark-toggle strong {
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.watermark-download {
  width: 36px;
  min-height: 36px;
}

.watermark-controls {
  display: grid;
  gap: 10px;
}

.watermark-controls.collapsed {
  display: none;
}

.watermark-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.watermark-field {
  display: grid;
  gap: 4px;
}

.watermark-field span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.watermark-field input[type="range"] {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
  cursor: pointer;
  border: 0;
  padding: 0;
  background: var(--surface-strong);
  border-radius: 999px;
  min-height: auto;
}

.watermark-field select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--text);
}

.watermark-field .custom-select-trigger {
  min-height: 36px;
  background: var(--surface-strong);
}

.watermark-field small {
  color: var(--muted);
  font-size: 11px;
  justify-self: end;
}

.watermark-color-field span {
  margin-bottom: 2px;
}

.watermark-color-field {
  grid-column: 1 / -1;
}

.color-presets {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
}

.color-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.color-chip:hover {
  transform: scale(1.15);
}

.color-chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(43, 212, 164, 0.35);
}

.watermark-preview-window {
  position: relative;
  display: none;
  overflow: hidden;
  border-radius: 6px;
  background: #0b0d13;
}

.watermark-preview-window.active {
  display: block;
}

.watermark-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

.watermark-preview-overlay.active {
  display: block;
}

.watermark-preview-box {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 24px;
  min-height: 16px;
  border: 2px solid var(--danger);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(240, 111, 90, 0.22) 0,
      rgba(240, 111, 90, 0.22) 8px,
      rgba(255, 255, 255, 0.08) 8px,
      rgba(255, 255, 255, 0.08) 16px
    );
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.56);
  cursor: move;
  pointer-events: auto;
  touch-action: none;
}

.watermark-preview-box.dragging {
  border-color: var(--accent);
}

.watermark-preview-label {
  position: absolute;
  left: 4px;
  top: 4px;
  max-width: 160px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(10, 14, 20, 0.86);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.watermark-canvas {
  display: none;
  width: 100%;
  border-radius: 6px;
  background: #0b0d13;
}

.watermark-preview-window.active .watermark-canvas,
.watermark-canvas.active {
  display: block;
}

.watermark-status {
  color: var(--accent);
  font-size: 12px;
  min-height: 18px;
}

.watermark-progress {
  display: grid;
  gap: 7px;
}

.watermark-progress.hidden {
  display: none;
}

.watermark-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.watermark-progress-header strong {
  color: var(--text);
}

.watermark-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.watermark-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 0.25s ease;
}

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

  .cosmos-hero {
    max-width: 820px;
    padding: 6vh 0 0;
  }

  .cosmos-orbit-panel {
    min-height: auto;
  }

  .orbit-core {
    width: min(100%, 300px);
  }

  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand span:last-child,
  .nav-item span,
  .usage-panel {
    display: none;
  }

  .sidebar {
    align-items: center;
  }

  .sidebar-header {
    justify-content: center;
  }

  .nav-item {
    justify-content: center;
    width: 48px;
    padding: 0;
  }

  .creator-grid,
  .image-generator-layout {
    grid-template-columns: 1fr;
  }

  .image-studio-shell {
    min-height: calc(100vh - 126px);
    padding-bottom: 250px;
  }

  .image-stage {
    min-height: 520px;
    height: calc(100vh - 180px);
    max-height: calc(100vh - 180px);
  }

  .image-stage-heading,
  .image-composer-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .image-preset-panel {
    bottom: 252px;
  }

  .image-composer-main {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }

  .image-upload-button {
    width: 52px;
    height: 52px;
  }

  .image-chip {
    min-height: 42px;
    padding: 0 13px;
  }

  .image-submit-cluster {
    justify-content: flex-end;
  }

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

@media (max-width: 760px) {
  .cosmos-shell {
    width: min(100% - 28px, 640px);
    min-height: 100vh;
    gap: 18px;
    padding: 16px 0 20px;
  }

  .cosmos-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .cosmos-nav-actions {
    width: 100%;
    overflow-x: auto;
  }

  .cosmos-hero {
    padding: 4vh 0 0;
  }

  .cosmos-hero h1 {
    font-size: 43px;
  }

  .cosmos-copy {
    font-size: 15px;
    line-height: 1.68;
  }

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

  .cosmos-primary,
  .cosmos-secondary {
    width: 100%;
  }

  .cosmos-orbit-panel {
    padding: 18px;
  }

  .orbit-core {
    width: min(100%, 230px);
  }

  .orbit-timeline div {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 10px 12px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    height: auto;
    padding: 14px;
    overflow: hidden;
  }

  .sidebar-toggle {
    display: none;
  }

  .brand span:last-child,
  .nav-item span {
    display: inline;
    max-width: none;
    opacity: 1;
    transform: none;
  }

  .nav-list {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    min-width: 0;
    overflow-x: auto;
    justify-content: end;
  }

  .nav-item {
    width: auto;
    padding: 0 12px;
  }

  body.sidebar-collapsed .app-shell {
    display: block;
  }

  body.sidebar-collapsed .sidebar {
    align-items: stretch;
    padding: 14px;
  }

  body.sidebar-collapsed .sidebar-header {
    flex-direction: row;
    justify-content: space-between;
  }

  body.sidebar-collapsed .brand {
    gap: 12px;
  }

  body.sidebar-collapsed .brand span:last-child,
  body.sidebar-collapsed .nav-item span {
    max-width: none;
    opacity: 1;
    transform: none;
  }

  body.sidebar-collapsed .nav-item {
    width: auto;
    padding: 0 12px;
  }

  body.sidebar-collapsed .usage-panel {
    max-height: 140px;
    margin-top: auto;
    padding: 16px;
    border-color: var(--line);
    opacity: 1;
  }

  .workspace {
    padding: 18px 14px 28px;
  }

  .topbar,
  .preview-toolbar,
  .panel-heading {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .top-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .generator-panel,
  .reference-panel,
  .settings-panel,
  .submit-panel,
  .preview-panel {
    padding: 18px;
  }

  .control-row,
  .detail-grid,
  .template-list,
  .account-dashboard,
  .account-grid,
  .credit-package-list,
  .task-center-card,
  .video-asset-card {
    grid-template-columns: 1fr;
  }

  .prompt-optimizer-row,
  .prompt-optimizer-actions {
    grid-template-columns: 1fr;
  }

  .prompt-optimizer-button,
  .prompt-optimizer-undo {
    width: 100%;
  }

  .prompt-optimizer-status {
    white-space: normal;
  }

  .wallet-balance-block strong {
    font-size: 36px;
  }

  .account-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .account-tab {
    justify-content: center;
    width: 100%;
  }

  .ledger-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .task-center-meta {
    justify-items: start;
  }

  .submit-panel {
    position: static;
  }

  .feedback-launcher {
    right: 14px;
    bottom: 14px;
  }

  .feedback-dialog {
    right: 14px;
    left: 14px;
    bottom: 66px;
    width: auto;
  }

  .video-player-dialog {
    inset: 14px;
    transform: none;
    width: auto;
    max-height: calc(100vh - 28px);
  }

  .video-player-header,
  .video-player-actions {
    align-items: flex-start;
  }

  .video-player-header {
    flex-direction: column;
  }

  .video-player-actions {
    flex-wrap: wrap;
  }

  h1 {
    font-size: 30px;
  }
}

@media (max-width: 760px) {
  html,
  body,
  .particle-core-entry {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .particle-core-entry .cosmos-shell {
    width: calc(100% - 28px);
    max-width: 100%;
    overflow: hidden;
  }

  .particle-core-entry .cosmos-hero {
    max-width: 100%;
    padding-bottom: 104px;
  }

  .particle-core-entry .cosmos-hero h1 {
    max-width: 100%;
    font-size: 38px;
    line-height: 1.05;
    overflow-wrap: anywhere;
    text-wrap: wrap;
  }

  .particle-core-entry .cosmos-copy {
    width: min(330px, calc(100vw - 28px));
    max-width: min(330px, calc(100vw - 28px));
    font-size: 14px;
    line-height: 1.65;
    white-space: normal;
    word-break: break-all;
  }

  .particle-core-entry .cosmos-core-readout {
    position: fixed;
    right: auto;
    left: 14px;
    bottom: 22px;
    width: 164px;
    min-width: 0;
    max-width: calc(100vw - 28px);
  }
}
