:root {
  color-scheme: light;
  --page: #f7f8fc;
  --panel: #ffffff;
  --panel-soft: #fbfbff;
  --line: #e8eaf3;
  --line-strong: #d9dded;
  --text: #24263f;
  --muted: #8b90a7;
  --soft: #f3f5fb;
  --accent: #4d50e8;
  --accent-2: #6b73ff;
  --accent-soft: #f0efff;
  --ok: #16a36a;
  --warn: #c87912;
  --danger: #d64545;
  --shadow: 0 18px 48px rgba(37, 39, 72, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  border: 0;
}

button,
select {
  cursor: pointer;
}

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

button:focus-visible {
  outline: 3px solid rgba(77, 80, 232, 0.22);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.login-screen {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, #f9fbff 0%, #f7f7ff 42%, #ffffff 100%);
}

.login-nav {
  position: relative;
  z-index: 4;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 clamp(22px, 5vw, 58px);
}

.login-nav nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
}

.login-nav nav button {
  padding: 0;
  color: inherit;
  background: transparent;
}

.login-nav-button {
  height: 38px;
  padding: 0 22px !important;
  border: 1px solid rgba(36, 38, 63, 0.78) !important;
  border-radius: 999px;
}

.login-hero {
  min-height: calc(100vh - 76px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(480px, 680px) minmax(0, 1fr);
  align-items: center;
  padding: 44px clamp(22px, 7vw, 140px) 88px;
}

.login-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  max-width: 720px;
  padding-bottom: 44px;
}

.login-kicker {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #707493;
  font-size: 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
}

.login-kicker span {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent);
}

.login-copy h1 {
  margin-top: 24px;
  color: #30324e;
  font-size: clamp(42px, 3.8vw, 56px);
  line-height: 1.16;
  font-weight: 900;
  white-space: nowrap;
}

.login-subtitle {
  margin-top: 8px;
  color: #8a8fa7;
  font-size: clamp(34px, 3.2vw, 48px);
  line-height: 1.18;
  font-weight: 820;
  white-space: nowrap;
}

.login-cta {
  height: 58px;
  margin-top: 54px;
  padding: 0 34px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(90deg, #8d78ff, #52bcff);
  box-shadow: 0 16px 34px rgba(77, 80, 232, 0.18);
  font-size: 20px;
  font-weight: 900;
}

.login-gallery {
  position: absolute;
  z-index: 1;
  inset: 10px 0 0 clamp(360px, 24vw, 520px);
  overflow: hidden;
  height: calc(100vh - 10px);
  display: grid;
  align-content: center;
  gap: 24px;
  pointer-events: none;
  contain: paint;
}

.login-gallery::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -24px auto -24px 0;
  width: min(52%, 660px);
  background: linear-gradient(90deg, #f9fbff 0%, rgba(249, 251, 255, 0.96) 28%, rgba(249, 251, 255, 0.62) 58%, transparent 100%);
}

.login-gallery::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(249, 251, 255, 0.78) 0%, transparent 18%, transparent 82%, rgba(249, 251, 255, 0.94) 100%);
}

.gallery-track {
  display: flex;
  gap: 16px;
  width: max-content;
  max-width: none;
  will-change: transform;
}

.track-one {
  animation: galleryMoveLeft 34s linear infinite;
}

.track-two {
  margin-left: 130px;
  animation: galleryMoveRight 40s linear infinite;
}

.track-three {
  margin-left: -84px;
  animation: galleryMoveLeft 44s linear infinite;
}

.gallery-tile {
  width: 310px;
  height: 164px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(103, 138, 235, 0.24);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(37, 39, 72, 0.07);
  opacity: 0.74;
}

.gallery-tile.wide {
  width: 392px;
}

.gallery-tile.small {
  width: 210px;
}

.gallery-tile.tall {
  width: 270px;
  height: 250px;
}

.gallery-tile.muted {
  opacity: 0.44;
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 24%;
}

.login-card {
  position: fixed;
  z-index: 7;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100vw - 36px));
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 46px rgba(37, 39, 72, 0.08);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 12px));
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(139, 144, 167, 0.26);
  border-radius: 10px;
  color: #30324e;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(37, 39, 72, 0.08);
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.login-close-button:hover {
  color: var(--accent);
  background: #ffffff;
}

.login-screen.show-login-form::before {
  content: "";
  position: fixed;
  z-index: 6;
  inset: 0;
  background: rgba(23, 26, 48, 0.28);
  backdrop-filter: blur(4px);
}

.login-screen.show-login-form .login-card {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.login-card h2 {
  font-size: 22px;
  line-height: 1.2;
}

.login-card p {
  margin-top: 6px;
  color: var(--muted);
  white-space: nowrap;
}

@keyframes galleryMoveLeft {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-220px, 0, 0);
  }
}

@keyframes galleryMoveRight {
  from {
    transform: translate3d(-240px, 0, 0);
  }

  to {
    transform: translate3d(0, 0, 0);
  }
}

.login-card label,
.prompt-field,
.clone-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

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

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

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #5f647c 50%),
    linear-gradient(135deg, #5f647c 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 10px) 17px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.custom-select-shell {
  position: relative;
  display: block;
  width: 100%;
}

.native-select-hidden {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-select-button {
  position: relative;
  width: 100%;
  height: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font-weight: 860;
  line-height: 1;
  text-align: left;
  box-shadow: 0 8px 20px rgba(38, 39, 72, 0.03);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

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

.custom-select-button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #5f647c;
  transform: translateY(-34%);
  transition: transform 0.16s ease;
}

.custom-select-shell.open .custom-select-button {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 80, 232, 0.12), 0 12px 24px rgba(38, 39, 72, 0.06);
}

.custom-select-shell.open .custom-select-button::after {
  transform: translateY(-60%) rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  display: none;
  width: max-content;
  min-width: 100%;
  max-width: min(320px, calc(100vw - 24px));
  max-height: 168px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(34, 36, 68, 0.16);
  backdrop-filter: blur(10px);
}

.custom-select-shell.open .custom-select-menu {
  display: grid;
  gap: 4px;
  animation: customSelectDrop 0.14s ease-out;
}

.custom-select-option {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  font-weight: 820;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.custom-select-option:hover,
.custom-select-option.active {
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #6d72ff);
}

.custom-select-option.active::before {
  content: "✓";
  margin-right: 7px;
  font-weight: 900;
}

.custom-select-shell.disabled .custom-select-button {
  cursor: not-allowed;
  opacity: 0.55;
}

.studio-inline-voice-clone[hidden],
.studio-inline-voice-prompt[hidden] {
  display: none !important;
}

@keyframes customSelectDrop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

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

textarea {
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(77, 80, 232, 0.12);
}

select:focus {
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(77, 80, 232, 0.12);
}

.product {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  background: #ffffff;
}

.product.nav-collapsed {
  grid-template-columns: 88px minmax(0, 1fr);
}

.product.creation-mode {
  grid-template-columns: minmax(0, 1fr);
}

.product.creation-mode > .main-nav {
  display: none;
}

.main-nav {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.nav-head {
  min-width: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-toggle-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #6269e8;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(77, 80, 232, 0.08);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.nav-toggle-button:hover {
  border-color: rgba(77, 80, 232, 0.32);
  background: var(--accent-soft);
}

.nav-footer {
  min-height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-size: 21px;
  font-weight: 900;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.92) 0 8%, transparent 9%),
    linear-gradient(135deg, #3f42d8, #22c7d6);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(77, 80, 232, 0.2);
}

.nav-brand {
  min-width: 0;
  padding: 0 2px;
}

.nav-brand strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav nav {
  display: grid;
  align-content: start;
  gap: 12px;
}

.nav-section {
  margin: 14px 10px 4px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 860;
}

.nav-section-icon {
  width: 22px;
  display: inline-grid;
  place-items: center;
  color: #858ba6;
  font-size: 18px;
  line-height: 1;
}

.nav-item {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
  text-align: left;
}

.nav-icon {
  width: 22px;
  display: inline-grid;
  flex: 0 0 22px;
  place-items: center;
  color: #666d8c;
  font-size: 21px;
  line-height: 1;
}

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

.video-create-nav {
  min-height: 54px;
  margin: 0 0 18px;
  padding: 0 20px;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(90deg, #7f7cff, #a4a6ff);
  box-shadow: 0 12px 26px rgba(77, 80, 232, 0.15);
}

.product.nav-collapsed .main-nav {
  padding: 18px 10px;
}

.product.nav-collapsed .nav-head {
  height: auto;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.product.nav-collapsed .nav-brand {
  justify-content: center;
  padding: 0;
}

.product.nav-collapsed .nav-footer {
  justify-content: center;
}

.product.nav-collapsed .nav-brand strong,
.product.nav-collapsed .nav-section span:not(.nav-section-icon),
.product.nav-collapsed .nav-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.product.nav-collapsed .main-nav nav {
  justify-items: center;
  gap: 10px;
}

.product.nav-collapsed .nav-section {
  justify-content: center;
  width: 52px;
  margin: 12px 0 2px;
}

.product.nav-collapsed .nav-item {
  width: 54px;
  min-height: 48px;
  justify-content: center;
  gap: 0;
  padding: 0;
}

.product.nav-collapsed .video-create-nav {
  min-height: 52px;
  margin: 0 0 12px;
}

.product.nav-collapsed .nav-icon {
  width: auto;
  flex-basis: auto;
  font-size: 23px;
}

.nav-item.active,
.nav-item:hover {
  color: #ffffff;
  background: linear-gradient(90deg, #7c80ff, #a4a7ff);
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon,
.video-create-nav .nav-icon {
  color: #ffffff;
}

.studio {
  min-width: 0;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
  min-height: 100vh;
}

.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 88px 0 22px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.title-block,
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.title-block strong {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

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

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 68px 500px minmax(620px, 1fr);
  background: #fafbfe;
}

.tool-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 8px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.tool {
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 4px;
  border-radius: 8px;
  color: #62677f;
  background: transparent;
  font-size: 13px;
  font-weight: 760;
}

.tool span {
  font-size: 20px;
  line-height: 1;
}

.tool.active,
.tool:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.inspector {
  min-width: 0;
  overflow: auto;
  padding: 22px 28px 36px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: grid;
  gap: 16px;
}

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

.panel-title h2 {
  font-size: 20px;
  line-height: 1.2;
}

.panel-title h3 {
  font-size: 16px;
}

.panel-title select {
  width: auto;
  min-width: 126px;
  height: 36px;
  min-height: 36px;
  line-height: 36px;
  border-color: var(--line);
  background-position:
    calc(100% - 16px) 15px,
    calc(100% - 10px) 15px;
  font-weight: 760;
}

.panel-title .custom-select-shell {
  width: auto;
  min-width: 126px;
}

.panel-title .custom-select-button {
  height: 36px;
  min-height: 36px;
  font-weight: 800;
}

.compact-title {
  margin-top: 4px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.avatar-style-control {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8f8ff);
}

.avatar-style-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.avatar-style-head strong {
  font-size: 14px;
}

.avatar-style-head small,
.compact-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.radio-cluster.compact {
  gap: 8px;
}

.radio-cluster.compact label {
  flex: 1;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 860;
}

.radio-cluster.compact label:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(76, 78, 229, 0.08);
}

.compact-field {
  display: grid;
  gap: 6px;
}

.compact-field select,
.compact-field input {
  min-height: 36px;
}

.compact-field .custom-select-button {
  height: 36px;
  min-height: 36px;
}

.motion-control-grid {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.style-control-note,
.builder-style-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.builder-style-note {
  padding: 0 2px;
}

.motion-control {
  display: grid;
  gap: 6px;
}

.motion-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.motion-control em {
  min-width: 34px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(76, 78, 229, 0.09);
  font-style: normal;
  text-align: center;
}

.motion-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.avatar-outfit-custom[hidden] {
  display: none;
}

.asset-handoff-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(76, 78, 229, 0.08), rgba(45, 212, 255, 0.08)),
    #ffffff;
}

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

.handoff-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #33b4ff);
  font-size: 24px;
  font-weight: 900;
}

.asset-handoff-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 15px;
}

.asset-handoff-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.handoff-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.handoff-actions button {
  min-height: 36px;
}

.asset-grid {
  display: grid;
  gap: 12px;
}

.garment-row {
  display: grid;
  grid-template-columns: 1fr 156px;
  gap: 10px;
  align-items: stretch;
}

.garment-row select {
  align-self: end;
}

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

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

.asset-card {
  position: relative;
  min-height: 158px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--thumb, #eef1f8);
}

.asset-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.95) 0 18%, transparent 19%),
    linear-gradient(180deg, transparent 42%, rgba(36, 38, 63, 0.64));
}

.asset-card.person-card {
  background: #f4f6fb;
}

.asset-card.person-card img,
.asset-card.person-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.asset-card.person-card img.platform-cutout {
  object-fit: contain;
  object-position: center bottom;
  padding: 8px 8px 0;
  box-sizing: border-box;
  filter: drop-shadow(0 18px 26px rgba(17, 24, 39, 0.28));
}

.asset-card.person-card::before {
  z-index: 1;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0) 42%, rgba(17, 24, 39, 0.74));
}

.asset-card.background-card::before {
  background: none;
}

.asset-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.avatar-mode-badge {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 10px;
  min-width: 52px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(20, 28, 54, 0.42);
  box-shadow: 0 10px 28px rgba(20, 24, 48, 0.18);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.avatar-mode-badge.video {
  background: linear-gradient(135deg, rgba(77, 80, 232, 0.92), rgba(51, 180, 255, 0.9));
}

.avatar-mode-badge.photos {
  background: linear-gradient(135deg, rgba(21, 181, 149, 0.92), rgba(79, 70, 229, 0.86));
}

.avatar-mode-badge.platform {
  background: linear-gradient(135deg, rgba(91, 88, 255, 0.95), rgba(41, 182, 246, 0.92));
}

.avatar-mode-badge.threed {
  min-width: 60px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.96), rgba(79, 70, 229, 0.92));
}

.avatar-mode-badge.pending-system {
  min-width: 58px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.96), rgba(239, 68, 68, 0.92));
}

.asset-empty,
.voice-empty {
  grid-column: 1 / -1;
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-soft);
  text-align: center;
  font-weight: 760;
}

.asset-empty small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.asset-card strong,
.asset-card small {
  position: absolute;
  z-index: 2;
  left: 12px;
  right: 12px;
  color: #ffffff;
  text-align: left;
}

.asset-card strong {
  bottom: 30px;
  font-size: 14px;
}

.asset-card small {
  bottom: 12px;
  opacity: 0.86;
}

.upload-card {
  position: relative;
  min-height: 104px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  text-align: center;
}

.upload-card.large {
  min-height: 174px;
}

.upload-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-card:hover,
.upload-card.drag-over {
  border-color: var(--accent);
  background: #f8f8ff;
}

.upload-card small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 24px;
}

.speaker-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px 32px;
  align-items: center;
  gap: 10px;
}

.script-segment-list {
  display: grid;
  gap: 18px;
}

.script-segment-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
}

.script-segment-card.active {
  border-color: rgba(77, 80, 232, 0.28);
  background: #fbfbff;
}

.script-segment-card .speaker-row {
  grid-template-columns: 24px 24px minmax(0, 1fr) 28px 32px;
}

.speaker-avatar-dot {
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 32%, #ffffff 0 32%, transparent 33%),
    linear-gradient(145deg, #e7edf6, #8d9bbb);
  background-position: center;
  background-size: cover;
  cursor: pointer;
}

.speaker-name-button {
  min-width: 0;
  height: 28px;
  justify-content: start;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: transparent;
  font-weight: 850;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-name-button:hover {
  color: var(--accent);
}

.scene-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.play-mini,
.dots {
  height: 28px;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  font-weight: 800;
}

.segment-more-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  width: 136px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(77, 80, 232, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(31, 35, 70, 0.14);
}

.segment-more-menu[hidden] {
  display: none;
}

.segment-more-menu button {
  height: 34px;
  justify-content: start;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.segment-more-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.segment-more-menu button.danger:hover {
  color: #dc2626;
  background: #fff1f2;
}

.text-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.script-segment-card textarea {
  min-height: 108px;
  resize: vertical;
  border-color: transparent;
  background: #ffffff;
  font-size: 15px;
  line-height: 1.65;
}

.script-segment-card.active textarea,
.script-segment-card textarea:focus {
  border-color: var(--line);
  background: #ffffff;
}

.segment-card-meta,
.segment-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.segment-card-meta {
  justify-content: space-between;
}

.segment-card-actions {
  padding-top: 2px;
}

.segment-card-actions small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segment-controls,
.voice-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text);
  background: var(--soft);
  font-weight: 760;
}

.chip.active,
.chip:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.link-button {
  min-height: 32px;
  padding: 0 8px;
  color: var(--accent);
  background: transparent;
  font-weight: 800;
}

.segments {
  display: none;
  gap: 8px;
}

.segment-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.segment-item span:first-child {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.segment-item p {
  overflow-wrap: anywhere;
  color: #4f536a;
  line-height: 1.4;
}

.voice-section {
  display: grid;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.voice-card {
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.voice-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.voice-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--voice-color);
}

.voice-card strong {
  display: block;
  margin-bottom: 4px;
}

.voice-card small {
  color: var(--muted);
}

.videos-page {
  position: relative;
  min-height: 100vh;
  min-width: 0;
  overflow: auto;
  background: #ffffff;
}

.videos-topbar {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 6;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 22px 0 0;
}

.videos-account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-account {
  position: fixed;
  top: 12px;
  right: 22px;
  z-index: 70;
}

.account-menu-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
}

.account-menu-button:hover {
  background: var(--accent-soft);
}

.account-avatar {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 34%, #ffffff 0 22%, transparent 23%),
    radial-gradient(circle at 50% 92%, #ffffff 0 34%, transparent 35%),
    linear-gradient(135deg, #6b73ff, #56d5c5);
  box-shadow: 0 8px 22px rgba(77, 80, 232, 0.16);
}

.account-menu {
  position: absolute;
  top: 46px;
  right: 0;
  width: 168px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(37, 39, 72, 0.14);
}

.account-menu-card {
  min-height: 54px;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
  text-align: left;
}

.account-menu-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.account-menu-card span,
.account-menu-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-card.logout:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.account-menu-card.logout:hover small {
  color: rgba(255, 255, 255, 0.82);
}

.videos-hero {
  position: relative;
  isolation: isolate;
  min-height: 214px;
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(600px, 1.1fr);
  align-items: center;
  overflow: hidden;
  padding: 0 clamp(24px, 3vw, 46px) 0 clamp(36px, 4.2vw, 58px);
  background:
    linear-gradient(92deg, #ffffff 0%, #ffffff 40%, #f7fbff 64%, #ffffff 100%);
}

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

.videos-hero::before {
  z-index: 0;
  opacity: 0.88;
  background:
    linear-gradient(112deg, transparent 0 40%, rgba(45, 212, 255, 0.12) 48%, rgba(84, 93, 255, 0.1) 56%, transparent 66%),
    repeating-linear-gradient(90deg, rgba(51, 95, 255, 0.055) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(0deg, rgba(45, 212, 255, 0.05) 0 1px, transparent 1px 54px);
  background-size: 220% 100%, 88px 54px, 88px 54px;
  animation: videosHeroSweep 8.5s ease-in-out infinite;
}

.videos-hero::after {
  z-index: 1;
  background:
    linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.98) 34%, rgba(255, 255, 255, 0.46) 53%, rgba(255, 255, 255, 0.04) 75%),
    repeating-linear-gradient(118deg, transparent 0 22px, rgba(78, 96, 255, 0.06) 22px 23px, transparent 23px 70px);
  background-size: 100% 100%, 170% 170%;
  animation: videosHeroGrid 15s linear infinite;
}

.videos-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  align-content: center;
}

.videos-hero h1 {
  font-size: 28px;
  line-height: 1.18;
  font-weight: 900;
}

.videos-hero p {
  color: var(--muted);
  font-size: 15px;
}

.hero-create {
  width: fit-content;
  min-width: 132px;
  height: 36px;
  margin-top: 10px;
  padding: 0 18px;
  border-radius: 8px;
}

.videos-hero-art {
  position: relative;
  z-index: 2;
  height: 214px;
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0);
  background:
    radial-gradient(circle at 74% 28%, rgba(130, 219, 255, 0.32), transparent 30%),
    radial-gradient(circle at 90% 72%, rgba(255, 218, 135, 0.28), transparent 28%),
    linear-gradient(115deg, rgba(255, 255, 255, 0) 0 31%, rgba(218, 253, 255, 0.66) 49%, rgba(255, 246, 219, 0.54) 70%, rgba(255, 255, 255, 0) 100%),
    repeating-linear-gradient(100deg, rgba(68, 86, 255, 0.11) 0 1px, transparent 1px 42px);
  animation: heroArtLift 6.5s ease-in-out infinite;
}

.videos-hero.videos-hero-static::before,
.videos-hero.videos-hero-static::after,
.videos-hero-art.reference-hero-art::before,
.videos-hero-art.reference-hero-art::after {
  display: none;
}

.videos-hero-art.reference-hero-art {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  background: transparent;
  animation: none;
}

.videos-hero-reference {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center right;
  user-select: none;
  pointer-events: none;
}

.videos-hero-art::before {
  content: "";
  position: absolute;
  right: 4%;
  bottom: -18px;
  z-index: 0;
  width: 560px;
  height: 238px;
  transform: skewX(-10deg);
  border: 1px solid rgba(89, 111, 255, 0.12);
  border-radius: 24px 24px 0 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(196, 242, 255, 0.32) 50%, rgba(255, 246, 220, 0.44)),
    repeating-linear-gradient(90deg, rgba(74, 91, 255, 0.08) 0 1px, transparent 1px 44px);
  box-shadow: 0 26px 80px rgba(70, 83, 190, 0.16);
  animation: heroPanelPulse 5.8s ease-in-out infinite;
}

.videos-hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.98) 12%, rgba(255, 255, 255, 0.42) 34%, transparent 60%),
    linear-gradient(180deg, transparent 0%, transparent 80%, #ffffff 100%),
    linear-gradient(108deg, transparent 0 58%, rgba(255, 255, 255, 0.72) 64%, transparent 70%);
  background-size: 100% 100%, 100% 100%, 180% 100%;
  animation: heroGlassSweep 5.5s ease-in-out infinite;
}

.hero-person {
  position: absolute;
  z-index: 2;
  right: 10%;
  bottom: -12px;
  width: min(338px, 23vw);
  height: 238px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 18px 18px 0 0;
  filter: brightness(1.09) contrast(1.04) saturate(1.16) drop-shadow(0 32px 66px rgba(37, 39, 72, 0.17));
  -webkit-mask-image: linear-gradient(180deg, #000 0 88%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0 88%, transparent 100%);
  animation: heroPersonFloat 5.2s ease-in-out infinite;
}

.floating-face {
  position: absolute;
  z-index: 5;
  width: 92px;
  height: 64px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(255, 255, 255, 0.98);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(37, 39, 72, 0.15), 0 0 0 1px rgba(89, 111, 255, 0.12);
  filter: brightness(1.04) saturate(1.12) contrast(1.03);
  animation: heroCardFloat 5.8s ease-in-out infinite;
}

.face-a {
  right: 43%;
  top: 36px;
  width: 72px;
  height: 72px;
  object-position: center 10%;
  animation-delay: -1s;
}

.face-b {
  right: 50%;
  top: 112px;
  width: 132px;
  height: 76px;
  object-position: center 22%;
  animation-delay: -2.6s;
}

.face-c {
  right: 3%;
  top: 76px;
  width: 122px;
  height: 122px;
  object-position: center 10%;
  animation-delay: -3.8s;
}

@keyframes videosHeroSweep {
  0% {
    background-position: 110% 0, 0 0, 0 0;
  }

  50% {
    background-position: 22% 0, 28px 0, 0 18px;
  }

  100% {
    background-position: -80% 0, 88px 0, 0 54px;
  }
}

@keyframes videosHeroGrid {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 0 0, 160px 80px;
  }
}

@keyframes heroArtLift {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes heroPanelPulse {
  0%,
  100% {
    transform: skewX(-10deg) translateY(0);
    opacity: 0.72;
  }

  50% {
    transform: skewX(-10deg) translateY(-5px);
    opacity: 0.96;
  }
}

@keyframes heroGlassSweep {
  0%,
  100% {
    background-position: 0 0, 0 0, 130% 0;
  }

  50% {
    background-position: 0 0, 0 0, -20% 0;
  }
}

@keyframes heroPersonFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-5px) scale(1.012);
  }
}

@keyframes heroCardFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-7px) rotate(-0.8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .videos-hero::before,
  .videos-hero::after,
  .videos-hero-art,
  .videos-hero-art::before,
  .videos-hero-art::after,
  .hero-person,
  .floating-face {
    animation: none;
  }
}

.my-videos-section {
  padding: 12px 44px 72px;
}

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

.my-videos-head h2 {
  font-size: 22px;
}

.my-video-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.my-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.video-card {
  position: relative;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.video-card:hover,
.video-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 14px 32px rgba(37, 39, 72, 0.08);
}

.video-card.menu-open {
  z-index: 5;
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #6b6b72, #1f2029 20%, #f0eadf 50%, #25262d 82%, #6d6b72);
}

.video-thumb video,
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
  background: linear-gradient(90deg, #6b6b72, #efede7 50%, #595a62);
}

.video-cover-media {
  opacity: 0.01;
  transition: opacity 160ms ease;
}

.video-cover-media.ready {
  opacity: 1;
}

.video-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: url("/console-assets/generated/cutout/fresh-avatar-04.png?v=20260703-platform-cutout-only") center bottom / contain no-repeat;
}

.video-thumb-placeholder::before {
  content: none;
}

.video-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
  padding: 16px 20px 18px;
}

.video-info strong {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 18px;
}

.video-info b {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-info em {
  padding: 3px 8px;
  border-radius: 8px;
  color: #777b91;
  background: var(--soft);
  font-size: 13px;
  font-style: normal;
}

.video-info small,
.my-video-empty small {
  color: var(--muted);
}

.video-info-text {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.video-card-actions {
  position: relative;
  justify-self: end;
  align-self: center;
}

.video-menu-button {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: var(--text);
  background: var(--soft);
  font-size: 20px;
  font-weight: 900;
}

.video-menu-button:hover,
.video-menu-button[aria-expanded="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.video-card-menu {
  position: absolute;
  z-index: 20;
  top: 52px;
  right: 0;
  width: 184px;
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(37, 39, 72, 0.16);
}

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

.video-card-menu button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 0 16px;
  color: var(--text);
  background: transparent;
  font-size: 16px;
  font-weight: 900;
  text-align: left;
}

.video-card-menu button:hover {
  background: var(--accent-soft);
}

.video-card-menu button[data-video-action="delete"] {
  color: #d83535;
}

.video-card-menu span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: currentColor;
  background: var(--soft);
  font-size: 14px;
}

.my-video-empty {
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbff;
}

.asset-library {
  min-height: 100vh;
  min-width: 0;
  padding: 28px 96px 64px 34px;
  overflow: auto;
  background: #ffffff;
}

.voice-library-page.compose-tab {
  padding: 28px 96px 40px 34px;
  overflow: auto;
}

.voice-library-page.compose-tab .library-toolbar {
  margin: 24px 0 18px;
}

.library-topbar,
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.library-topbar h1 {
  font-size: 26px;
  line-height: 1.2;
}

.library-create {
  height: 42px;
  padding: 0 20px;
  font-size: 16px;
}

.library-toolbar {
  margin: 28px 0 30px;
}

.library-tabs {
  display: flex;
  gap: 28px;
  align-items: center;
}

.library-tabs button {
  min-height: 34px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  font-weight: 900;
}

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

.library-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.library-filters select {
  width: 112px;
  height: 38px;
  min-height: 38px;
  line-height: 38px;
  border-color: var(--line);
  background-color: #ffffff;
  background-position:
    calc(100% - 16px) 16px,
    calc(100% - 10px) 16px;
  font-weight: 800;
}

.library-filters .custom-select-shell {
  width: 112px;
}

.library-filters .custom-select-shell[data-select-id="libraryAvatarTypeFilter"] {
  width: 156px;
}

.library-filters .custom-select-button {
  height: 38px;
  min-height: 38px;
  font-weight: 900;
}

.library-filters .custom-select-menu {
  max-height: 148px;
}

.voice-library-page.compose-tab .library-filters,
.voice-library-page.material-tab .library-filters,
.voice-library-page.convert-tab .library-filters {
  display: none;
}

.avatar-library-filters {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.library-search {
  width: min(292px, 34vw);
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
}

.library-search input {
  width: 100%;
  min-height: 38px;
  padding: 0;
  border: 0;
}

.garment-library-page {
  padding-right: 48px;
}

.garment-library-topbar p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.garment-upload-button {
  display: inline-grid;
  place-items: center;
  min-width: 132px;
  cursor: pointer;
}

.icon-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.garment-toolbar {
  align-items: flex-start;
}

.garment-library-filters {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.garment-library-filters .custom-select-shell {
  width: 132px;
}

.wardrobe-upload-panel,
.wardrobe-ai-panel {
  display: grid;
  gap: 14px;
  margin: -10px 0 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(247, 248, 255, 0.98), rgba(255, 255, 255, 0.94));
}

.wardrobe-upload-panel[hidden],
.wardrobe-ai-panel[hidden] {
  display: none;
}

.wardrobe-upload-drop {
  position: relative;
  min-height: 126px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed rgba(78, 84, 238, 0.32);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.wardrobe-upload-drop.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.wardrobe-upload-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wardrobe-upload-drop > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #5651ef, #37b7ff);
  font-size: 24px;
  font-weight: 900;
}

.wardrobe-upload-drop strong,
.wardrobe-upload-drop small {
  text-align: center;
}

.wardrobe-upload-drop small {
  color: var(--muted);
  font-weight: 800;
}

.wardrobe-upload-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.wardrobe-upload-meta label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
}

.wardrobe-upload-meta span {
  font-size: 13px;
}

.wardrobe-ai-panel {
  grid-template-columns: minmax(220px, 0.72fr) minmax(280px, 1fr) auto;
  align-items: center;
}

.wardrobe-ai-copy {
  display: grid;
  gap: 6px;
}

.wardrobe-ai-copy strong {
  font-size: 18px;
}

.wardrobe-ai-copy span,
.wardrobe-ai-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.wardrobe-ai-panel textarea {
  min-height: 76px;
  resize: vertical;
}

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

.wardrobe-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(37, 39, 72, 0.05);
}

.wardrobe-card:hover {
  border-color: rgba(78, 84, 238, 0.5);
  box-shadow: 0 16px 34px rgba(37, 39, 72, 0.08);
}

.wardrobe-thumb {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f5f6fb;
}

.wardrobe-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 22%;
}

.wardrobe-card-body {
  display: grid;
  gap: 6px;
  padding: 14px 16px 10px;
}

.wardrobe-card-body strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wardrobe-card-body small,
.wardrobe-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.wardrobe-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0 14px 14px;
}

.wardrobe-use-button,
.wardrobe-delete-button {
  height: 38px;
  min-width: 0;
  margin: 0;
  font-size: 14px;
}

.wardrobe-delete-button {
  width: 64px;
  color: #ef4444;
}

.wardrobe-prompt-preview {
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 24% 18%, rgba(86, 81, 239, 0.18), transparent 28%),
    linear-gradient(135deg, #f8f8ff, #edf7ff);
}

.wardrobe-prompt-preview span {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #5651ef, #37b7ff);
  font-weight: 900;
}

.wardrobe-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: #fbfbff;
}

.wardrobe-empty small {
  color: var(--muted);
  font-weight: 800;
}

.library-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.library-avatar-card {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #ffffff;
  background: var(--panel-soft);
  text-align: left;
}

.library-avatar-card:hover,
.library-avatar-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.library-avatar-card img,
.library-avatar-card video,
.library-avatar-card::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.library-avatar-card img.platform-cutout {
  object-fit: contain;
  object-position: center bottom;
  padding: 12px 12px 0;
  box-sizing: border-box;
  filter: drop-shadow(0 22px 34px rgba(17, 24, 39, 0.3));
}

.library-avatar-card.my-avatar-card::before {
  content: none;
}

.library-avatar-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0), rgba(17, 24, 39, 0.72));
}

.library-avatar-card > span {
  position: absolute;
  z-index: 1;
  right: 14px;
  bottom: 14px;
  left: 14px;
}

.library-avatar-card > .avatar-model-preview,
.avatar-card .avatar-model-preview,
.my-avatar-card .avatar-model-preview {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 22px;
  color: #ffffff;
  text-align: center;
  background:
    radial-gradient(circle at 44% 34%, rgba(255, 255, 255, 0.28), transparent 30%),
    linear-gradient(145deg, #172033, #38415e 54%, #4c4ee5);
}

.library-avatar-card > .avatar-model-preview.has-ply-preview,
.avatar-card .avatar-model-preview.has-ply-preview,
.my-avatar-card .avatar-model-preview.has-ply-preview {
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(45deg, rgba(238, 242, 255, 0.86) 25%, transparent 25% 75%, rgba(238, 242, 255, 0.86) 75%),
    linear-gradient(45deg, rgba(238, 242, 255, 0.86) 25%, transparent 25% 75%, rgba(238, 242, 255, 0.86) 75%),
    #ffffff;
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}

.library-avatar-card > .avatar-model-preview::before,
.avatar-card .avatar-model-preview::before,
.my-avatar-card .avatar-model-preview::before {
  content: "";
  width: 86px;
  height: 112px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px 999px 28px 28px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.82) 0 12px, transparent 13px),
    rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.library-avatar-card > .avatar-model-preview.has-ply-preview::before,
.avatar-card .avatar-model-preview.has-ply-preview::before,
.my-avatar-card .avatar-model-preview.has-ply-preview::before {
  display: none;
}

.avatar-model-preview .ply-model-canvas,
.builder-model-preview .ply-model-canvas,
.preset-avatar.has-ply-preview .ply-model-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.avatar-model-preview .model-preview-label,
.builder-model-preview .model-preview-label,
.preset-avatar .model-preview-label {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(10, 17, 33, 0.72);
  box-shadow: 0 12px 28px rgba(4, 8, 18, 0.22);
  backdrop-filter: blur(12px);
}

.library-avatar-card > .avatar-model-preview b,
.avatar-card .avatar-model-preview b,
.my-avatar-card .avatar-model-preview b {
  display: inline-grid;
  min-width: 56px;
  min-height: 32px;
  place-items: center;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 950;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
}

.library-avatar-card > .avatar-model-preview small,
.avatar-card .avatar-model-preview small,
.my-avatar-card .avatar-model-preview small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 850;
}

.avatar-model-preview .model-preview-label b,
.builder-model-preview .model-preview-label b,
.preset-avatar .model-preview-label b {
  min-width: 38px;
  min-height: 24px;
  font-size: 13px;
}

.avatar-model-preview .model-preview-label small,
.builder-model-preview .model-preview-label small,
.preset-avatar .model-preview-label small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 850;
}

.avatar-model-preview.is-error,
.builder-model-preview.is-error,
.preset-avatar.has-ply-preview.is-error {
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(238, 242, 255, 0.96));
}

.avatar-model-preview.is-error::after,
.builder-model-preview.is-error::after,
.preset-avatar.has-ply-preview.is-error::after {
  content: "系统真3D模型文件未入库";
  position: absolute;
  inset: auto 14px 14px;
  z-index: 2;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  color: #4b5270;
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.avatar-model-preview.is-error .model-preview-label,
.builder-model-preview.is-error .model-preview-label,
.preset-avatar.has-ply-preview.is-error .model-preview-label {
  background: rgba(239, 68, 68, 0.9);
}

.library-avatar-card .asset-card-delete {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.library-avatar-card:hover .asset-card-delete,
.library-avatar-card:focus-within .asset-card-delete {
  opacity: 1;
}

.library-avatar-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 900;
}

.library-avatar-card small {
  display: block;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

.library-avatar-card .asset-owner {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
}

.my-avatar-card > span {
  right: 64px;
}

.avatar-card-actions {
  position: absolute;
  z-index: 5;
  right: 12px;
  bottom: 12px;
}

.avatar-menu-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(20, 22, 46, 0.18);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
}

.avatar-menu-button:hover,
.avatar-menu-button[aria-expanded="true"] {
  color: #ffffff;
  background: var(--accent);
}

.avatar-card-menu {
  position: absolute;
  right: 0;
  bottom: 52px;
  width: 148px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(24, 27, 55, 0.22);
}

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

.avatar-card-menu button {
  min-height: 38px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.avatar-card-menu button:hover {
  background: var(--accent-soft);
}

.avatar-card-menu button.danger {
  color: #d83535;
}

.avatar-card-menu span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: currentColor;
  background: var(--soft);
}

.avatar-preview-modal {
  position: relative;
  width: min(860px, calc(100vw - 40px));
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 22px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(23, 25, 52, 0.24);
}

.avatar-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-right: 52px;
}

.avatar-preview-head h2 {
  font-size: 26px;
  line-height: 1.15;
}

.avatar-preview-head p {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.avatar-preview-stage {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(76, 78, 229, 0.1), transparent 34%),
    #f7f8ff;
}

.avatar-preview-stage video,
.avatar-preview-stage img {
  width: 100%;
  max-height: min(62vh, 620px);
  display: block;
  object-fit: contain;
  background: #0f172a;
}

.avatar-preview-stage img {
  max-width: 520px;
  background: transparent;
}

.avatar-preview-empty {
  position: absolute;
  inset: auto 22px 22px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(37, 39, 72, 0.08);
}

.avatar-preview-empty small,
.avatar-preview-script {
  color: var(--muted);
  font-weight: 760;
}

.avatar-preview-script {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  line-height: 1.7;
}

.library-mine-avatars {
  display: grid;
  gap: 24px;
}

.library-mine-avatars h2 {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--text);
  font-size: 20px;
}

.library-mine-avatars h2 small {
  color: var(--muted);
  font-size: 13px;
}

.library-create-avatar {
  width: 248px;
  height: 330px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  color: var(--accent);
  background: #f5f6ff;
  font-size: 18px;
}

.library-create-avatar span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

.library-my-avatar-grid {
  min-height: 270px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.library-avatar-empty {
  grid-column: 1 / -1;
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--text);
  text-align: center;
}

.library-avatar-empty span {
  width: 92px;
  height: 74px;
  display: block;
  border: 1px solid #cdd3f1;
  border-radius: 42% 42% 16% 16%;
  transform: rotate(-18deg);
  box-shadow: 32px -38px 0 -28px #ffffff, 35px -38px 0 -27px #cdd3f1;
}

.library-voice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 20px;
}

.library-voice-card {
  position: relative;
  overflow: visible;
  min-height: 98px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 30px;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.library-voice-card:hover,
.library-voice-card:focus-visible,
.library-voice-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.library-voice-card.menu-open {
  z-index: 8;
}

.library-voice-card.previewing {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 12px 24px rgba(76, 78, 229, 0.12);
}

.library-voice-card.previewing .voice-dot b {
  animation: voicePulse 1s ease-in-out infinite;
}

.library-voice-card .voice-dot {
  position: relative;
  display: inline-grid;
  place-items: end;
}

.library-voice-card .voice-dot b {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  margin: 0 -2px -2px 0;
  border-radius: 50%;
  color: #ffffff;
  background: #15172f;
  font-size: 9px;
  line-height: 1;
}

.library-voice-card strong {
  display: block;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.library-voice-card small {
  color: var(--muted);
  font-size: 13px;
}

.library-voice-card strong small {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--soft);
}

.voice-card-actions {
  position: relative;
  justify-self: end;
}

.voice-menu-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  font-weight: 900;
}

.voice-menu-button:hover,
.voice-menu-button[aria-expanded="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.voice-card-menu {
  position: absolute;
  z-index: 20;
  top: 34px;
  right: 0;
  width: 148px;
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(37, 39, 72, 0.16);
}

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

.voice-card-menu button {
  min-height: 38px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 0 12px;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.voice-card-menu button[data-voice-action="delete"] {
  color: #d83535;
}

.voice-card-menu button:hover {
  background: var(--accent-soft);
}

.voice-card-menu button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.voice-card-menu span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: currentColor;
  background: var(--soft);
}

@keyframes voicePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

#libraryVoiceTabs {
  gap: 10px;
}

#libraryVoiceTabs button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

#libraryVoiceTabs button .tab-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #6d7289;
  background: #f4f5fb;
  font-size: 13px;
  line-height: 1;
}

#libraryVoiceTabs button.active {
  color: var(--accent);
  border-color: rgba(76, 78, 229, 0.18);
  background: #f2f1ff;
  box-shadow: inset 0 0 0 1px rgba(76, 78, 229, 0.12);
}

#libraryVoiceTabs button.active .tab-icon {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(76, 78, 229, 0.22);
}

.voice-compose-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(1180px, 100%);
  margin-top: 18px;
  padding: 16px 20px 12px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(76, 78, 229, 0.08), transparent 32%),
    linear-gradient(180deg, #ffffff, #fbfbff);
  box-shadow: 0 22px 52px rgba(37, 39, 72, 0.08);
}

.voice-compose-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(76, 78, 229, 0.15), rgba(70, 185, 255, 0.44), rgba(76, 78, 229, 0.12));
  background-size: 220% 220%;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: composeGlowSweep 5s ease-in-out infinite;
}

.voice-compose-panel::after {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(76, 78, 229, 0.22), rgba(70, 185, 255, 0.38), transparent);
  animation: composeScanLine 3.8s ease-in-out infinite;
  pointer-events: none;
}

.voice-library-page.compose-tab .voice-compose-panel {
  width: min(1680px, 100%);
  margin-top: 0;
}

.voice-compose-panel[hidden] {
  display: none;
}

.voice-material-panel {
  margin-top: 0;
}

.voice-material-panel[hidden] {
  display: none;
}

.voice-material-workbench {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.voice-material-editor,
.voice-material-list-wrap {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 8% 10%, rgba(76, 78, 229, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #fbfbff);
  box-shadow: 0 18px 44px rgba(37, 39, 72, 0.07);
}

.voice-material-headline,
.voice-material-list-head,
.voice-material-meta,
.voice-material-actions,
.voice-material-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-material-headline {
  margin-bottom: 14px;
}

.voice-material-headline h2,
.voice-material-list-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}

.voice-material-headline p,
.voice-material-list-head small,
.voice-material-actions small,
.voice-material-info small {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

.voice-material-icon,
.voice-material-badge {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #5a55f6, #45b8ff);
  box-shadow: 0 14px 24px rgba(76, 78, 229, 0.2);
}

.voice-material-drop {
  min-height: 126px;
  display: grid;
  place-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 18px;
  text-align: center;
  border: 1px dashed rgba(76, 78, 229, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(245, 244, 255, 0.92), rgba(255, 255, 255, 0.94)),
    repeating-linear-gradient(90deg, rgba(76, 78, 229, 0.04) 0 1px, transparent 1px 22px);
  cursor: pointer;
}

.voice-material-drop.drag-over {
  border-color: var(--accent);
  background: #f4f3ff;
}

.voice-material-drop strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

.voice-material-drop small {
  max-width: 560px;
  color: var(--muted);
  font-weight: 760;
}

.voice-material-current {
  display: grid;
  gap: 12px;
}

.voice-material-current[hidden] {
  display: none;
}

.voice-material-meta {
  align-items: end;
}

.voice-material-meta label {
  flex: 1 1 auto;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.voice-material-meta input,
.voice-material-trim input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font-weight: 900;
}

.voice-material-meta input {
  padding: 0 12px;
}

.voice-material-meta strong {
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--accent);
  background: #f4f3ff;
  font-size: 13px;
}

.voice-material-current audio {
  width: 100%;
}

.voice-material-trim {
  display: grid;
  grid-template-columns: 130px 130px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.voice-material-trim label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.voice-material-trim input[type="number"] {
  padding: 0 10px;
}

.voice-material-ranges {
  display: grid;
  gap: 4px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.voice-material-ranges input {
  min-height: 14px;
  accent-color: var(--accent);
}

.voice-material-actions {
  flex-wrap: wrap;
}

.voice-material-actions button,
.voice-material-card-actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 900;
}

.voice-material-actions small {
  flex: 1 1 260px;
}

.voice-material-list-wrap {
  min-height: 460px;
}

.voice-material-list-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.voice-material-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 39, 72, 0.05);
}

.voice-material-badge {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.voice-material-info {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}

.voice-material-info strong,
.voice-material-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-material-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.voice-material-card-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(76, 78, 229, 0.14);
  color: var(--accent);
  background: #f4f3ff;
}

.voice-material-empty {
  min-height: 260px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed rgba(76, 78, 229, 0.18);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbff;
}

.voice-material-empty small {
  color: var(--muted);
  font-weight: 760;
}

.voice-material-panel.material-busy .voice-material-icon {
  animation: voicePulse 1s ease-in-out infinite;
}

.voice-training-panel {
  width: min(1500px, 100%);
  display: grid;
  gap: 14px;
}

.voice-training-panel[hidden] {
  display: none;
}

.voice-training-hero,
.voice-training-insight,
.voice-training-list-head,
.voice-training-group,
.voice-training-card {
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 8% 8%, rgba(76, 78, 229, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff, #fbfbff);
  box-shadow: 0 16px 38px rgba(37, 39, 72, 0.06);
}

.voice-training-hero {
  min-height: 108px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.voice-training-hero h2,
.voice-training-list-head h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 24px;
}

.voice-training-hero p,
.voice-training-list-head small,
.voice-training-card small,
.voice-training-card p,
.voice-training-insight small {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
  line-height: 1.55;
}

.voice-training-insight {
  min-height: 66px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}

.voice-training-insight span,
.voice-training-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  font-size: 13px;
  font-weight: 950;
}

.voice-training-insight strong {
  color: var(--text);
  font-size: 16px;
}

.voice-training-list-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
}

.voice-training-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.voice-training-group {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.voice-training-group.selected {
  border-color: rgba(76, 78, 229, 0.5);
  box-shadow: 0 18px 42px rgba(76, 78, 229, 0.12);
}

.voice-training-group-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.voice-training-group-head strong {
  display: block;
  color: var(--text);
  font-size: 20px;
}

.voice-training-group-head small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.voice-training-group-head button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(76, 78, 229, 0.18);
  border-radius: 8px;
  color: var(--accent);
  background: #f6f5ff;
  font-weight: 950;
}

.voice-training-group-head button:hover {
  color: #ffffff;
  background: var(--accent);
}

.voice-training-assets {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 10px;
}

.voice-training-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.voice-training-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.voice-training-main strong {
  display: block;
  color: var(--text);
  font-size: 17px;
}

.voice-training-main small,
.voice-training-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.voice-training-main small {
  -webkit-line-clamp: 1;
}

.voice-training-card p {
  min-height: 48px;
  -webkit-line-clamp: 2;
}

.voice-training-tags,
.voice-training-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voice-training-tags span {
  min-height: 24px;
  color: var(--accent);
  background: #f2f1ff;
  font-size: 12px;
}

.voice-training-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  color: var(--accent);
  background: #f4f3ff;
  font-weight: 900;
}

.voice-training-actions button:hover {
  color: #ffffff;
  background: var(--accent);
}

.voice-training-actions button[data-training-action="delete"] {
  color: #d83535;
  background: #fff7f7;
}

.voice-training-empty {
  grid-column: 1 / -1;
  min-height: 260px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed rgba(76, 78, 229, 0.18);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbff;
}

.voice-training-empty small {
  color: var(--muted);
  font-weight: 760;
}

.voice-training-empty-inline {
  min-height: 112px;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  border: 1px dashed rgba(76, 78, 229, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(246, 245, 255, 0.72);
}

.voice-training-empty-inline small {
  color: var(--muted);
  font-weight: 800;
}

.voice-detail-panel {
  display: grid;
  gap: 16px;
}

.voice-detail-panel[hidden] {
  display: none;
}

.voice-detail-hero,
.voice-detail-card {
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(76, 78, 229, 0.08), transparent 38%),
    #ffffff;
  box-shadow: 0 18px 38px rgba(37, 39, 72, 0.06);
}

.voice-detail-hero {
  display: grid;
  grid-template-columns: auto 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.voice-detail-back {
  min-height: 38px;
}

.voice-detail-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.voice-detail-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.15;
}

.voice-detail-title h2 small {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-left: 6px;
  padding: 0 10px;
  border-radius: 999px;
  color: #4c4ee5;
  background: #f0efff;
  font-size: 13px;
}

.voice-detail-title p,
.voice-detail-card-head small,
.voice-detail-sample small,
.voice-detail-sample p,
.voice-detail-empty small,
.voice-detail-event-list small {
  color: var(--muted);
  font-weight: 760;
  line-height: 1.45;
}

.voice-detail-title p {
  margin: 0;
}

.voice-detail-actions,
.voice-detail-sample-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-detail-actions button {
  min-height: 38px;
}

.voice-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.voice-detail-stats span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background: #fbfbff;
}

.voice-detail-stats b {
  color: var(--accent);
  font-size: 24px;
}

.voice-detail-stats small {
  color: var(--muted);
  font-weight: 860;
}

.voice-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.voice-detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.voice-detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.voice-detail-card-head strong {
  color: var(--text);
  font-size: 18px;
}

.voice-detail-sample {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.voice-detail-sample.primary-sample {
  border-color: rgba(76, 78, 229, 0.22);
  background: linear-gradient(180deg, #ffffff, #f8f8ff);
}

.voice-detail-sample strong,
.voice-detail-sample small,
.voice-detail-sample p {
  display: block;
  min-width: 0;
}

.voice-detail-sample strong {
  color: var(--text);
}

.voice-detail-sample p {
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-detail-sample button,
.voice-detail-event-list span {
  min-height: 32px;
}

.voice-detail-event-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.voice-detail-event-list span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px dashed rgba(76, 78, 229, 0.18);
  border-radius: 8px;
  background: #ffffff;
}

.voice-detail-event-list span.ready {
  border-style: solid;
  border-color: rgba(47, 198, 143, 0.28);
  background: #f7fffb;
}

.voice-detail-event-list b {
  color: var(--text);
  font-size: 13px;
}

.voice-detail-training-list {
  display: grid;
  gap: 10px;
}

.voice-detail-empty {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px dashed rgba(76, 78, 229, 0.18);
  border-radius: 8px;
  background: #fbfbff;
}

@media (max-width: 980px) {
  .voice-detail-hero,
  .voice-detail-grid,
  .voice-detail-stats {
    grid-template-columns: 1fr;
  }

  .voice-detail-hero .voice-dot {
    grid-row: 2;
  }

  .voice-detail-actions,
  .voice-detail-sample-actions {
    justify-content: stretch;
  }

  .voice-detail-actions button,
  .voice-detail-sample-actions button {
    flex: 1 1 140px;
  }

  .voice-detail-sample {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .voice-detail-sample-actions {
    grid-column: 1 / -1;
  }
}

.voice-convert-panel {
  width: min(1380px, 100%);
  margin-top: 0;
  display: grid;
  gap: 14px;
}

.voice-convert-panel[hidden] {
  display: none;
}

.voice-convert-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 8%, rgba(76, 78, 229, 0.1), transparent 32%),
    linear-gradient(180deg, #ffffff, #fbfbff);
  box-shadow: 0 18px 44px rgba(37, 39, 72, 0.07);
}

.voice-convert-hero,
.voice-convert-title,
.voice-convert-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-convert-hero {
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.voice-convert-hero::after {
  content: "";
  position: absolute;
  inset: -40% -18%;
  z-index: -1;
  background:
    conic-gradient(from 120deg at 76% 40%, rgba(70, 185, 255, 0.22), transparent, rgba(76, 78, 229, 0.18), transparent),
    linear-gradient(90deg, transparent, rgba(76, 78, 229, 0.08), transparent);
  animation: voiceConvertAura 7s linear infinite;
}

.voice-convert-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, #5a55f6, #45b8ff);
  box-shadow: 0 16px 26px rgba(76, 78, 229, 0.22);
  font-size: 26px;
  font-weight: 950;
}

.voice-convert-hero h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 26px;
}

.voice-convert-hero p,
.voice-convert-card small,
.voice-convert-actions span {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

.voice-convert-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(460px, 1.28fr);
  gap: 14px;
}

.voice-convert-title {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

.voice-convert-title span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 10px 20px rgba(76, 78, 229, 0.2);
}

.voice-convert-title small {
  margin-left: auto;
  color: var(--accent);
  font-size: 14px;
}

.voice-convert-selected {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: #f7f6ff;
  font-size: 18px;
  font-weight: 950;
}

.voice-convert-material-picker {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.voice-convert-material-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
}

.voice-convert-material-head small,
.voice-convert-material-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.voice-convert-material-empty {
  padding: 10px 12px;
  border: 1px dashed rgba(76, 78, 229, 0.18);
  border-radius: 8px;
  background: #fbfbff;
}

.voice-convert-material-list {
  display: grid;
  gap: 8px;
  max-height: 156px;
  overflow: auto;
  padding-right: 2px;
}

.voice-convert-material-item {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.voice-convert-material-item.selected {
  border-color: var(--accent);
  background: #f4f3ff;
  box-shadow: inset 0 0 0 1px rgba(76, 78, 229, 0.22);
}

.voice-convert-material-item span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #5a55f6, #45b8ff);
  font-size: 12px;
  font-weight: 950;
}

.voice-convert-material-item strong,
.voice-convert-material-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-convert-material-item strong {
  font-size: 13px;
  font-weight: 950;
}

.voice-convert-drop {
  min-height: 104px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  border: 1px dashed rgba(76, 78, 229, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(245, 244, 255, 0.94), rgba(255, 255, 255, 0.94)),
    repeating-linear-gradient(90deg, rgba(76, 78, 229, 0.04) 0 1px, transparent 1px 22px);
  cursor: pointer;
}

.voice-convert-drop.drag-over {
  border-color: var(--accent);
  background: #f4f3ff;
}

.voice-convert-drop b {
  color: var(--text);
  font-size: 18px;
}

.voice-convert-card audio {
  width: 100%;
  margin-top: 10px;
}

.voice-convert-script-card textarea {
  min-height: 150px;
  resize: vertical;
  background: #ffffff;
}

.voice-convert-actions {
  flex-wrap: wrap;
  margin-top: 12px;
}

.voice-convert-generate {
  min-width: 132px;
  position: relative;
  overflow: hidden;
}

.voice-convert-generate.generating {
  padding-left: 42px;
}

.voice-convert-generate.generating::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: voiceConvertSpin 0.8s linear infinite;
}

.voice-convert-download {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 900;
}

@keyframes voiceConvertAura {
  to {
    transform: rotate(1turn);
  }
}

@keyframes voiceConvertSpin {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 1180px) {
  .voice-material-workbench {
    grid-template-columns: 1fr;
  }

  .voice-material-list {
    grid-template-columns: 1fr;
  }

  .voice-convert-grid {
    grid-template-columns: 1fr;
  }
}

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

.voice-compose-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.voice-compose-heading > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.compose-title-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  box-shadow: 0 14px 28px rgba(76, 78, 229, 0.22);
  font-size: 22px;
  font-weight: 900;
  animation: composeIconFloat 2.6s ease-in-out infinite;
}

.voice-compose-head h2 {
  margin: 0;
  font-size: 23px;
}

.voice-compose-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.current-voice-badge {
  max-width: min(520px, 46vw);
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(76, 78, 229, 0.18);
  border-radius: 999px;
  color: #4c4ee5;
  background:
    radial-gradient(circle at 12% 50%, rgba(70, 185, 255, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(76, 78, 229, 0.1), rgba(255, 255, 255, 0.92));
  box-shadow: 0 10px 22px rgba(76, 78, 229, 0.12);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-voice-badge::before {
  content: "♪";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  font-size: 11px;
  box-shadow: 0 8px 16px rgba(76, 78, 229, 0.18);
}

.current-voice-badge.empty {
  color: var(--muted);
  background: rgba(246, 247, 255, 0.9);
}

.voice-compose-head p,
.voice-compose-actions small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.voice-compose-head > .secondary {
  min-width: 126px;
  min-height: 42px;
  border-radius: 8px;
  color: #4c4ee5;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(76, 78, 229, 0.08);
}

.voice-compose-panel textarea {
  height: clamp(98px, 15vh, 126px);
  min-height: 98px;
  resize: none;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(76, 78, 229, 0.04);
}

.voice-pronunciation-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(76, 78, 229, 0.22);
  border-radius: 8px;
  background: #ffffff;
}

.voice-pronunciation-box strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 15px;
}

.voice-pronunciation-box small {
  color: var(--muted);
  font-weight: 760;
}

.voice-pronunciation-box textarea {
  min-height: 82px;
  font-size: 14px;
}

.voice-humanize-panel {
  position: relative;
  overflow: visible;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(70, 185, 255, 0.07), transparent 36%),
    #ffffff;
}

.voice-humanize-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 36px, rgba(76, 78, 229, 0.03) 36px 37px);
  opacity: 0.7;
  pointer-events: none;
}

.voice-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1.24fr) minmax(0, 1.08fr) minmax(0, 0.98fr);
  gap: 10px;
}

.voice-control-grid label,
.voice-speed-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.voice-control-grid label {
  position: relative;
  padding: 8px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 22px rgba(37, 39, 72, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.voice-control-grid label:hover {
  transform: translateY(-2px);
  border-color: rgba(76, 78, 229, 0.28);
  box-shadow: 0 14px 28px rgba(76, 78, 229, 0.11);
}

.voice-control-grid label > span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.1;
}

.voice-control-grid label > span::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #4c4ee5;
  box-shadow: 0 0 0 5px rgba(76, 78, 229, 0.09), 0 8px 16px rgba(76, 78, 229, 0.14);
}

.voice-control-grid label:nth-child(1) > span::before {
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
}

.voice-control-grid label:nth-child(2) > span::before {
  background: linear-gradient(135deg, #ff7ca8, #7d7cff);
}

.voice-control-grid label:nth-child(3) > span::before {
  background: linear-gradient(135deg, #7c80ff, #20c5b5);
}

.voice-control-grid label:nth-child(4) > span::before {
  background: linear-gradient(135deg, #22c55e, #60a5fa);
}

.voice-control-grid select {
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 0 34px 0 10px;
  line-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbff;
  background-image:
    linear-gradient(45deg, transparent 50%, #5f647c 50%),
    linear-gradient(135deg, #5f647c 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 16px,
    calc(100% - 10px) 16px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  font-weight: 900;
}

.voice-control-grid select.voice-segment-source,
.voice-rule-form select.voice-segment-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.voice-option-pills {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.voice-option-pill {
  flex: 1 1 82px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 0.16s ease, color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.voice-control-grid label:nth-child(3) .voice-option-pill,
.voice-control-grid label:nth-child(4) .voice-option-pill {
  flex-basis: 74px;
}

.voice-option-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(76, 78, 229, 0.26);
  box-shadow: 0 8px 18px rgba(76, 78, 229, 0.1);
}

.voice-option-pill.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #4c4ee5, #7376ff);
  box-shadow: 0 10px 20px rgba(76, 78, 229, 0.2);
}

.voice-option-pill.active::before {
  content: "✓";
  margin-right: 4px;
}

.voice-rule-mode-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voice-rule-mode-pills .voice-option-pill {
  flex: none;
  min-width: 0;
}

.voice-speed-control {
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  position: relative;
  padding: 8px 10px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.voice-speed-control b {
  color: var(--accent);
}

.voice-speed-control input {
  accent-color: var(--accent);
}

.voice-control-summary {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  color: #555be7;
  background: linear-gradient(135deg, rgba(76, 78, 229, 0.08), rgba(70, 185, 255, 0.08));
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.voice-mark-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(260px, 0.72fr) minmax(300px, 0.82fr);
  align-items: start;
  gap: 10px;
}

.voice-mark-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px 12px 12px 52px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(76, 78, 229, 0.08), transparent 38%),
    #fbfbff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.voice-mark-card::before {
  content: attr(data-icon);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  box-shadow: 0 12px 22px rgba(76, 78, 229, 0.18);
  font-size: 15px;
  font-weight: 900;
}

.voice-mark-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(76, 78, 229, 0.34), transparent);
  transform: translateX(-100%);
  transition: transform 0.45s ease;
}

.voice-mark-card:hover {
  transform: translateY(-2px);
  border-color: rgba(76, 78, 229, 0.24);
  box-shadow: 0 16px 34px rgba(37, 39, 72, 0.08);
}

.voice-mark-card:hover::after {
  transform: translateX(100%);
}

.voice-mark-title {
  display: grid;
  gap: 4px;
}

.voice-mark-title strong {
  color: var(--text);
  font-size: 14px;
}

.voice-mark-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.36;
}

.voice-rule-form {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(190px, 0.72fr);
  gap: 6px;
  align-items: stretch;
}

.voice-rule-form > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.voice-rule-form input,
.voice-rule-form select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 860;
}

.voice-rule-form input {
  padding: 0 10px;
}

.voice-rule-form select {
  padding: 0 30px 0 10px;
}

.voice-rule-form .custom-select-button {
  height: 32px;
  min-height: 32px;
  padding-left: 10px;
  font-weight: 860;
}

.voice-rule-form button {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.voice-rule-form .secondary {
  grid-column: 1 / 3;
  width: 100%;
}

.voice-rule-form .primary {
  grid-column: 3 / 4;
  width: 100%;
}

.voice-rule-mode-pills {
  gap: 6px;
  width: 100%;
}

.voice-rule-mode-pills .voice-option-pill {
  height: 32px;
  min-width: 0;
  min-height: 32px;
  width: 100%;
  padding: 0 6px;
  overflow: visible;
  text-overflow: clip;
  font-size: 11px;
}

.voice-rule-mode-pills .voice-option-pill.active::before {
  margin-right: 3px;
}

.voice-rule-list {
  display: grid;
  gap: 8px;
  min-height: 34px;
}

.voice-rule-list > span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.voice-rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.voice-rule-item span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  color: var(--text);
}

.voice-rule-item b,
.voice-rule-item strong {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.voice-rule-item em {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--accent);
  background: #f2f1ff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.voice-rule-item button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 8px;
  color: #ef4444;
  background: #fff7f7;
  font-size: 12px;
  font-weight: 900;
}

.voice-cue-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.voice-cue-row span {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.voice-cue-row button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 999px;
  color: var(--accent);
  background: #f5f4ff;
  font-size: 13px;
  font-weight: 900;
}

.voice-cue-row button:hover {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 10px 20px rgba(76, 78, 229, 0.18);
  transform: translateY(-1px);
}

.voice-preview-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-weight: 760;
}

.voice-reading-loop {
  width: 176px;
  min-height: 40px;
  flex: 0 0 176px;
  display: inline-grid;
  grid-template-columns: auto 64px auto;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.voice-reading-loop input {
  width: 64px;
  height: 32px;
  min-height: 32px;
  padding: 0 4px 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbff;
  font: inherit;
  text-align: center;
}

.voice-reading-loop input:focus {
  border-color: rgba(76, 78, 229, 0.56);
  outline: 2px solid rgba(76, 78, 229, 0.12);
  outline-offset: 1px;
}

.voice-reading-loop > span:first-of-type {
  grid-column: 1;
  grid-row: 1;
}

.voice-reading-loop > input {
  grid-column: 2;
  grid-row: 1;
}

.voice-reading-loop > span:last-of-type {
  grid-column: 3;
  grid-row: 1;
}

#voicePreviewStatus {
  min-width: 0;
  flex: 1 1 280px;
}

.voice-generate-toggle {
  min-width: 118px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.voice-generate-toggle:not(.generating)::before {
  content: "▶";
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
  transform: translateX(1px);
}

.voice-generate-toggle.generating {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.28);
  background: #fff7f7;
}

.voice-generate-toggle.generating::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(239, 68, 68, 0.22);
  border-top-color: #ef4444;
  border-radius: 50%;
  animation: cloneSpin 0.8s linear infinite;
}

.voice-generate-toggle.generating:hover {
  color: #ffffff;
  background: var(--danger);
}

.voice-generate-toggle.generating:hover::before {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

#voiceLibraryFillButton,
#voicePreviewDownload,
#voiceLibraryCreateVideoButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#voiceLibraryFillButton::before {
  content: "♬";
  color: var(--accent);
}

#voiceLibraryCreateVideoButton::before {
  content: "▶";
  font-size: 12px;
}

#voicePreviewDownload {
  text-decoration: none;
  min-height: 40px;
}

#voicePreviewDownload::before {
  content: "↓";
  font-size: 15px;
  font-weight: 1000;
}

@keyframes composeGlowSweep {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes composeScanLine {
  0%,
  100% {
    transform: translateX(-18%);
    opacity: 0.25;
  }
  50% {
    transform: translateX(18%);
    opacity: 1;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .voice-compose-panel::before,
  .voice-compose-panel::after,
  .compose-title-icon,
  .voice-generate-toggle.generating::before {
    animation: none;
  }
}

.danger-soft {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.24);
  background: #fff7f7;
}

.danger-soft:hover:not(:disabled) {
  color: #ffffff;
  background: var(--danger);
}

.voice-wave-player {
  min-height: 68px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 50%, rgba(103, 232, 249, 0.18), transparent 30%),
    linear-gradient(135deg, #ffffff, #f6f7ff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.voice-wave-player[hidden] {
  display: none;
}

.voice-wave-play {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  box-shadow: 0 12px 26px rgba(76, 78, 229, 0.22);
  font-size: 15px;
  font-weight: 900;
}

.voice-wave-track {
  --progress: 0%;
  position: relative;
  height: 48px;
  overflow: hidden;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(238, 240, 251, 0.82);
}

.voice-wave-track::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(76, 78, 229, 0.26), rgba(70, 185, 255, 0.42));
  box-shadow: 0 0 24px rgba(70, 185, 255, 0.18);
  transition: width 0.12s linear;
}

.voice-wave-track::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: var(--progress);
  width: 3px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 14px rgba(76, 78, 229, 0.36);
  transform: translateX(-1px);
}

.voice-wave-bars {
  position: absolute;
  inset: 0 12px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.voice-wave-bars span {
  flex: 1;
  height: var(--bar-height, 18px);
  border-radius: 999px;
  background: linear-gradient(180deg, #4c4ee5, #46b9ff);
  opacity: 0.44;
  transform-origin: center;
  animation: voiceWavePulse 1.05s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  animation-play-state: paused;
}

.voice-wave-player.is-playing .voice-wave-bars span {
  animation-play-state: running;
}

.voice-wave-time {
  min-width: 88px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

@keyframes voiceWavePulse {
  0%,
  100% {
    transform: scaleY(0.74);
    opacity: 0.38;
  }

  50% {
    transform: scaleY(1.08);
    opacity: 0.86;
  }
}

.voice-select-modal {
  position: relative;
  width: min(820px, calc(100vw - 40px));
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 22px;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
}

.voice-select-modal .modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.voice-select-head h2 {
  margin: 0;
  font-size: 24px;
}

.voice-select-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.voice-select-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-weight: 900;
}

.voice-select-tabs button.active {
  color: var(--accent);
  background: #f1f0ff;
}

.voice-select-grid {
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.voice-select-grid .library-voice-card {
  min-height: 78px;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
}

.voice-select-grid .library-voice-card strong {
  margin-bottom: 3px;
  font-size: 16px;
}

.voice-select-grid .library-voice-card small {
  font-size: 12px;
}

.voice-select-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--text);
  text-align: center;
}

.voice-select-empty small {
  color: var(--muted);
  font-weight: 760;
}

.voice-action-modal,
.voice-event-modal {
  position: relative;
  width: min(520px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 0%, rgba(76, 78, 229, 0.14), transparent 34%),
    linear-gradient(180deg, #ffffff, #fbfbff);
  box-shadow: 0 28px 80px rgba(23, 25, 52, 0.22);
}

.voice-event-modal {
  width: min(760px, calc(100vw - 40px));
}

.voice-action-modal .modal-close,
.voice-event-modal .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.voice-action-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  box-shadow: 0 14px 28px rgba(76, 78, 229, 0.22);
  font-size: 22px;
  font-weight: 900;
}

.voice-action-modal h2,
.voice-event-modal h2 {
  margin: 0;
  padding-right: 42px;
  color: var(--text);
  font-size: 25px;
}

.voice-action-modal p,
.voice-event-modal p {
  margin: -6px 0 0;
  color: var(--muted);
  font-weight: 780;
  line-height: 1.6;
}

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

.voice-action-options button {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border-radius: 10px;
  text-align: left;
}

.voice-action-options strong {
  font-size: 18px;
}

.voice-action-options small {
  color: inherit;
  opacity: 0.78;
  font-weight: 780;
  line-height: 1.45;
}

.voice-event-grid {
  display: grid;
  gap: 10px;
}

.voice-event-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  background: #ffffff;
}

.voice-event-row.ready {
  border-color: rgba(47, 198, 143, 0.32);
  background: linear-gradient(180deg, #ffffff, #f7fffb);
}

.voice-event-row strong,
.voice-event-row small {
  display: block;
}

.voice-event-row small,
#voiceEventStatus {
  color: var(--muted);
  font-weight: 760;
  line-height: 1.45;
}

.voice-event-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-event-actions button {
  min-width: 66px;
}

@media (max-width: 720px) {
  .voice-action-options {
    grid-template-columns: 1fr;
  }

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

  .voice-event-actions {
    justify-content: stretch;
  }

  .voice-event-actions button {
    flex: 1;
  }
}

.avatar-picker-modal {
  position: relative;
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  padding: 24px;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
}

.avatar-picker-modal .modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.avatar-picker-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 42px;
}

.avatar-picker-head h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.avatar-picker-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

.avatar-picker-tabs {
  display: flex;
  gap: 10px;
}

.avatar-picker-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-weight: 900;
}

.avatar-picker-tabs button.active {
  color: var(--accent);
  background: #f1f0ff;
}

.avatar-picker-grid {
  min-height: 360px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.avatar-picker-card {
  min-height: 224px;
}

.avatar-picker-empty {
  grid-column: 1 / -1;
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
  text-align: center;
}

.avatar-picker-empty small {
  max-width: 420px;
  color: var(--muted);
  font-weight: 760;
}

.library-empty {
  grid-column: 1 / -1;
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-soft);
  text-align: center;
}

.library-empty strong {
  color: var(--text);
  font-size: 18px;
}

.user-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 160px auto;
  gap: 14px;
  align-items: end;
  margin: 28px 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.user-create-form label {
  display: grid;
  grid-template-rows: 22px 42px;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
  text-align: left;
}

.user-create-form label > span {
  display: flex;
  align-items: center;
  height: 22px;
  white-space: nowrap;
}

.user-create-form input,
.user-create-form .custom-select-shell {
  height: 42px;
  min-height: 42px;
}

.user-create-form .custom-select-button {
  height: 42px;
  min-height: 42px;
}

.users-table .custom-select-button {
  height: 38px;
  min-height: 38px;
}

.user-create-form > button {
  height: 42px;
  min-height: 42px;
  align-self: end;
}

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

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

.users-table th,
.users-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.users-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.users-table td {
  font-weight: 760;
}

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

.users-table .inline-actions {
  display: flex;
  gap: 8px;
}

.users-table input[type="password"] {
  width: 160px;
}

.system-page {
  padding: 18px 96px 34px 24px;
}

.system-page .library-topbar {
  align-items: flex-start;
}

.system-page .library-topbar h1 {
  font-size: 24px;
}

.system-page .library-topbar p {
  margin-top: 2px;
  font-size: 13px;
}

.system-page .library-topbar .secondary {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.system-toolbar {
  margin: 14px 0 14px;
}

.system-page .library-tabs {
  gap: 20px;
}

.system-page .library-tabs button {
  min-height: 30px;
  font-size: 16px;
}

.system-status-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.voice-lab-layout {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.voice-lab-panel,
.voice-lab-result {
  min-width: 0;
}

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

.voice-lab-guardrails {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.voice-lab-guardrails span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background: #fbfbff;
}

.voice-lab-guardrails b {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.voice-lab-guardrails small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.voice-lab-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.voice-lab-form select,
.voice-lab-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbff;
  font-weight: 860;
}

.voice-lab-form select {
  min-height: 42px;
  padding: 0 12px;
}

.voice-lab-form .custom-select-button {
  height: 42px;
  min-height: 42px;
  background: #fbfbff;
}

.voice-lab-form textarea {
  min-height: 116px;
  padding: 12px;
  resize: vertical;
  line-height: 1.7;
}

.voice-lab-drop {
  min-height: 120px;
  place-items: center;
  padding: 18px;
  text-align: center;
  border: 1px dashed rgba(76, 78, 229, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(245, 244, 255, 0.92), #ffffff);
  cursor: pointer;
}

.voice-lab-drop.dragover {
  border-color: var(--accent);
  background: #f4f3ff;
}

.voice-lab-drop strong {
  color: var(--text);
  font-size: 16px;
}

.voice-lab-drop small {
  color: var(--muted);
  font-weight: 760;
}

.voice-lab-presets,
.voice-lab-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.voice-lab-presets button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  color: var(--accent);
  background: #f4f3ff;
  font-weight: 900;
}

.voice-lab-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.voice-lab-controls input {
  accent-color: var(--accent);
}

.voice-lab-audio-card {
  display: grid;
  gap: 16px;
  min-height: 420px;
  align-content: start;
}

.voice-lab-audio-card audio {
  width: 100%;
}

.voice-lab-audio-card pre {
  min-height: 240px;
  margin: 0;
  padding: 18px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbff;
  font-family: inherit;
  font-weight: 760;
  line-height: 1.75;
}

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

.system-card,
.system-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(37, 39, 72, 0.06);
}

.system-card {
  min-height: 92px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 14px 16px;
}

.system-summary-card {
  position: relative;
  min-height: 122px;
  gap: 9px;
  overflow: hidden;
  padding: 16px 18px;
}

.system-summary-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -42px;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(83, 83, 238, 0.18), rgba(83, 83, 238, 0));
  pointer-events: none;
}

.system-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-summary-card .system-card-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(76, 78, 229, 0.2);
}

.system-summary-card .system-card-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.2;
}

.system-card-cpu .system-card-icon {
  background: linear-gradient(135deg, #4c4ee5 0%, #49a7ff 100%);
}

.system-card-memory .system-card-icon {
  background: linear-gradient(135deg, #16b8a6 0%, #67d98d 100%);
}

.system-card-disk .system-card-icon {
  background: linear-gradient(135deg, #ff9f43 0%, #ff6b6b 100%);
}

.system-card-gpu .system-card-icon {
  background: linear-gradient(135deg, #815cf6 0%, #24c6dc 100%);
}

.system-card span,
.system-kv span,
.system-model-meta,
.system-gpu-meta {
  color: var(--muted);
  font-weight: 800;
}

.system-card strong {
  font-size: 26px;
  line-height: 1;
}

.system-summary-card strong {
  position: relative;
  z-index: 1;
  font-size: 38px;
  letter-spacing: 0;
}

.system-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.system-summary-card small {
  position: relative;
  z-index: 1;
  color: #858ba3;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}

.system-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.system-panel {
  padding: 14px;
}

.system-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.system-panel-head h2 {
  font-size: 18px;
}

.system-panel-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

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

.system-kv {
  min-height: 54px;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.system-kv strong {
  font-size: 13px;
  word-break: break-word;
}

.system-gpu-list,
.system-model-list {
  display: grid;
  gap: 8px;
}

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

.system-gpu-list {
  max-height: min(430px, calc(100vh - 330px));
  overflow: auto;
  padding-right: 4px;
}

.system-gpu-item,
.system-model-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.system-gpu-item strong,
.system-model-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
}

.system-pill {
  flex: 0 0 auto;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.system-pill.warn {
  background: var(--warn);
}

.system-pill.ok {
  background: var(--ok);
}

.system-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.system-progress span {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #46b9ff);
}

.system-model-path {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  word-break: break-all;
}

.system-model-note {
  padding: 8px 9px;
  border-radius: 8px;
  color: #7a4b00;
  background: #fff4db;
  font-size: 12px;
  font-weight: 780;
  line-height: 1.45;
}

.system-model-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  padding-top: 4px;
}

.system-model-detail-grid span,
.system-model-detail-grid strong {
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
}

.system-model-detail-grid span {
  color: var(--muted);
  font-weight: 760;
}

.system-model-detail-grid strong {
  color: var(--ink);
  font-weight: 900;
  word-break: break-word;
}

.system-model-remote-list {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.system-model-remote-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.system-model-remote-item span,
.system-model-remote-item strong,
.system-model-remote-item small {
  min-width: 0;
  line-height: 1.2;
}

.system-model-remote-item span {
  font-size: 12px;
  font-weight: 900;
}

.system-model-remote-item strong {
  font-size: 12px;
  color: var(--accent);
}

.system-model-remote-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.system-empty {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-soft);
  font-weight: 900;
}

.system-settings-form {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(37, 39, 72, 0.06);
}

.system-settings-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
}

.system-settings-form label.wide,
.system-settings-form .toggle-line,
.system-settings-form button {
  grid-column: 1 / -1;
}

.system-settings-form input:not([type="checkbox"]),
.system-settings-form select,
.system-settings-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.system-settings-form .custom-select-button {
  height: 40px;
  min-height: 40px;
}

.system-settings-form textarea {
  padding: 12px;
  resize: vertical;
}

.audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.audit-top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 10px;
}

.audit-user-filter {
  min-width: 220px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.audit-user-filter select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 900;
}

.audit-category-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.audit-category-tabs button {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
}

.audit-category-tabs button:hover,
.audit-category-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(76, 78, 229, 0.18);
}

.audit-category-tabs strong {
  font-size: 14px;
}

.audit-category-tabs small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.audit-layout {
  display: grid;
  gap: 18px;
}

.audit-panel {
  min-width: 0;
}

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

.audit-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.audit-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.audit-item-head strong {
  min-width: 0;
  font-size: 15px;
  word-break: break-word;
}

.audit-item-head > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.audit-item-head span,
.audit-muted {
  color: var(--muted);
  font-weight: 800;
}

.audit-delete-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(216, 53, 53, 0.24);
  border-radius: 8px;
  color: #d83535;
  background: #fff6f6;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.audit-delete-button:hover {
  border-color: rgba(216, 53, 53, 0.45);
  background: #ffecec;
}

.audit-meta,
.audit-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-meta span,
.audit-files a,
.audit-files span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.audit-files a {
  color: var(--accent);
}

.audit-download-link::before {
  content: "下载";
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.audit-download-link:hover {
  border-color: rgba(76, 78, 229, 0.32);
  background: #f7f7ff;
}

.audit-item pre {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #34374f;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-text {
  display: grid;
  gap: 6px;
}

.audit-text b {
  font-size: 12px;
  color: var(--muted);
}

.toggle-line {
  min-height: 72px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.toggle-line input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.toggle-line small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 760;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ok);
  background: #eefaf5;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.disabled {
  color: var(--danger);
  background: #fff1f1;
}

.asset-card-delete {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--danger);
  background: #fff1f1;
  font-size: 12px;
  font-weight: 900;
}

.asset-owner {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.audio-upload {
  min-height: 86px;
}

.subtitle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.subtitle-card {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.subtitle-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.subtitle-card {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  background: linear-gradient(#ffffff, #ffffff);
}

.subtitle-card::first-line {
  background: var(--accent);
}

.subtitle-card.orange {
  color: #111827;
  background: #ffb84d;
}

.subtitle-card.dark {
  background: #242245;
}

.subtitle-card.underline {
  color: #111827;
  background: linear-gradient(#ffffff 60%, var(--accent) 60% 66%, #ffffff 66%);
}

.subtitle-card.blue {
  background: var(--accent);
}

.subtitle-card.black {
  background: #1f2937;
}

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

.swatch {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--color);
}

.swatch.selected {
  box-shadow: 0 0 0 3px rgba(77, 80, 232, 0.18);
  border-color: var(--accent);
}

.stage-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(360px, 1fr) 220px;
  background: #fbfcff;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 42px;
}

.layer-button {
  margin-left: auto;
}

.preview-wrap {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 14px 32px 28px;
}

.preview-canvas {
  position: relative;
  width: min(72vh, 420px);
  max-width: min(48vw, 520px);
  overflow: hidden;
  border-radius: 2px;
  background: #f1efe9;
  box-shadow: 0 20px 60px rgba(37, 39, 72, 0.08);
}

.preview-canvas.no-avatar-selected {
  background: transparent;
  box-shadow: none;
}

.preview-canvas.ratio-9-16 {
  aspect-ratio: 9 / 16;
}

.preview-canvas.ratio-16-9 {
  width: min(62vw, 820px);
  max-width: 820px;
  aspect-ratio: 16 / 9;
}

.preview-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(116, 130, 88, 0.55) 34%, rgba(255, 255, 255, 0.16) 34%),
    linear-gradient(180deg, #e9dfcc, #d9c6a2);
}

.preview-canvas.no-avatar-selected .preview-bg {
  background: transparent !important;
}

.preview-bg.custom {
  background-size: cover;
  background-position: center;
}

.preview-bg.solid {
  background: var(--solid-color, #ffffff);
}

.preview-canvas img,
.preview-canvas video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  transform-origin: 50% 58%;
}

#resultVideo {
  background: #111827;
  z-index: 4;
}

.preview-canvas.audio-only-result #resultVideo {
  opacity: 0;
  pointer-events: none;
}

.preview-canvas.audio-only-result #avatarPreview {
  z-index: 2;
}

.preview-canvas.static-avatar-preview #avatarPreview,
.preview-canvas.library-avatar-mode #avatarPreview {
  object-position: center bottom;
}

.preview-canvas.library-avatar-mode #avatarPreview {
  inset: 3% 8% 0;
  width: 84%;
  height: 97%;
  mix-blend-mode: multiply;
  filter: contrast(1.08) saturate(1.04);
}

.preview-canvas.platform-avatar-mode {
  overflow: hidden;
}

.preview-canvas.platform-avatar-mode #avatarPreview,
.preview-canvas.platform-avatar-mode #avatarVideoPreview {
  display: none;
}

.preview-canvas.generated-video-mode #resultVideo {
  opacity: 1;
  pointer-events: auto;
}

.preview-canvas.is-playing #avatarPreview:not([hidden]),
.preview-canvas.is-playing #avatarVideoPreview:not([hidden]),
.preview-canvas.is-playing .preset-avatar:not([hidden]) {
  animation: none;
}

.preview-canvas.is-playing.static-avatar-preview #avatarPreview:not([hidden]) {
  filter: drop-shadow(0 18px 28px rgba(21, 24, 44, 0.14));
}

.preview-canvas.is-playing.motion-avatar-mode #avatarPreview:not([hidden]) {
  animation: avatarTalkMotion 1.1s ease-in-out infinite;
  filter: drop-shadow(0 18px 30px rgba(21, 24, 44, 0.18));
}

.preview-canvas.is-playing.motion-avatar-mode .preview-bg {
  animation: avatarBgBreath 1.8s ease-in-out infinite;
}

.preview-canvas.is-playing.library-avatar-mode #avatarPreview:not([hidden]) {
  filter: contrast(1.08) saturate(1.04) drop-shadow(0 18px 28px rgba(21, 24, 44, 0.14));
}

.preview-canvas.is-playing.platform-avatar-mode .preset-avatar.realistic-platform-avatar:not([hidden])::before {
  animation: platformAvatarSpeak 1.16s ease-in-out infinite;
}

.preview-canvas.is-playing.platform-avatar-mode .preset-avatar.realistic-platform-avatar:not([hidden])::after {
  animation: platformAvatarDepth 1.16s ease-in-out infinite;
}

@keyframes avatarTalkMotion {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  24% {
    transform: translate3d(0, -1.4%, 0) scale(1.006);
  }

  48% {
    transform: translate3d(0.8%, 0.6%, 0) scale(0.998);
  }

  72% {
    transform: translate3d(-0.7%, -0.8%, 0) scale(1.004);
  }
}

@keyframes avatarBgBreath {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }

  50% {
    filter: saturate(1.08) brightness(1.03);
  }
}

@keyframes avatarPreviewScan {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0) scaleX(0.72);
  }

  50% {
    opacity: 0.82;
    transform: translateY(-6px) scaleX(1);
  }
}

.empty-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(36, 38, 63, 0.55);
  font-weight: 800;
  text-align: center;
  z-index: 2;
}

.empty-preview strong {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 18px;
}

.empty-preview button {
  pointer-events: auto;
}

.empty-preview small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.preview-hint {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 6;
  padding: 8px 10px;
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: rgba(36, 38, 63, 0.72);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
  text-align: left;
  box-shadow: 0 12px 30px rgba(27, 31, 59, 0.08);
  backdrop-filter: blur(8px);
}

.preset-avatar {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-content: end;
  background: url("/console-assets/generated/cutout/fresh-avatar-04.png?v=20260703-platform-cutout-only") center bottom / contain no-repeat;
  pointer-events: none;
}

.preset-head,
.preset-body {
  display: none;
}

.preset-avatar.realistic-platform-avatar {
  inset: 5% 8% 0;
  display: block;
  background: none;
  perspective: 1100px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 34px 48px rgba(23, 29, 61, 0.18));
}

.preset-avatar.realistic-platform-avatar.has-ply-preview,
.preset-avatar.realistic-platform-avatar.has-model-preview {
  inset: 4% 7% 4%;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.52), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(79, 70, 229, 0.04));
  filter: drop-shadow(0 28px 44px rgba(23, 29, 61, 0.16));
}

.preset-avatar.realistic-platform-avatar.has-ply-preview::before,
.preset-avatar.realistic-platform-avatar.has-ply-preview::after,
.preset-avatar.realistic-platform-avatar.has-model-preview::before,
.preset-avatar.realistic-platform-avatar.has-model-preview::after {
  display: none;
}

.preset-avatar.realistic-platform-avatar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 1%;
  bottom: 4%;
  width: min(70%, 430px);
  min-width: 240px;
  border: 0;
  border-radius: 0;
  background: var(--avatar-image) center bottom / contain no-repeat;
  box-shadow: none;
  filter:
    drop-shadow(0 26px 36px rgba(25, 30, 59, 0.22))
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.36));
  transform: translateX(-50%) rotateY(-6deg) rotateX(1.5deg) translateZ(38px);
  transform-origin: 50% 58%;
  will-change: transform;
}

.preset-avatar.realistic-platform-avatar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2.5%;
  width: min(44%, 310px);
  min-width: 160px;
  height: 7.5%;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(19, 24, 48, 0.26) 0 18%, rgba(19, 24, 48, 0.12) 42%, transparent 72%);
  filter: blur(3px);
  opacity: 0.72;
  transform: translateX(-50%) rotateX(68deg) translateZ(-42px);
  transform-origin: center;
}

.preset-avatar.realistic-platform-avatar .preset-head,
.preset-avatar.realistic-platform-avatar .preset-body {
  display: none;
}

.preset-head {
  position: relative;
  z-index: 2;
  width: min(34%, 138px);
  aspect-ratio: 0.86;
  border-radius: 46% 46% 44% 44%;
  background:
    radial-gradient(circle at 35% 58%, #22263f 0 4%, transparent 5%),
    radial-gradient(circle at 64% 58%, #22263f 0 4%, transparent 5%),
    radial-gradient(circle at 50% 73%, rgba(216, 116, 116, 0.28) 0 8%, transparent 9%),
    #f3cdb7;
  box-shadow:
    0 -26px 0 10px #2c2632,
    0 10px 24px rgba(37, 39, 72, 0.14);
}

.preset-head::before {
  content: "";
  position: absolute;
  left: 17%;
  right: 17%;
  top: 53%;
  height: 18%;
  border: 3px solid #23263c;
  border-top: 2px solid #23263c;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.12);
}

.preset-head::after {
  content: "";
  position: absolute;
  left: -13%;
  right: -13%;
  top: -24%;
  height: 78%;
  border-radius: 44% 44% 28% 28%;
  background:
    linear-gradient(105deg, transparent 0 43%, rgba(255, 255, 255, 0.18) 43% 48%, transparent 48%),
    #2c2632;
  z-index: -1;
}

.preset-body {
  position: relative;
  width: min(58%, 240px);
  height: min(56%, 420px);
  min-height: 230px;
  margin-top: -12px;
  border-radius: 46px 46px 12px 12px;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(0, 0, 0, 0.05) 18% 20%, transparent 20% 80%, rgba(0, 0, 0, 0.05) 80% 82%, transparent 82%),
    #fbf8ec;
  box-shadow: 0 20px 44px rgba(37, 39, 72, 0.14);
}

.preset-body::after {
  content: "";
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: -16%;
  height: 30%;
  border-radius: 0 0 10px 10px;
  background: #22263f;
}

.ratio-16-9 .preset-avatar {
  inset: 0;
}

.ratio-16-9 .preset-avatar.realistic-platform-avatar {
  inset: 6% 12% 0;
}

@keyframes platformAvatarSpeak {
  0%,
  100% {
    transform: translateX(-50%) rotateY(-6deg) rotateX(1.5deg) translateZ(38px) translateY(0) scale(1);
  }

  34% {
    transform: translateX(-50%) rotateY(-3deg) rotateX(0.8deg) translateZ(44px) translateY(-3px) scale(1.005);
  }

  66% {
    transform: translateX(-50%) rotateY(-9deg) rotateX(2.4deg) translateZ(39px) translateY(1px) scale(0.998);
  }
}

@keyframes platformAvatarDepth {
  0%,
  100% {
    transform: translateX(-50%) rotateX(68deg) translateZ(-42px) scaleX(1);
    opacity: 0.66;
  }

  50% {
    transform: translateX(-50%) rotateX(68deg) translateZ(-42px) scaleX(1.08);
    opacity: 0.78;
  }
}

.ai-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 760;
}

.subtitle-preview {
  position: absolute;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  max-width: calc(100% - 36px);
  padding: 6px 12px;
  border-radius: 5px;
  color: #ffffff;
  background: var(--accent);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle-preview.orange {
  color: #111827;
  background: #ffb84d;
}

.subtitle-preview.dark {
  background: #242245;
}

.subtitle-preview.underline {
  color: #111827;
  background: linear-gradient(#ffffff 62%, var(--accent) 62% 70%, #ffffff 70%);
}

.subtitle-preview.blue {
  background: #3f42d8;
}

.subtitle-preview.black {
  background: #1f2937;
}

.timeline {
  display: grid;
  grid-template-columns: 84px 82px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  padding: 22px 28px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.play-button {
  width: 48px;
  height: 48px;
  justify-self: end;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 19px;
}

.time-readout {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.track {
  position: relative;
  min-height: 118px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 14px 4px 6px 0;
  border-left: 2px solid var(--accent);
}

.playhead {
  position: absolute;
  left: -4px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.clip {
  position: relative;
  width: 248px;
  flex: 0 0 248px;
  height: 98px;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: stretch;
  margin-left: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f3f8;
}

.clip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(77, 80, 232, 0.24);
}

.clip-index {
  position: absolute;
  left: -2px;
  top: -22px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.clip-thumb {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.12)),
    #dfe3ee;
  background-size: cover;
  background-position: center;
}

.clip-thumb.has-media {
  background-color: #eef1f8;
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
}

.clip-thumb.has-media.platform-cutout-thumb {
  background-color: #f6f8ff;
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.clip-thumb.has-media.model-thumb {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.8), transparent 24%),
    linear-gradient(135deg, rgba(76, 78, 229, 0.16), rgba(70, 185, 255, 0.16)),
    #eef2ff;
}

.clip-thumb.has-media.model-thumb::before {
  content: "3DGS";
  display: inline-grid;
  min-width: 48px;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(76, 78, 229, 0.24);
}

.clip-thumb.preset-thumb {
  background: url("/console-assets/generated/cutout/fresh-avatar-04.png?v=20260703-platform-cutout-only") center bottom / contain no-repeat;
}

.clip-thumb.preset-thumb::before {
  content: none;
}

.clip-thumb.preset-thumb::after {
  content: none;
}

.clip-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  background: rgba(36, 38, 63, 0.42);
  color: #ffffff;
}

.clip-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  color: #ffffff;
  background: rgba(36, 38, 63, 0.46);
  font-size: 12px;
  font-weight: 900;
}

.add-scene {
  height: 96px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  background: #ffffff;
  font-size: 24px;
}

.circle-button,
.icon-button,
.ghost-button,
.secondary,
.primary,
.full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
}

.circle-button,
.icon-button {
  width: 36px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
}

.circle-button {
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.primary {
  color: #ffffff;
  background: var(--accent);
}

.primary:hover:not(:disabled) {
  background: #3f42d8;
}

.secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
}

.ghost-button {
  color: var(--muted);
  background: transparent;
}

.full {
  width: 100%;
}

.service-state,
.user-badge,
.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.user-badge small {
  color: var(--muted);
  font-weight: 700;
}

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

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}

.service-state.online .dot {
  background: var(--ok);
}

.service-state.offline .dot {
  background: var(--danger);
}

.avatar-builder {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) 68px;
  background: #ffffff;
}

.builder-topbar {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.builder-save-tip {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #4f536a;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(37, 39, 72, 0.08);
  font-weight: 800;
}

.builder-main {
  min-height: 0;
  overflow: auto;
  padding: 54px 24px 90px;
  background: #ffffff;
}

.builder-shell {
  width: min(760px, 100%);
  margin: 0 auto;
}

.builder-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 34px;
}

.builder-heading h1 {
  font-size: 26px;
  line-height: 1.2;
}

.builder-heading p {
  color: var(--muted);
  font-weight: 760;
}

.builder-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 62px;
  padding: 0;
  list-style: none;
}

.builder-steps li {
  position: relative;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.builder-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 32px;
  right: -18px;
  top: 12px;
  height: 2px;
  background: var(--line);
}

.builder-steps li.done:not(:last-child)::after,
.builder-steps li.active:not(:last-child)::after {
  background: var(--accent);
}

.builder-steps span {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #d9dceb;
  font-size: 13px;
}

.builder-steps li.active,
.builder-steps li.done {
  color: var(--text);
}

.builder-steps li.active span,
.builder-steps li.done span {
  background: var(--accent);
}

.builder-step {
  display: none;
}

.builder-step.active {
  display: grid;
  gap: 26px;
}

.builder-step h2 {
  font-size: 17px;
}

.builder-field {
  display: grid;
  gap: 12px;
  color: var(--text);
  font-weight: 900;
}

.builder-field b {
  color: #ff4d55;
}

.builder-field small {
  color: var(--muted);
}

.builder-script-field[hidden],
.builder-outfit-custom[hidden] {
  display: none;
}

.builder-script-field textarea {
  min-height: 120px;
  resize: vertical;
}

.builder-motion-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
}

.builder-motion-grid .motion-control span {
  font-size: 13px;
}

.counted-input {
  position: relative;
  display: block;
}

.counted-input input {
  padding-right: 78px;
}

.counted-input em {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-style: normal;
  font-weight: 760;
}

.radio-cluster {
  display: flex;
  gap: 22px;
  align-items: center;
}

.radio-cluster label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}

.radio-cluster input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: relative;
  width: 48px;
  height: 28px;
  display: inline-block;
  border-radius: 999px;
  background: #edeff8;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(37, 39, 72, 0.18);
  transition: transform 0.2s ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.builder-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  color: var(--text);
  font-weight: 900;
}

.builder-upload {
  position: relative;
  min-height: 188px;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #fbfcff;
  text-align: center;
}

.builder-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.builder-upload:hover,
.builder-upload.drag-over {
  border-color: var(--accent);
  background: #f8f8ff;
}

.builder-upload small {
  color: var(--muted);
  font-weight: 760;
}

.builder-upload-status {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(76, 78, 229, 0.18);
  border-radius: 8px;
  background: #fbfbff;
}

.builder-upload-status[hidden] {
  display: none;
}

.builder-upload-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-weight: 900;
}

.builder-upload-head em {
  color: var(--accent);
  font-style: normal;
}

.builder-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(76, 78, 229, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cloneSpin 0.8s linear infinite;
}

.builder-upload-status.complete .builder-spinner {
  position: relative;
  border-color: #24c18d;
  background: #24c18d;
  box-shadow: 0 8px 18px rgba(36, 193, 141, 0.22);
  animation: none;
}

.builder-upload-status.complete .builder-spinner::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 7px;
  height: 12px;
  border: solid #ffffff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.builder-file-list {
  display: grid;
  gap: 8px;
  max-height: 156px;
  overflow: auto;
}

.builder-file-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.builder-file-item span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: #f0efff;
  font-weight: 900;
}

.builder-file-item strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-file-item em {
  font-style: normal;
  white-space: nowrap;
}

.builder-doc-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.builder-doc-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 16px;
}

.builder-doc-card p {
  padding: 10px 12px;
  border-radius: 6px;
  color: #ff4d55;
  background: #fff0f0;
  line-height: 1.5;
  font-weight: 760;
}

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

.mistake-grid figure {
  margin: 0;
  display: grid;
  gap: 8px;
  color: #6b7087;
  text-align: center;
  font-weight: 760;
}

.mistake-card {
  position: relative;
}

.mistake-card img {
  width: 100%;
  height: 100px;
  display: block;
  object-fit: cover;
  border: 1px solid #ffd0d0;
  border-radius: 8px;
}

.mistake-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100px;
  border-radius: 8px;
  pointer-events: none;
}

.mistake-card.position::after {
  background:
    radial-gradient(circle at 70% 42%, rgba(36, 38, 63, 0.2) 0 22%, transparent 23%),
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.22) 49% 52%, transparent 53%);
}

.mistake-card.light img {
  filter: sepia(0.55) brightness(0.72) saturate(0.82);
}

.mistake-card.matting::after {
  background:
    linear-gradient(90deg, rgba(42, 164, 105, 0.72) 0 18%, transparent 18% 82%, rgba(42, 164, 105, 0.72) 82%),
    linear-gradient(180deg, transparent, rgba(42, 164, 105, 0.16));
}

.mistake-card.cover::after {
  background:
    linear-gradient(112deg, transparent 0 46%, rgba(255, 255, 255, 0.86) 47% 64%, transparent 65%);
}

.payment-card,
.training-card,
.generated-avatar-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.payment-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

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

.payment-card p,
.training-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.payment-card > span {
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
}

.payment-summary {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.payment-summary span {
  color: var(--muted);
  font-weight: 760;
}

.builder-consent {
  justify-content: start;
}

.training-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
}

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

.training-card::before {
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 22%, rgba(76, 78, 229, 0.16), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(70, 185, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 247, 255, 0.94));
}

.training-card::after {
  left: -45%;
  right: -45%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(76, 78, 229, 0.52), rgba(70, 185, 255, 0.76), transparent);
  opacity: 0;
}

.training-card.is-generating {
  border-color: rgba(76, 78, 229, 0.34);
  box-shadow:
    0 22px 48px rgba(76, 78, 229, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.training-card.is-generating::after {
  opacity: 1;
  animation: builderRenderSweep 2.2s ease-in-out infinite;
}

.training-card.is-complete {
  border-color: rgba(36, 193, 141, 0.34);
  box-shadow: 0 22px 48px rgba(36, 193, 141, 0.12);
}

.training-card.is-error {
  border-color: rgba(239, 68, 68, 0.28);
  box-shadow: 0 18px 40px rgba(239, 68, 68, 0.1);
}

.training-visual {
  position: relative;
  overflow: hidden;
  height: 150px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(77, 80, 232, 0.12), transparent),
    #f6f7fb;
}

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

.training-visual::before {
  inset: 14px;
  border-radius: 8px;
  border: 1px solid rgba(76, 78, 229, 0.18);
  box-shadow:
    0 0 0 8px rgba(76, 78, 229, 0.04),
    0 0 30px rgba(70, 185, 255, 0.18);
}

.training-visual::after {
  left: 12%;
  right: 12%;
  top: 18%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(76, 78, 229, 0.78), rgba(70, 185, 255, 0.92), transparent);
  opacity: 0;
}

.training-card.is-generating .training-visual::before {
  animation: builderRenderRing 1.8s ease-in-out infinite;
}

.training-card.is-generating .training-visual::after {
  opacity: 1;
  animation: builderAvatarScan 1.35s ease-in-out infinite;
}

.training-card.is-complete .training-visual::before {
  border-color: rgba(36, 193, 141, 0.28);
  box-shadow:
    0 0 0 8px rgba(36, 193, 141, 0.06),
    0 0 30px rgba(36, 193, 141, 0.18);
}

.training-face {
  position: relative;
  z-index: 1;
  display: none;
  width: 86px;
  height: 112px;
  border-radius: 8px;
  background: transparent;
  box-shadow: 0 14px 28px rgba(37, 39, 72, 0.16);
}

.training-card.is-generating .training-face {
  animation: builderAvatarBreath 1.8s ease-in-out infinite;
  box-shadow:
    0 16px 34px rgba(76, 78, 229, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.7);
}

.training-copy {
  position: relative;
  z-index: 1;
}

.training-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}

.training-copy strong::before {
  content: "✦";
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  box-shadow: 0 10px 20px rgba(76, 78, 229, 0.18);
}

.training-card.is-generating .training-copy strong::before {
  animation: builderPulse 0.9s ease-in-out infinite;
}

.training-card.is-complete .training-copy strong::before {
  content: "✓";
  background: #24c18d;
}

.training-card.is-error .training-copy strong::before {
  content: "!";
  background: #ef4444;
}

.training-card.is-generating .progress-line {
  box-shadow: 0 0 0 1px rgba(76, 78, 229, 0.06), 0 8px 18px rgba(76, 78, 229, 0.1);
}

.training-card.is-generating .progress-line span {
  position: relative;
  background: linear-gradient(90deg, #4c4ee5, #46b9ff, #8b8cff);
  background-size: 200% 100%;
  animation: builderProgressFlow 1.2s linear infinite;
}

.training-card.is-generating .progress-line span::after {
  content: "";
  position: absolute;
  inset: 0 -18px 0 auto;
  width: 48px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  animation: builderProgressSpark 1s ease-in-out infinite;
}

.training-card.is-complete .progress-line span {
  background: linear-gradient(90deg, #24c18d, #67e8f9);
}

.training-visual.has-preview .training-face {
  display: block;
  width: 104px;
  height: 124px;
  background: var(--builder-preview) center top / cover no-repeat;
}

.training-visual.has-video .training-face,
.generated-thumb.has-video::before {
  display: none;
}

.training-visual .builder-preview-video,
.generated-thumb .builder-preview-video {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: transparent;
  object-fit: contain;
}

.progress-line {
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-line span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.3s ease;
}

.generated-avatar-card {
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  background: #fbfcff;
}

.generated-thumb {
  position: relative;
  height: 96px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(76, 78, 229, 0.08), rgba(70, 185, 255, 0.08));
}

.generated-thumb.has-preview {
  background: var(--builder-preview) center top / cover no-repeat;
}

.generated-thumb.has-video {
  background: transparent;
}

.generated-avatar-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 760;
}

.builder-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.builder-footer .primary,
.builder-footer .secondary {
  height: 42px;
  min-width: 92px;
}

.avatar-builder {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  grid-template-rows: 48px minmax(0, 1fr) 54px;
  background:
    radial-gradient(circle at 12% 12%, rgba(76, 78, 229, 0.08), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(70, 185, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff, #fbfbff);
}

.builder-topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.builder-save-tip {
  top: 8px;
  padding: 5px 10px;
  font-size: 12px;
}

.builder-main {
  overflow: hidden;
  padding: 10px 20px 6px;
}

.builder-shell {
  width: min(1660px, 100%);
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(430px, 1.24fr) minmax(330px, 0.88fr);
  grid-template-rows: 64px minmax(0, 1fr);
  align-items: stretch;
  align-content: stretch;
  gap: 10px 12px;
}

.builder-heading {
  position: relative;
  grid-column: 1 / 3;
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 3px;
  margin: 0;
  padding: 10px 16px 10px 60px;
  overflow: hidden;
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(76, 78, 229, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(37, 39, 72, 0.06);
}

.builder-heading-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 28%, rgba(255, 255, 255, 0.88) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 70%, rgba(255, 255, 255, 0.98) 0 4px, transparent 5px),
    linear-gradient(135deg, #4c4ee5 0%, #4f87ff 50%, #37c6ff 100%);
  box-shadow: 0 14px 28px rgba(76, 78, 229, 0.24);
  animation: builderHeadingIconFloat 2.8s ease-in-out infinite;
}

.builder-heading-icon::before {
  content: "";
  position: absolute;
  inset: 9px 8px 10px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  transform: rotate(45deg);
}

.builder-heading-icon::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -3px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #dff5ff);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.58), 0 8px 16px rgba(76, 78, 229, 0.24);
}

.builder-heading-icon i {
  position: absolute;
  left: 12px;
  top: 17px;
  width: 11px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  transform: rotate(-32deg);
}

.builder-heading::after {
  content: "";
  position: absolute;
  inset: auto -20% 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(76, 78, 229, 0.44), rgba(70, 185, 255, 0.52), transparent);
  animation: builderScanLine 4s ease-in-out infinite;
}

.builder-heading h1 {
  font-size: 21px;
  line-height: 1.1;
}

.builder-heading p {
  font-size: 12px;
  line-height: 1.25;
}

.builder-steps {
  grid-column: 3;
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(76, 78, 229, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 36px rgba(37, 39, 72, 0.05);
}

.builder-steps li {
  display: grid;
  grid-template-rows: 30px auto;
  place-items: center;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 5px;
  border-radius: 8px;
  font-size: 12px;
}

.builder-steps li.active,
.builder-steps li.done {
  background: rgba(76, 78, 229, 0.08);
}

.builder-steps li:not(:last-child)::after {
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  top: 19px;
}

.builder-steps span {
  width: 30px;
  height: 30px;
  box-shadow: 0 8px 18px rgba(76, 78, 229, 0.2);
}

.builder-steps strong {
  max-width: 100%;
  overflow: visible;
  line-height: 1.1;
  white-space: nowrap;
}

.builder-step,
.builder-step.active {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
  height: 100%;
  padding: 12px;
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(76, 78, 229, 0.07), transparent 34%),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(37, 39, 72, 0.07);
}

.builder-step::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(76, 78, 229, 0.16), rgba(70, 185, 255, 0.36), rgba(76, 78, 229, 0.1));
  background-size: 220% 220%;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: builderGlowSweep 5.4s ease-in-out infinite;
}

.builder-step.active {
  border-color: rgba(76, 78, 229, 0.32);
  box-shadow: 0 22px 50px rgba(76, 78, 229, 0.12);
}

.builder-step[data-builder-step="1"] {
  grid-column: 1;
  grid-row: 2;
  gap: 7px;
}

.builder-step[data-builder-step="2"] {
  grid-column: 2;
  grid-row: 2;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.builder-step[data-builder-step="3"] {
  grid-column: 3;
  grid-row: 2;
  grid-template-rows: auto auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 76% 74%, rgba(70, 185, 255, 0.11), transparent 26%),
    linear-gradient(145deg, rgba(76, 78, 229, 0.07), transparent 34%),
    rgba(255, 255, 255, 0.94);
}

.builder-step[data-builder-step="2"]::after,
.builder-step[data-builder-step="3"]::after {
  content: "素材质检 · 动作建模 · 入库预览";
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  color: rgba(95, 100, 124, 0.56);
  background:
    linear-gradient(rgba(76, 78, 229, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 78, 229, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, rgba(70, 185, 255, 0.09), transparent 28%),
    rgba(255, 255, 255, 0.46);
  background-size: 22px 22px, 22px 22px, 100% 100%, 100% 100%;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.builder-step[data-builder-step="3"]::after {
  content: "上传素材后，可在这里查看生成进度与入库状态";
}

.builder-step h2 {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 2px;
  color: #202342;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
}

.builder-step h2::before {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  box-shadow: 0 10px 20px rgba(76, 78, 229, 0.18);
  font-size: 15px;
}

.builder-step[data-builder-step="1"] h2::before {
  content: "✦";
}

.builder-step[data-builder-step="2"] h2::before {
  content: "⇧";
}

.builder-step[data-builder-step="3"] h2::before {
  content: "✓";
}

.builder-step[data-builder-step="1"] .builder-field,
.builder-toggle-row {
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(76, 78, 229, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.builder-step[data-builder-step="1"] .builder-field:hover,
.builder-toggle-row:hover {
  transform: translateY(-1px);
  border-color: rgba(76, 78, 229, 0.24);
  box-shadow: 0 10px 22px rgba(76, 78, 229, 0.08);
}

.builder-field,
.builder-toggle-row {
  font-size: 12px;
}

.builder-mode-field {
  gap: 7px;
}

.builder-mode-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.builder-mode-cards button {
  position: relative;
  min-height: 82px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px 10px 9px;
  text-align: left;
  font: inherit;
  border: 1px solid rgba(76, 78, 229, 0.16);
  border-radius: 8px;
  color: #202342;
  background:
    linear-gradient(145deg, rgba(76, 78, 229, 0.04), transparent 60%),
    #ffffff;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.builder-mode-cards button:hover {
  transform: translateY(-1px);
  border-color: rgba(76, 78, 229, 0.34);
  box-shadow: 0 12px 24px rgba(76, 78, 229, 0.1);
}

.builder-mode-cards button.active {
  border-color: #5651ef;
  background:
    radial-gradient(circle at 100% 0%, rgba(70, 185, 255, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(76, 78, 229, 0.12), rgba(255, 255, 255, 0.92));
  box-shadow: 0 0 0 1px rgba(76, 78, 229, 0.12), 0 16px 30px rgba(76, 78, 229, 0.14);
}

.builder-mode-cards button[data-builder-mode="threeD"] em {
  background: linear-gradient(135deg, #f59e0b, #5651ef);
}

.builder-mode-cards button[data-builder-mode="threeD"].active {
  border-color: rgba(245, 158, 11, 0.75);
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.18), transparent 38%),
    linear-gradient(145deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.94));
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.16), 0 16px 30px rgba(245, 158, 11, 0.12);
}

.builder-mode-cards strong {
  max-width: calc(100% - 42px);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 1000;
}

.builder-mode-cards em {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  font-size: 10px;
  font-style: normal;
  font-weight: 1000;
}

.builder-mode-cards small {
  display: -webkit-box;
  overflow: hidden;
  color: #68708d;
  font-size: 11px;
  line-height: 1.32;
  font-weight: 800;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.builder-mode-help {
  margin: 0;
  color: #7d849d;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
}

.builder-field > span:first-child {
  line-height: 1.15;
}

.builder-field input,
.builder-field select,
.builder-field textarea {
  padding-inline: 10px;
  min-height: 32px;
}

.builder-field input,
.builder-field select {
  height: 32px;
  line-height: 32px;
}

.builder-field select {
  background-position:
    calc(100% - 15px) 13px,
    calc(100% - 9px) 13px;
}

.builder-field .custom-select-button {
  height: 32px;
  min-height: 32px;
}

.builder-motion-grid {
  gap: 8px;
  padding: 8px;
}

.builder-motion-grid .motion-control {
  gap: 4px;
}

.builder-motion-grid .motion-control span {
  font-size: 11px;
}

.radio-cluster {
  gap: 10px;
}

.radio-cluster label {
  font-size: 13px;
}

.switch span {
  width: 38px;
  height: 22px;
}

.switch span::after {
  width: 16px;
  height: 16px;
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.builder-script-field textarea {
  min-height: 60px;
}

.builder-upload {
  min-height: 116px;
  gap: 6px;
  padding: 14px;
  background:
    radial-gradient(circle at 50% 18%, rgba(76, 78, 229, 0.12), transparent 24%),
    #fbfcff;
}

.builder-upload .upload-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  box-shadow: 0 14px 26px rgba(76, 78, 229, 0.2);
  font-size: 23px;
  animation: builderIconFloat 2.4s ease-in-out infinite;
}

.builder-upload strong {
  font-size: 14px;
  line-height: 1.2;
}

.builder-upload small {
  font-size: 11px;
  line-height: 1.25;
}

.builder-upload:hover .upload-icon,
.builder-upload.drag-over .upload-icon {
  animation: builderPulse 0.9s ease-in-out infinite;
}

.builder-upload-status {
  gap: 7px;
  padding: 10px;
}

.builder-file-list {
  max-height: 78px;
}

.builder-file-item {
  min-height: 28px;
  padding: 5px 8px;
}

.capture-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #e6e9ff;
  border-radius: 10px;
  background: #fbfcff;
}

.capture-checklist > div {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #20233d;
}

.capture-checklist small,
.draft-controls small {
  color: #8a91aa;
  font-weight: 700;
}

.capture-checklist label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: #565d78;
  font-size: 12px;
  font-weight: 800;
}

.capture-checklist input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.draft-preview-panel {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid #e3e6ff;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff, #f8f9ff);
}

.draft-preview-stage {
  position: relative;
  height: 132px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef1ff;
}

.draft-preview-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.draft-preview-stage.person-layer-draft {
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.88), transparent 28%),
    linear-gradient(155deg, rgba(238, 244, 255, 0.96), rgba(226, 235, 255, 0.86) 52%, rgba(248, 251, 255, 0.98));
  perspective: 760px;
}

.draft-preview-stage.person-layer-draft::before,
.draft-preview-stage.person-layer-draft::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.draft-preview-stage.person-layer-draft::before {
  z-index: 1;
  left: 50%;
  top: 6px;
  bottom: 12px;
  width: 72%;
  background: var(--draft-preview) center bottom / contain no-repeat;
  filter:
    drop-shadow(0 18px 28px rgba(23, 29, 61, 0.18))
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.32));
  transform: translateX(-50%) rotateY(-7deg) translateZ(18px);
  transform-origin: 50% 64%;
}

.draft-preview-stage.person-layer-draft::after {
  z-index: 0;
  left: 50%;
  bottom: 5px;
  width: 52%;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(23, 29, 61, 0.2), rgba(23, 29, 61, 0.08) 48%, transparent 72%);
  filter: blur(2px);
  transform: translateX(-50%);
}

.draft-preview-stage.person-layer-draft img {
  opacity: 0;
}

.draft-preview-stage span {
  position: absolute;
  z-index: 3;
  left: 6px;
  bottom: 6px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(20, 25, 48, 0.68);
  font-size: 10px;
  font-weight: 900;
}

.draft-controls {
  display: grid;
  gap: 7px;
}

.draft-controls > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.draft-controls label {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #565d78;
  font-size: 12px;
  font-weight: 900;
}

.draft-controls em {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #4f46e5;
  background: #f0efff;
  font-style: normal;
}

.quality-panel {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #dfe4ff;
  border-radius: 12px;
  background: #ffffff;
}

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

.quality-head span {
  color: #5651ef;
  font-weight: 1000;
}

.quality-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0f2fa;
}

.quality-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5a54f1, #42b9ff);
  transition: width 0.22s ease;
}

.quality-panel.is-warning {
  border-color: #ffcece;
  background: #fffafa;
}

.quality-panel.is-warning .quality-meter span {
  background: linear-gradient(90deg, #ff6262, #ffb15d);
}

.quality-summary {
  color: #707792;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.quality-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.quality-detail-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid #edf0ff;
  border-radius: 9px;
  background: #fbfcff;
}

.quality-detail-card > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quality-detail-card strong,
.quality-detail-card span,
.quality-detail-card p {
  min-width: 0;
}

.quality-detail-card strong {
  color: #20233d;
  font-size: 12px;
  font-weight: 1000;
}

.quality-detail-card span {
  color: #727993;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.quality-detail-card p {
  margin: 0;
  color: #69708b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.quality-detail-card i {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1fb;
}

.quality-detail-card i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5a54f1, #42b9ff);
}

.quality-detail-card.good {
  border-color: rgba(35, 197, 132, 0.26);
  background: #fbfffd;
}

.quality-detail-card.warn,
.quality-detail-card.issue {
  border-color: rgba(255, 177, 93, 0.36);
  background: #fffaf4;
}

.quality-detail-card.bad {
  border-color: rgba(255, 98, 98, 0.32);
  background: #fff8f8;
}

.builder-doc-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  padding: 10px;
}

.builder-doc-card strong {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-doc-card strong::before {
  content: "!";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #ff6b6b;
  font-size: 13px;
}

.builder-doc-card p {
  grid-column: 1 / -1;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.35;
}

.builder-doc-card .link-button {
  justify-self: start;
  min-height: 28px;
  font-size: 13px;
}

.reference-library {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e8ebff;
  border-radius: 12px;
  background: #ffffff;
}

.reference-section {
  display: grid;
  gap: 7px;
}

.reference-section > strong {
  color: #20233d;
  font-size: 14px;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

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

.reference-grid figure {
  margin: 0;
  display: grid;
  gap: 4px;
  color: #6f768f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.reference-grid img {
  width: 100%;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eceeff;
}

.guide-video-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px dashed #cfd5ff;
  background: linear-gradient(135deg, #f9faff, #f2f6ff);
  cursor: pointer;
}

.guide-video-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #5651ef, #42b9ff);
  box-shadow: 0 10px 20px rgba(86, 81, 239, 0.18);
}

.guide-video-card strong,
.guide-video-card small {
  display: block;
}

.guide-video-card small {
  margin-top: 2px;
  color: #7c839e;
  font-weight: 800;
}

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

.mistake-grid figure {
  gap: 4px;
  font-size: 11px;
  line-height: 1.25;
}

.mistake-card img,
.mistake-card::after {
  height: 58px;
}

.training-card {
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

.training-card p {
  margin-top: 5px;
  line-height: 1.45;
  font-size: 12px;
}

.training-copy strong {
  font-size: 15px;
}

.training-copy strong::before {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 12px;
}

.training-card .progress-line {
  height: 6px;
  margin-top: 10px;
}

.training-visual {
  height: 94px;
}

.training-face {
  width: 58px;
  height: 76px;
}

.training-visual.has-preview .training-face {
  width: 72px;
  height: 86px;
}

.generated-avatar-card {
  grid-template-columns: 62px minmax(0, 1fr);
  padding: 12px;
}

.generated-thumb {
  height: 66px;
}

.builder-footer {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.builder-footer .primary::before {
  content: "▶";
  font-size: 12px;
}

.builder-footer .secondary::before {
  content: "‹";
  font-size: 18px;
}

.builder-shell {
  grid-template-columns: minmax(300px, 0.82fr) minmax(520px, 1.28fr) minmax(360px, 0.84fr);
  grid-template-rows: 56px minmax(0, 1fr);
  gap: 8px 10px;
}

.builder-heading {
  min-height: 56px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.builder-steps {
  min-height: 56px;
  padding: 5px 8px;
  gap: 6px;
  align-items: center;
}

.builder-steps li {
  grid-template-rows: 26px auto;
  gap: 3px;
  padding: 3px 5px;
}

.builder-steps span {
  width: 26px;
  height: 26px;
  font-size: 13px;
}

.builder-steps li:not(:last-child)::after {
  top: 16px;
  left: calc(50% + 15px);
  right: calc(-50% + 15px);
}

.builder-step,
.builder-step.active {
  gap: 7px;
  padding: 10px;
}

.builder-step[data-builder-step="2"] {
  grid-template-rows: auto auto 104px auto minmax(118px, 1fr);
}

.builder-step[data-builder-step="2"]::after {
  content: none;
  display: none;
}

.builder-step[data-builder-step="3"] {
  grid-template-rows: auto auto minmax(160px, 1fr);
}

.builder-step[data-builder-step="3"]::after {
  min-height: 160px;
  padding: 16px;
}

.capture-checklist {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.capture-checklist > div {
  align-items: center;
}

.capture-checklist > div strong {
  font-size: 13px;
}

.capture-checklist > div small {
  font-size: 11px;
}

.capture-check-item {
  min-width: 0;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(76, 78, 229, 0.11);
  border-radius: 8px;
  color: #313653;
  background: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 880;
  line-height: 1.2;
}

.capture-check-item i {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  background: linear-gradient(135deg, #5651ef, #2fc7a8);
  box-shadow: 0 7px 14px rgba(76, 78, 229, 0.16);
  font-size: 12px;
  font-style: normal;
  line-height: 1;
}

.builder-upload {
  min-height: 104px;
  padding: 10px 12px;
}

.builder-upload .upload-icon {
  width: 38px;
  height: 38px;
  font-size: 21px;
}

.builder-doc-card {
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
}

.builder-doc-card p {
  margin: 5px 0 0;
  padding: 6px 8px;
  font-size: 11px;
}

.builder-doc-card .link-button {
  justify-self: end;
  white-space: nowrap;
}

.reference-library {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.74fr);
  grid-auto-rows: min-content;
  gap: 8px;
  padding: 8px;
  overflow: hidden;
}

.reference-section {
  min-width: 0;
  gap: 5px;
}

.reference-section > strong {
  font-size: 12px;
}

.reference-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.reference-section:first-child .reference-grid figure:nth-child(n + 4) {
  display: none;
}

.reference-grid figure {
  gap: 3px;
  font-size: 9px;
}

.reference-grid img {
  height: 46px;
}

.guide-video-card {
  grid-column: 1 / -1;
  gap: 8px;
  padding: 7px 9px;
}

.guide-video-icon {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.guide-video-card strong {
  font-size: 12px;
}

.guide-video-card small {
  font-size: 10px;
  line-height: 1.25;
}

.training-card {
  min-height: 104px;
  align-items: center;
}

@keyframes builderGlowSweep {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes builderScanLine {
  0%,
  100% {
    transform: translateX(-18%);
    opacity: 0.28;
  }
  50% {
    transform: translateX(18%);
    opacity: 1;
  }
}

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

@keyframes builderHeadingIconFloat {
  0%,
  100% {
    transform: translateY(-50%);
  }
  50% {
    transform: translateY(calc(-50% - 3px));
  }
}

@keyframes builderPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes builderRenderSweep {
  0%,
  100% {
    transform: translateX(-22%);
    opacity: 0.28;
  }
  50% {
    transform: translateX(22%);
    opacity: 1;
  }
}

@keyframes builderRenderRing {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.65;
  }
  50% {
    transform: scale(0.94);
    opacity: 1;
  }
}

@keyframes builderAvatarScan {
  0% {
    transform: translateY(-18px);
    opacity: 0;
  }
  22%,
  72% {
    opacity: 1;
  }
  100% {
    transform: translateY(92px);
    opacity: 0;
  }
}

@keyframes builderAvatarBreath {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
  50% {
    transform: translateY(-3px) scale(1.02);
    filter: saturate(1.12);
  }
}

@keyframes builderProgressFlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes builderProgressSpark {
  0%,
  100% {
    transform: translateX(-24px);
    opacity: 0.15;
  }
  50% {
    transform: translateX(18px);
    opacity: 0.9;
  }
}

@media (max-width: 1180px) {
  .builder-main {
    overflow: auto;
  }

  .builder-shell {
    height: auto;
    grid-template-columns: 1fr;
  }

  .builder-heading,
  .builder-steps,
  .builder-step[data-builder-step] {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .builder-heading-icon,
  .builder-heading::after,
  .builder-step::before,
  .builder-upload .upload-icon,
  .training-card.is-generating::after,
  .training-card.is-generating .training-visual::before,
  .training-card.is-generating .training-visual::after,
  .training-card.is-generating .training-face,
  .training-card.is-generating .training-copy strong::before,
  .training-card.is-generating .progress-line span,
  .training-card.is-generating .progress-line span::after {
    animation: none;
  }
}

/* Wider, denser avatar-training workspace. Keeps the whole workflow visible while
   making labels and controls easier to read on large desktop screens. */
.avatar-builder {
  grid-template-rows: 52px minmax(0, 1fr) 58px;
  font-size: 16px;
}

.builder-main {
  padding: 12px 26px 8px;
}

.builder-shell {
  width: min(1880px, calc(100vw - 52px));
  grid-template-columns: minmax(410px, 0.96fr) minmax(620px, 1.46fr) minmax(390px, 0.94fr);
  grid-template-rows: 72px minmax(0, 1fr);
  gap: 12px 14px;
}

.builder-heading {
  min-height: 72px;
  padding: 12px 18px 12px 68px;
}

.builder-heading-icon {
  left: 18px;
  width: 38px;
  height: 38px;
}

.builder-heading h1 {
  font-size: 27px;
  line-height: 1.08;
}

.builder-heading p {
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 780;
}

.builder-steps {
  min-height: 72px;
  padding: 8px 10px;
  gap: 8px;
}

.builder-steps li {
  grid-template-rows: 32px auto;
  gap: 5px;
  font-size: 15px;
}

.builder-steps span {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.builder-steps li:not(:last-child)::after {
  top: 21px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
}

.builder-step,
.builder-step.active {
  gap: 11px;
  padding: 14px;
  overflow: auto;
  scrollbar-width: thin;
}

.builder-step h2 {
  gap: 10px;
  margin-bottom: 3px;
  font-size: 20px;
}

.builder-step h2::before {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
}

.builder-step[data-builder-step="1"] {
  gap: 10px;
}

.builder-step[data-builder-step="2"] {
  grid-template-rows: auto auto minmax(132px, auto) auto minmax(0, 1fr);
}

.builder-step[data-builder-step="3"] {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.builder-step[data-builder-step="3"]::after {
  min-height: 300px;
  font-size: 16px;
}

.builder-step[data-builder-step="1"] .builder-field,
.builder-toggle-row {
  gap: 8px;
  padding: 11px 13px;
}

.builder-field,
.builder-toggle-row {
  font-size: 15px;
}

.builder-field > span:first-child,
.builder-toggle-row > span {
  font-weight: 900;
}

.builder-field input,
.builder-field select,
.builder-field textarea {
  min-height: 42px;
  padding-inline: 13px;
  font-size: 15px;
}

.builder-field input,
.builder-field select {
  height: 42px;
  line-height: 42px;
}

.counted-input em {
  font-size: 16px;
}

.radio-cluster {
  gap: 18px;
}

.radio-cluster label {
  font-size: 16px;
}

.radio-cluster input {
  width: 22px;
  height: 22px;
}

.builder-motion-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 13px;
}

.builder-motion-grid .motion-control span {
  font-size: 14px;
}

.builder-motion-grid .motion-control em {
  min-width: 42px;
  text-align: center;
}

.builder-style-note {
  font-size: 13px;
  line-height: 1.45;
}

.builder-script-field textarea {
  min-height: 104px;
  line-height: 1.55;
}

.capture-checklist {
  gap: 8px;
  padding: 12px;
}

.capture-checklist > div strong {
  font-size: 16px;
}

.capture-checklist > div small {
  font-size: 13px;
}

.capture-check-item {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 14px;
}

.capture-check-item i {
  flex-basis: 22px;
  width: 22px;
  height: 22px;
  font-size: 14px;
}

.builder-upload {
  min-height: 132px;
  gap: 8px;
  padding: 16px;
}

.builder-upload .upload-icon {
  width: 48px;
  height: 48px;
  font-size: 26px;
}

.builder-upload strong {
  font-size: 17px;
}

.builder-upload small {
  font-size: 13px;
}

.builder-doc-card {
  padding: 12px 14px;
}

.builder-doc-card strong {
  font-size: 17px;
}

.builder-doc-card p {
  padding: 8px 10px;
  font-size: 14px;
}

.builder-doc-card .link-button {
  font-size: 15px;
}

.reference-library {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.86fr);
  gap: 10px 12px;
  padding: 12px;
}

.reference-section > strong {
  font-size: 16px;
}

.reference-grid {
  gap: 8px;
}

.reference-grid figure {
  gap: 5px;
  font-size: 11px;
}

.reference-grid img {
  height: 60px;
}

.guide-video-card {
  padding: 10px 12px;
}

.guide-video-icon {
  width: 38px;
  height: 38px;
}

.guide-video-card strong {
  font-size: 16px;
}

.guide-video-card small {
  font-size: 13px;
}

.draft-preview-panel,
.quality-panel,
.builder-upload-status {
  padding: 13px;
}

.draft-controls label {
  grid-template-columns: 150px minmax(0, 1fr);
  font-size: 14px;
}

.quality-summary,
.builder-file-item {
  font-size: 14px;
}

.training-card {
  grid-template-columns: 116px minmax(0, 1fr);
  min-height: 124px;
  gap: 14px;
  padding: 16px;
}

.training-visual {
  height: 116px;
}

.training-copy strong {
  font-size: 18px;
}

.training-copy strong::before {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.training-card p {
  font-size: 15px;
  line-height: 1.55;
}

.training-card .progress-line {
  height: 8px;
  margin-top: 12px;
}

.generated-avatar-card {
  grid-template-columns: 82px minmax(0, 1fr);
  padding: 16px;
}

.generated-thumb {
  height: 90px;
}

.generated-avatar-card strong {
  font-size: 17px;
}

.generated-avatar-card small {
  font-size: 14px;
}

.builder-footer .primary,
.builder-footer .secondary {
  height: 46px;
  min-width: 138px;
  font-size: 17px;
}

@media (min-width: 1800px) {
  .builder-shell {
    grid-template-columns: minmax(460px, 0.98fr) minmax(720px, 1.5fr) minmax(450px, 0.98fr);
  }
}

@media (max-height: 900px) {
  .avatar-builder {
    font-size: 15px;
  }

  .builder-main {
    padding: 8px 20px 6px;
  }

  .builder-shell {
    grid-template-rows: 62px minmax(0, 1fr);
    gap: 8px 10px;
  }

  .builder-heading,
  .builder-steps {
    min-height: 62px;
  }

  .builder-heading h1 {
    font-size: 23px;
  }

  .builder-heading p,
  .capture-checklist > div small,
  .builder-upload small,
  .guide-video-card small {
    font-size: 12px;
  }

  .builder-step,
  .builder-step.active {
    padding: 10px;
    gap: 8px;
  }

  .builder-step h2 {
    font-size: 17px;
  }

  .builder-field input,
  .builder-field select {
    height: 36px;
    min-height: 36px;
    line-height: 36px;
  }

  .builder-upload {
    min-height: 108px;
  }

  .reference-grid img {
    height: 46px;
  }

  .training-card {
    min-height: 104px;
    padding: 12px;
  }
}

.modal-backdrop,
.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(17, 24, 39, 0.32);
}

.modal-backdrop {
  display: grid;
  place-items: center;
}

.ratio-modal {
  position: relative;
  width: min(720px, calc(100vw - 40px));
  min-height: 450px;
  padding: 30px 36px 78px;
  border-radius: 8px;
  background: #ffffff;
}

.ratio-modal h2 {
  font-size: 26px;
}

.ratio-modal p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font-size: 34px;
  line-height: 1;
}

.ratio-modal .modal-close {
  position: absolute;
  top: 22px;
  right: 24px;
}

.ratio-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
  margin: 42px 18px 0;
}

.ratio-card {
  display: grid;
  place-items: center;
  gap: 16px;
  background: transparent;
  color: var(--text);
}

.ratio-card strong {
  font-size: 23px;
}

.ratio-illustration {
  width: 226px;
  height: 170px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(216, 222, 232, 0.42) 1px, transparent 1px),
    linear-gradient(rgba(216, 222, 232, 0.42) 1px, transparent 1px),
    #fbfcff;
  background-size: 44px 44px;
}

.ratio-illustration::before {
  content: "";
  border: 2px solid #7b7eff;
  border-radius: 8px;
  background: #ffffff;
}

.ratio-illustration.landscape::before {
  width: 176px;
  height: 74px;
}

.ratio-illustration.portrait::before {
  width: 94px;
  height: 142px;
}

.ratio-card.selected .ratio-illustration {
  box-shadow: inset 0 0 0 2px rgba(77, 80, 232, 0.12);
}

.modal-action {
  position: absolute;
  right: 36px;
  bottom: 26px;
  height: 44px;
  padding: 0 26px;
  font-size: 17px;
}

.scenario-modal {
  position: relative;
  width: min(1420px, calc(100vw - 44px));
  min-height: 760px;
  padding: 56px 46px 112px;
  border-radius: 8px;
  background: #ffffff;
}

.scenario-modal .modal-close {
  position: absolute;
  top: 24px;
  right: 28px;
}

.scenario-modal h2 {
  font-size: 34px;
}

.scenario-modal p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 24px;
  font-weight: 800;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 86px;
}

.scenario-card {
  min-height: 590px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 388px auto auto;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
}

.scenario-card.selected,
.scenario-card:hover {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.scenario-visual {
  display: block;
  background-position: center;
  background-size: cover;
}

.scenario-visual.video {
  background-image:
    linear-gradient(180deg, rgba(88, 119, 255, 0.2), rgba(88, 119, 255, 0.2)),
    url("/console-assets/generated/cutout/fresh-avatar-01.png?v=20260703-platform-cutout-only");
}

.scenario-visual.chat {
  background-image:
    linear-gradient(180deg, rgba(219, 227, 112, 0.22), rgba(219, 227, 112, 0.22)),
    url("/console-assets/generated/cutout/fresh-avatar-06.png?v=20260703-platform-cutout-only");
}

.scenario-visual.live {
  background-image:
    linear-gradient(180deg, rgba(145, 123, 255, 0.22), rgba(145, 123, 255, 0.22)),
    url("/console-assets/generated/cutout/fresh-avatar-10.png?v=20260703-platform-cutout-only");
}

.scenario-card strong {
  padding: 0 32px;
  font-size: 28px;
  font-weight: 900;
}

.scenario-card small {
  padding: 0 32px 34px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.scenario-action {
  position: absolute;
  right: 46px;
  bottom: 42px;
  min-width: 136px;
  height: 56px;
  font-size: 22px;
}

.drawer {
  display: grid;
  justify-items: end;
}

.drawer-panel {
  width: min(560px, 100vw);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 26px;
  overflow: auto;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.voice-clone-panel {
  width: min(1120px, 100vw);
}

.voice-clone-modal {
  place-items: center;
  justify-items: center;
  padding: 28px;
}

.voice-clone-modal .voice-clone-panel {
  width: min(1040px, calc(100vw - 48px));
  height: auto;
  max-height: calc(100vh - 48px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 8px;
  overflow: hidden;
}

.voice-clone-modal .clone-layout {
  min-height: 0;
  max-height: min(560px, calc(100vh - 184px));
  overflow: auto;
}

.voice-clone-modal .drawer-actions {
  padding-top: 0;
}

.clone-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 540px;
  margin: 0 -26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.clone-form {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 32px;
  border-right: 1px solid var(--line);
}

.clone-form .custom-select-button {
  height: 42px;
  min-height: 42px;
  font-size: 18px;
  font-weight: 900;
}

.radio-line {
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}

.radio-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.clone-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
  font-weight: 760;
}

.clone-recorder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 26px;
  padding: 48px;
  background: #f2f0ff;
}

.voice-clone-modal.upload-mode [data-clone-mode-panel="record"],
.voice-clone-modal.record-mode [data-clone-mode-panel="upload"] {
  display: none;
}

.voice-clone-modal.upload-mode .clone-recorder {
  align-content: center;
}

.sample-copy {
  width: min(640px, 100%);
  padding: 44px;
  border-radius: 8px;
  color: #3b3d4f;
  background: #ffffff;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.55;
}

.clone-upload {
  width: min(520px, 100%);
  min-height: 180px;
  background: transparent;
}

.clone-upload small {
  max-width: 430px;
  line-height: 1.6;
}

.clone-training-text {
  width: min(520px, 100%);
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(76, 78, 229, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.clone-training-text textarea {
  width: 100%;
  min-height: 78px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
  line-height: 1.55;
}

.clone-progress {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

.clone-progress[hidden] {
  display: none;
}

.clone-progress-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.clone-progress-head > span:last-child {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.clone-spinner,
.clone-complete-icon,
.clone-failed-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.clone-spinner {
  border: 4px solid rgba(79, 70, 229, 0.14);
  border-top-color: var(--accent);
  animation: cloneSpin 0.82s linear infinite;
}

.clone-complete-icon,
.clone-failed-icon {
  display: none;
  place-items: center;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.clone-complete-icon {
  background: #20c072;
}

.clone-failed-icon {
  background: #ef4444;
}

.clone-progress[data-status="complete"] .clone-spinner,
.clone-progress[data-status="complete"] .clone-failed-icon,
.clone-progress[data-status="error"] .clone-spinner,
.clone-progress[data-status="error"] .clone-complete-icon {
  display: none;
}

.clone-progress[data-status="complete"] .clone-complete-icon,
.clone-progress[data-status="error"] .clone-failed-icon {
  display: grid;
}

.clone-progress strong {
  font-size: 18px;
  font-weight: 900;
}

.clone-progress small {
  color: var(--muted);
  font-weight: 760;
}

.clone-waiting-bars {
  height: 28px;
  display: flex;
  align-items: end;
  gap: 6px;
  padding-left: 56px;
}

.clone-waiting-bars span {
  width: 7px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #827cff, #4f46e5);
  animation: cloneWave 0.82s ease-in-out infinite;
}

.clone-waiting-bars span:nth-child(2) {
  animation-delay: 0.12s;
}

.clone-waiting-bars span:nth-child(3) {
  animation-delay: 0.24s;
}

.clone-waiting-bars span:nth-child(4) {
  animation-delay: 0.36s;
}

.clone-progress[data-status="complete"] .clone-waiting-bars,
.clone-progress[data-status="error"] .clone-waiting-bars {
  display: none;
}

.clone-progress[data-status="complete"] .progress-line span {
  background: #20c072;
}

.clone-progress[data-status="error"] .progress-line span {
  background: #ef4444;
}

.voice-clone-modal.clone-busy #confirmVoiceClone {
  display: none;
}

.voice-clone-modal.clone-busy .consent-check {
  opacity: 0.45;
  pointer-events: none;
}

.voice-clone-modal.clone-complete .consent-check {
  display: none;
}

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

@keyframes cloneWave {
  0%,
  100% {
    height: 10px;
    opacity: 0.55;
  }

  50% {
    height: 28px;
    opacity: 1;
  }
}

.record-control {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font-weight: 900;
}

.record-control small {
  color: var(--muted);
  font-weight: 760;
}

.record-control.recording .record-dot {
  animation: recordPulse 1s infinite;
}

.record-dot {
  width: 92px;
  height: 92px;
  border: 10px solid #fff2f2;
  border-radius: 50%;
  background: #ff4d55;
}

@keyframes recordPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 77, 85, 0.28);
  }

  50% {
    box-shadow: 0 0 0 16px rgba(255, 77, 85, 0);
  }
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
}

.consent-check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-weight: 760;
}

.consent-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.toast,
.error-box {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 60;
  transform: translateX(-50%);
  color: #ffffff;
  background: rgba(36, 38, 63, 0.92);
  font-weight: 760;
}

.error-box {
  border: 1px solid #ffc9c9;
  color: var(--danger);
  background: #fff7f7;
}

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

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.job-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.job-row button,
.download-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 1260px) {
  .login-gallery {
    inset: 10px 0 0 clamp(300px, 28vw, 420px);
  }

  .login-copy h1 {
    font-size: 44px;
  }

  .login-subtitle {
    font-size: 36px;
  }

  .library-avatar-grid,
  .library-my-avatar-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .library-voice-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }

  .scenario-grid {
    gap: 18px;
  }

  .scenario-card {
    grid-template-rows: 320px auto auto;
    min-height: 520px;
  }

  .product {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .nav-brand strong,
  .nav-section span:not(.nav-section-icon),
  .nav-text {
    font-size: 0;
  }

  .nav-section,
  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .video-create-nav {
    min-height: 44px;
    margin-bottom: 10px;
  }

  .nav-icon {
    font-size: 24px;
  }

  .workspace {
    grid-template-columns: 68px 430px minmax(560px, 1fr);
  }

  .voice-mark-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .pronunciation-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .login-screen {
    min-height: auto;
    overflow: auto;
  }

  .login-nav {
    height: auto;
    gap: 18px;
    padding: 18px 20px;
  }

  .login-nav nav {
    gap: 14px;
    font-size: 14px;
  }

  .login-nav nav button:not(.login-nav-button) {
    display: none;
  }

  .login-hero {
    min-height: calc(100vh - 74px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 20px 44px;
  }

  .login-gallery {
    position: relative;
    inset: auto;
    grid-row: 1;
    width: min(420px, calc(100vw - 32px));
    height: 260px;
    margin: 0;
    opacity: 0.82;
  }

  .login-gallery::before {
    width: 34%;
  }

  .gallery-track {
    gap: 10px;
  }

  .gallery-tile,
  .gallery-tile.wide {
    width: 220px;
    height: 116px;
  }

  .gallery-tile.small {
    width: 144px;
    height: 116px;
  }

  .gallery-tile.tall {
    width: 170px;
    height: 156px;
  }

  .login-copy {
    padding-bottom: 0;
  }

  .login-kicker {
    font-size: 20px;
  }

  .login-copy h1 {
    margin-top: 16px;
    font-size: 36px;
    white-space: normal;
  }

  .login-subtitle {
    font-size: 28px;
    white-space: normal;
  }

  .login-cta {
    height: 48px;
    margin-top: 28px;
    padding: 0 24px;
    font-size: 17px;
  }

  .login-card {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100%;
    margin-top: 0;
  }

  .login-card p {
    white-space: normal;
  }

  .ratio-modal {
    width: min(560px, calc(100vw - 28px));
    min-height: auto;
    max-height: calc(100vh - 28px);
    overflow: auto;
    padding: 28px 24px 86px;
  }

  .ratio-options {
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 32px 0 0;
  }

  .ratio-illustration {
    width: min(250px, 70vw);
  }

  .library-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-search {
    width: min(100%, 320px);
  }

  .scenario-modal {
    min-height: auto;
    max-height: calc(100vh - 32px);
    overflow: auto;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
    margin-top: 36px;
  }

  .scenario-card {
    min-height: 420px;
    grid-template-rows: 260px auto auto;
  }

  .library-voice-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .voice-compose-head,
  .voice-compose-actions,
  .voice-preview-row {
    align-items: stretch;
    flex-direction: column;
  }

  #voiceLibraryPage { padding: 20px 16px 32px; min-width: 0; }
  #voiceLibraryPage .library-topbar { padding-right: 52px; }
  #libraryVoiceTabs { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; min-width: 0; }
  #libraryVoiceTabs > button { flex: 0 0 auto; white-space: nowrap; }
  #libraryVoiceTabs > button > span { white-space: nowrap; }
  #voiceComposePanel { width: 100%; min-width: 0; padding: 16px; }
  #voiceComposePanel .voice-compose-head { flex-wrap: wrap; gap: 12px; }
  #voiceComposePanel .voice-compose-heading { min-width: 0; width: 100%; }
  #voiceComposePanel .voice-compose-title-row { flex-wrap: wrap; }
  #voiceComposePanel .current-voice-badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  #voiceComposePanel #selectedVoiceHint { white-space: normal; overflow-wrap: anywhere; }

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

  .voice-mark-grid {
    grid-template-columns: 1fr;
  }

  .voice-rule-form {
    grid-template-columns: 1fr;
  }

  .voice-rule-form .secondary,
  .voice-rule-form .primary {
    grid-column: auto;
  }

  .voice-speed-control {
    grid-template-columns: 1fr;
  }

  .voice-reading-loop {
    width: 100%;
    flex-basis: auto;
    grid-template-columns: auto minmax(72px, 1fr) auto;
  }

  .voice-reading-loop input {
    width: 100%;
  }

  .voice-lab-controls {
    grid-template-columns: 1fr;
  }

  .voice-select-modal {
    width: min(640px, calc(100vw - 28px));
    padding: 24px;
  }

  .voice-select-grid {
    grid-template-columns: 1fr;
  }

  .videos-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 24px 0;
  }

  .videos-hero-art {
    height: 220px;
  }

  .videos-hero-art.reference-hero-art {
    height: 164px;
  }

  .hero-person {
    right: 20%;
    width: 220px;
    height: 220px;
  }

  .face-a {
    right: 58%;
    top: 48px;
  }

  .face-b {
    right: 46%;
    top: 118px;
  }

  .face-c {
    right: 8%;
    top: 92px;
  }

  .product {
    display: block;
  }

  .main-nav {
    min-height: auto;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto;
    align-items: center;
    padding-right: 72px;
  }

  .main-nav nav {
    grid-auto-flow: column;
    grid-auto-columns: 52px;
    min-width: 0;
    overflow: auto;
  }

  .main-nav .nav-section {
    display: none;
  }

  .nav-footer {
    display: none;
  }

  .workspace {
    grid-template-columns: 56px minmax(300px, 1fr);
  }

  .stage-column {
    grid-column: 1 / -1;
    min-height: 720px;
  }

  .studio-topbar,
  .top-actions {
    flex-wrap: wrap;
    height: auto;
    padding-block: 10px;
  }

  .script-segment-card {
    padding: 12px;
  }

  .script-segment-card .speaker-row {
    grid-template-columns: 24px 24px minmax(0, 1fr) 28px;
  }

  .script-segment-card .speaker-row .dots {
    display: none;
  }

  .segment-card-actions {
    flex-wrap: wrap;
  }

  .voice-clone-modal {
    padding: 14px;
    align-items: start;
  }

  .voice-clone-modal .voice-clone-panel {
    width: min(100%, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    overflow: auto;
  }

  .voice-clone-modal .clone-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .voice-clone-modal .clone-form {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sample-copy {
    padding: 28px;
    font-size: 20px;
  }
}

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

/* Studio fit override: keep editor preview and timeline in one viewport. */
.product.creation-mode {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.product.creation-mode .studio {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.product.creation-mode .workspace,
.product.creation-mode .stage-column {
  min-height: 0;
  overflow: hidden;
}

.product.creation-mode .stage-column {
  grid-template-rows: 52px minmax(0, 1fr) 150px;
}

.product.creation-mode .canvas-toolbar {
  padding: 0 42px;
}

.product.creation-mode .preview-wrap {
  min-height: 0;
  padding: 8px 24px 10px;
}

.product.creation-mode .preview-canvas.ratio-9-16 {
  width: min(38vw, 360px, calc((100vh - 300px) * 9 / 16));
}

.product.creation-mode .preview-canvas.ratio-16-9 {
  width: min(58vw, 760px, calc((100vh - 300px) * 16 / 9));
}

.product.creation-mode .timeline {
  grid-template-columns: 64px 72px minmax(0, 1fr) 38px;
  gap: 10px;
  padding: 12px 20px;
}

.product.creation-mode .play-button {
  width: 44px;
  height: 44px;
}

.product.creation-mode .track {
  min-height: 96px;
  padding: 12px 4px 4px 0;
}

.product.creation-mode .clip {
  width: 214px;
  flex-basis: 214px;
  height: 78px;
  grid-template-columns: 58px 1fr;
}

@media (max-height: 840px) {
  .product.creation-mode .studio {
    grid-template-rows: 52px minmax(0, 1fr);
  }

  .product.creation-mode .studio-topbar {
    padding: 0 88px 0 18px;
  }

  .product.creation-mode .stage-column {
    grid-template-rows: 46px minmax(0, 1fr) 136px;
  }

  .product.creation-mode .preview-wrap {
    padding: 6px 20px 8px;
  }

  .product.creation-mode .preview-canvas.ratio-9-16 {
    width: min(34vw, 320px, calc((100vh - 304px) * 9 / 16));
  }

  .product.creation-mode .preview-canvas.ratio-16-9 {
    width: min(54vw, 680px, calc((100vh - 304px) * 16 / 9));
  }

  .product.creation-mode .timeline {
    grid-template-columns: 58px 68px minmax(0, 1fr) 34px;
    padding: 8px 18px;
  }

  .product.creation-mode .play-button {
    width: 40px;
    height: 40px;
  }

  .product.creation-mode .track {
    min-height: 86px;
    padding-top: 10px;
  }

  .product.creation-mode .clip {
    width: 190px;
    flex-basis: 190px;
    height: 70px;
    grid-template-columns: 52px 1fr;
  }
}

@media (max-width: 1180px) {
  .system-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-two-column,
  .voice-lab-layout,
  .system-settings-form {
    grid-template-columns: 1fr;
  }

  .voice-lab-guardrails {
    grid-template-columns: 1fr;
  }

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

  .audit-summary-grid {
    grid-template-columns: 1fr;
  }

  .audit-top-actions {
    justify-content: stretch;
  }

  .audit-user-filter,
  .audit-top-actions button {
    flex: 1 1 180px;
  }

  .audit-item-head {
    display: grid;
  }
}

/* Avatar builder final containment pass: keep the whole training workflow inside
   the viewport and avoid misleading pre-generation previews. */
.avatar-builder {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  grid-template-rows: 48px minmax(0, 1fr) 48px !important;
  overflow: hidden;
  font-size: 14px;
}

.builder-topbar {
  min-width: 0;
  height: 48px;
}

.builder-main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px 6px !important;
}

.builder-shell {
  width: 100% !important;
  max-width: none;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: minmax(300px, 0.78fr) minmax(500px, 1.24fr) minmax(300px, 0.78fr) !important;
  grid-template-rows: 56px minmax(0, 1fr) !important;
  gap: 8px 10px !important;
  box-sizing: border-box;
}

.builder-heading,
.builder-steps,
.builder-step,
.builder-step.active {
  min-width: 0;
  box-sizing: border-box;
}

.builder-heading {
  min-height: 56px !important;
  padding: 8px 14px 8px 58px !important;
  border-radius: 8px;
}

.builder-heading-icon {
  left: 14px !important;
  width: 32px !important;
  height: 32px !important;
}

.builder-heading h1 {
  font-size: 20px !important;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-heading p {
  font-size: 12px !important;
  line-height: 1.15;
}

.builder-steps {
  min-height: 56px !important;
  padding: 5px 8px !important;
}

.builder-steps li {
  min-width: 0;
  grid-template-rows: 26px auto !important;
  gap: 3px !important;
  padding: 3px 5px !important;
  font-size: 12px !important;
}

.builder-steps strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-steps span {
  width: 26px !important;
  height: 26px !important;
  font-size: 13px !important;
}

.builder-steps li:not(:last-child)::after {
  top: 16px !important;
  left: calc(50% + 15px) !important;
  right: calc(-50% + 15px) !important;
}

.builder-step,
.builder-step.active {
  height: 100%;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  gap: 7px !important;
  padding: 10px !important;
  border-radius: 8px;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.builder-step h2 {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 30px;
  margin: -2px 0 1px !important;
  padding: 2px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  font-size: 16px !important;
  line-height: 1.15 !important;
}

.builder-step h2::before {
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px;
}

.builder-step[data-builder-step]::after {
  display: none !important;
  content: none !important;
}

.builder-step[data-builder-step="1"] {
  grid-column: 1;
  grid-row: 2;
}

.builder-step[data-builder-step="2"] {
  grid-column: 2;
  grid-row: 2;
  display: flex !important;
  flex-direction: column;
}

.builder-step[data-builder-step="3"] {
  grid-column: 3;
  grid-row: 2;
  display: flex !important;
  flex-direction: column;
}

.builder-step[data-builder-step="1"] .builder-field,
.builder-toggle-row {
  min-width: 0;
  gap: 6px !important;
  padding: 8px 9px !important;
}

.builder-field,
.builder-toggle-row,
.counted-input,
.custom-select,
.motion-control-grid,
.draft-preview-panel,
.quality-panel,
.builder-doc-card,
.reference-library,
.training-card {
  min-width: 0;
}

.builder-field input,
.builder-field select,
.builder-field textarea,
.builder-field .custom-select-button {
  width: 100%;
  min-width: 0;
  min-height: 34px !important;
  font-size: 13px !important;
}

.builder-field input,
.builder-field select,
.builder-field .custom-select-button {
  height: 34px !important;
  line-height: 34px !important;
}

.radio-cluster {
  flex-wrap: wrap;
  gap: 10px 16px !important;
}

.radio-cluster label {
  font-size: 14px !important;
}

.radio-cluster input {
  width: 18px !important;
  height: 18px !important;
}

.builder-style-note {
  margin: -2px 2px 2px;
  font-size: 11px !important;
  line-height: 1.35;
}

.builder-motion-grid {
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  padding: 8px !important;
}

.motion-control {
  min-width: 0;
}

.builder-script-field textarea {
  min-height: 74px !important;
  max-height: 110px;
}

.capture-checklist {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  padding: 8px !important;
}

.capture-checklist > div {
  min-width: 0;
}

.capture-checklist > div strong {
  font-size: 14px !important;
}

.capture-checklist > div small {
  font-size: 11px !important;
  white-space: nowrap;
}

.capture-check-item {
  position: relative;
  min-width: 0;
  min-height: 30px !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.capture-check-item i {
  flex: 0 0 20px !important;
  width: 20px !important;
  height: 20px !important;
  color: #8d94ad !important;
  background: #f0f2fb !important;
  box-shadow: none !important;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.capture-check-item span {
  min-width: 0;
}

.capture-check-item.checked {
  border-color: rgba(86, 81, 239, 0.42) !important;
  background: linear-gradient(135deg, rgba(86, 81, 239, 0.1), rgba(47, 199, 168, 0.08)) !important;
  box-shadow: 0 10px 24px rgba(86, 81, 239, 0.08);
}

.capture-check-item.checked i {
  color: #fff !important;
  background: linear-gradient(135deg, #5651ef, #2fc7a8) !important;
  box-shadow: 0 7px 14px rgba(76, 78, 229, 0.16) !important;
}

.capture-checklist.needs-attention {
  border-color: rgba(255, 76, 76, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(255, 76, 76, 0.08);
}

.capture-checklist.is-complete {
  border-color: rgba(35, 197, 132, 0.5) !important;
  background: linear-gradient(145deg, #ffffff, #f6fffb) !important;
}

.builder-upload {
  min-height: 104px !important;
  gap: 6px !important;
  padding: 12px !important;
}

.builder-upload .upload-icon {
  width: 40px !important;
  height: 40px !important;
  font-size: 22px !important;
}

.builder-upload strong {
  font-size: 14px !important;
}

.builder-upload small {
  max-width: 90%;
  font-size: 11px !important;
}

.builder-upload-status {
  gap: 6px !important;
  padding: 9px !important;
}

.builder-file-list {
  max-height: 92px !important;
  overflow: auto;
}

.builder-file-item {
  min-height: 26px !important;
  padding: 4px 7px !important;
  font-size: 12px !important;
}

.draft-preview-panel {
  grid-template-columns: 96px minmax(0, 1fr) !important;
  gap: 9px !important;
  padding: 9px !important;
}

.draft-preview-stage {
  height: 116px !important;
}

.draft-controls {
  gap: 6px !important;
}

.draft-controls label {
  grid-template-columns: 120px minmax(0, 1fr) !important;
  gap: 7px !important;
  font-size: 12px !important;
}

.quality-panel {
  gap: 6px !important;
  padding: 9px !important;
}

.quality-summary {
  font-size: 12px !important;
}

.quality-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

.quality-detail-card {
  padding: 7px !important;
  gap: 4px !important;
}

.quality-detail-card p {
  font-size: 11px !important;
}

.builder-doc-card {
  padding: 9px !important;
}

.builder-doc-card p {
  padding: 6px 8px !important;
  font-size: 12px !important;
}

.reference-library {
  grid-template-columns: 1fr 0.8fr !important;
  align-items: start;
  gap: 8px 10px !important;
  padding: 9px !important;
}

.reference-section {
  gap: 6px !important;
}

.reference-section > strong {
  font-size: 13px !important;
}

.reference-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

.reference-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.reference-grid img {
  height: 42px !important;
  border-radius: 7px !important;
}

.reference-grid figure {
  font-size: 10px !important;
}

.guide-video-card {
  grid-column: 1 / -1;
  padding: 8px 10px !important;
}

.training-card {
  flex: 0 0 auto;
  grid-template-columns: 78px minmax(0, 1fr) !important;
  gap: 10px !important;
  min-height: 102px !important;
  padding: 12px !important;
}

.training-visual {
  height: 78px !important;
  border-radius: 10px;
}

.training-visual:not(.has-preview) {
  background:
    radial-gradient(circle at 50% 38%, rgba(76, 78, 229, 0.1), transparent 34%),
    linear-gradient(135deg, #f4f7ff, #eef4ff);
}

.training-visual:not(.has-preview)::after {
  content: "待生成";
  position: absolute;
  inset: auto 8px 8px;
  display: grid;
  place-items: center;
  min-height: 20px;
  border-radius: 999px;
  color: #5651ef;
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 900;
}

.training-visual:not(.has-preview) .training-face {
  display: none;
}

.training-copy strong {
  font-size: 15px !important;
}

.training-card p {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.training-card .progress-line {
  height: 6px !important;
  margin-top: 8px !important;
}

.generated-avatar-card {
  flex: 0 0 auto;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  padding: 10px !important;
}

.generated-thumb {
  height: 62px !important;
}

.builder-footer {
  min-width: 0;
  height: 48px;
  padding: 6px 12px !important;
}

.builder-footer .primary,
.builder-footer .secondary {
  height: 38px !important;
  min-width: 118px !important;
  padding: 0 18px !important;
  font-size: 14px !important;
}

@media (max-width: 1360px) {
  .builder-shell {
    grid-template-columns: minmax(270px, 0.76fr) minmax(430px, 1.16fr) minmax(270px, 0.76fr) !important;
  }

  .builder-heading h1 {
    font-size: 18px !important;
  }

  .reference-library {
    grid-template-columns: 1fr !important;
  }
}

@media (max-height: 820px) {
  .avatar-builder {
    grid-template-rows: 44px minmax(0, 1fr) 44px !important;
    font-size: 13px;
  }

  .builder-main {
    padding: 6px 8px 4px !important;
  }

  .builder-shell {
    grid-template-rows: 50px minmax(0, 1fr) !important;
    gap: 6px 8px !important;
  }

  .builder-heading,
  .builder-steps {
    min-height: 50px !important;
  }

  .builder-heading {
    padding-left: 50px !important;
  }

  .builder-heading-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .builder-heading h1 {
    font-size: 17px !important;
  }

  .builder-step,
  .builder-step.active {
    gap: 5px !important;
    padding: 8px !important;
  }

  .builder-field,
  .builder-toggle-row {
    padding: 6px 8px !important;
  }

  .builder-upload {
    min-height: 88px !important;
  }

  .draft-preview-stage {
    height: 92px !important;
  }

  .reference-grid img {
    height: 36px !important;
  }

  .builder-footer {
    height: 44px;
  }

  .builder-footer .primary,
  .builder-footer .secondary {
    height: 34px !important;
  }
}

/* Avatar builder flow polish: upload completes the setup phase, then users
   confirm draft style, outfit and motion before the real generation step. */
.builder-shell {
  grid-template-columns: minmax(300px, 0.66fr) minmax(580px, 1.48fr) minmax(300px, 0.78fr) !important;
}

.builder-heading p {
  max-width: 96%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-step[data-builder-step="1"] {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  overflow: hidden !important;
  gap: 7px !important;
}

.builder-step[data-builder-step="1"] h2,
.builder-step[data-builder-step="1"] .builder-field:first-of-type,
.builder-step[data-builder-step="1"] .builder-script-field {
  grid-column: 1 / -1;
}

.builder-step[data-builder-step="1"] .builder-field,
.builder-step[data-builder-step="1"] .builder-toggle-row {
  min-height: 0 !important;
  padding: 8px 9px !important;
}

.builder-step[data-builder-step="1"] .builder-field > span,
.builder-step[data-builder-step="1"] .builder-toggle-row > span {
  font-size: 12px !important;
}

.builder-step[data-builder-step="1"] .builder-script-field textarea {
  min-height: 70px !important;
  max-height: 82px !important;
}

.builder-step[data-builder-step="2"] {
  overflow: hidden !important;
  gap: 6px !important;
}

.builder-preview-options {
  display: grid;
  grid-template-columns: minmax(160px, 0.72fr) minmax(220px, 1fr);
  gap: 7px 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(78, 84, 238, 0.18);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.86));
}

.builder-preview-options-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.builder-preview-options-head strong {
  color: #1e213a;
  font-size: 14px;
  font-weight: 900;
}

.builder-preview-options-head small {
  min-width: 0;
  color: #8a91aa;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-preview-options .builder-field {
  min-height: 0 !important;
  padding: 7px 8px !important;
  gap: 5px !important;
}

.builder-preview-options .builder-field > span {
  font-size: 12px !important;
}

.builder-preview-options .builder-outfit-custom,
.builder-preview-options .builder-garment-library,
.builder-preview-options .builder-reference-upload,
.builder-preview-options .builder-style-note,
.builder-preview-options .motion-builder-field {
  grid-column: 1 / -1;
}

.builder-garment-library {
  align-items: stretch !important;
}

.builder-garment-library-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.builder-garment-card {
  position: relative;
  display: grid;
  grid-template-rows: 66px auto auto;
  gap: 3px;
  min-width: 0;
  padding: 5px;
  border: 1px solid rgba(78, 84, 238, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  color: #1e233d;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.builder-garment-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 rgba(78, 84, 238, 0);
  transition: box-shadow 0.16s ease;
}

.builder-garment-card.selected {
  border-color: rgba(78, 84, 238, 0.76);
  background: linear-gradient(180deg, rgba(247, 248, 255, 0.98), rgba(255, 255, 255, 0.94));
}

.builder-garment-card.selected::after {
  box-shadow: inset 0 0 0 2px rgba(78, 84, 238, 0.76);
}

.builder-garment-card img {
  width: 100%;
  height: 66px;
  border-radius: 7px;
  object-fit: cover;
  object-position: center 26%;
  background: #f3f5fb;
}

.builder-garment-card span,
.builder-garment-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-garment-card span {
  font-size: 11px;
  font-weight: 900;
}

.builder-garment-card small {
  color: #8a91aa;
  font-size: 10px;
  font-weight: 800;
}

.builder-garment-library-note,
.builder-garment-empty {
  margin: 0;
  color: #8a91aa;
  font-size: 11px;
  font-weight: 800;
}

.builder-reference-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.builder-reference-upload {
  position: relative;
  cursor: pointer;
}

.builder-reference-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px dashed rgba(78, 84, 238, 0.28);
  border-radius: 8px;
  background: rgba(246, 247, 255, 0.82);
  color: #8a91aa;
  font-size: 12px;
  font-weight: 900;
}

.builder-reference-box i {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 8px;
  color: #5651ef;
  background: #ffffff;
  font-style: normal;
  box-shadow: inset 0 0 0 1px rgba(78, 84, 238, 0.14);
}

.builder-reference-box strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-reference-upload.has-file .builder-reference-box {
  border-color: rgba(35, 199, 142, 0.45);
  background: rgba(239, 255, 249, 0.9);
  color: #117b5b;
}

.builder-reference-upload.has-file .builder-reference-box i {
  color: #ffffff;
  background: linear-gradient(135deg, #23c78e, #37b7ff);
}

.builder-reference-upload.needs-attention .builder-reference-box {
  border-color: rgba(255, 76, 83, 0.62);
  background: rgba(255, 245, 246, 0.92);
  color: #d9363e;
}

.builder-reference-upload.needs-attention .builder-reference-box i {
  color: #ffffff;
  background: linear-gradient(135deg, #ff4c53, #ff8f70);
}

.builder-preview-options .builder-style-note {
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(246, 247, 255, 0.9);
}

.builder-preview-options .builder-motion-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 7px !important;
  padding: 7px !important;
}

.builder-preview-options .motion-control {
  gap: 5px !important;
}

.builder-preview-options .motion-control span {
  gap: 5px;
  font-size: 11px !important;
  white-space: nowrap;
}

.builder-preview-options .motion-control input[type="range"] {
  height: 16px;
}

.builder-step[data-builder-step="2"] .capture-checklist {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: stretch;
  padding: 7px !important;
}

.builder-step[data-builder-step="2"] .capture-checklist > div {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.builder-step[data-builder-step="2"] .builder-upload {
  min-height: 86px !important;
  padding: 10px !important;
}

.builder-step[data-builder-step="2"] .builder-upload .upload-icon {
  width: 34px !important;
  height: 34px !important;
  font-size: 20px !important;
}

.builder-step[data-builder-step="2"] .draft-preview-panel {
  grid-template-columns: 88px minmax(0, 1fr) !important;
  padding: 8px !important;
}

.builder-step[data-builder-step="2"] .draft-preview-stage {
  height: 96px !important;
}

.builder-step[data-builder-step="2"] .quality-panel,
.builder-step[data-builder-step="2"] .builder-doc-card,
.builder-step[data-builder-step="2"] .reference-library {
  padding: 8px !important;
}

.builder-step[data-builder-step="2"] .builder-doc-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.builder-step[data-builder-step="2"] .reference-library {
  grid-template-columns: 1fr 0.78fr !important;
  gap: 7px !important;
}

.builder-step[data-builder-step="2"] .reference-grid img {
  height: 34px !important;
}

.builder-step[data-builder-step="2"] .reference-grid figure {
  gap: 3px !important;
}

.builder-step[data-builder-step="2"] .guide-video-card {
  min-height: 44px;
  padding: 7px 9px !important;
}

.builder-step[data-builder-step="3"] {
  overflow: hidden !important;
}

@media (max-width: 1360px) {
  .builder-shell {
    grid-template-columns: minmax(270px, 0.66fr) minmax(500px, 1.36fr) minmax(270px, 0.76fr) !important;
  }

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

  .builder-step[data-builder-step="2"] .capture-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .builder-preview-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .quality-detail-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Avatar builder preview gate: users must approve an effect preview before the
   heavy generation job is submitted. */
.builder-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

.builder-steps li {
  padding-inline: 3px !important;
}

.builder-steps strong {
  font-size: 11px !important;
}

.builder-steps li:not(:last-child)::after {
  left: calc(50% + 14px) !important;
  right: calc(-50% + 14px) !important;
}

.training-card.is-preview {
  border-color: rgba(80, 92, 238, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 255, 0.94)),
    radial-gradient(circle at 80% 10%, rgba(76, 181, 255, 0.18), transparent 34%);
}

.training-card.is-preview .training-visual {
  box-shadow: inset 0 0 0 1px rgba(78, 84, 238, 0.26), 0 12px 26px rgba(78, 84, 238, 0.12);
}

.training-card.is-preview .training-copy strong::before {
  content: "预览";
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 20px;
  margin-right: 6px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #5651ef, #37b7ff);
  font-size: 11px;
  font-weight: 900;
  vertical-align: 2px;
}

.training-card.is-preview .progress-line span {
  background: linear-gradient(90deg, #5651ef, #37b7ff);
}

.training-card.is-preview .training-visual:not(.has-preview)::after {
  content: "预览待生成";
}

/* Interactive 3D effect preview for avatar creation. */
.builder-step[data-builder-step="3"].has-effect-preview {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.builder-step[data-builder-step="3"].has-effect-preview::after {
  display: none !important;
}

.builder-step[data-builder-step="3"].has-effect-preview .training-card {
  height: 100%;
  min-height: 0 !important;
  display: grid;
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px !important;
  padding: 10px !important;
}

.builder-step[data-builder-step="3"].has-effect-preview .training-visual,
.training-visual.uses-direct-media-preview {
  position: relative;
  overflow: hidden;
  height: auto !important;
  min-height: 310px;
  border-radius: 12px;
  cursor: default;
  touch-action: auto;
  background:
    var(--builder-preview) center center / contain no-repeat,
    linear-gradient(160deg, #fbfcff, #eef4ff 55%, #f9fbff);
}

.training-visual.uses-direct-media-preview.has-video,
.builder-step[data-builder-step="3"].has-effect-preview .training-visual.has-video {
  background: #101524;
}

.training-visual.has-3d-model,
.generated-thumb.has-3d-model {
  background:
    radial-gradient(circle at 50% 28%, rgba(70, 185, 255, 0.18), transparent 34%),
    linear-gradient(145deg, #111827, #27324c 58%, #3d3fe0) !important;
}

.training-visual.uses-direct-media-preview > .builder-preview-video,
.builder-step[data-builder-step="3"].has-effect-preview .training-visual .builder-preview-video {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #101524;
}

.builder-model-preview {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 20px;
  color: #ffffff;
  text-align: center;
}

.builder-model-preview.has-ply-preview {
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(45deg, rgba(238, 242, 255, 0.72) 25%, transparent 25% 75%, rgba(238, 242, 255, 0.72) 75%),
    linear-gradient(45deg, rgba(238, 242, 255, 0.72) 25%, transparent 25% 75%, rgba(238, 242, 255, 0.72) 75%),
    transparent;
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
}

.builder-model-preview::before {
  content: "";
  width: min(34%, 132px);
  aspect-ratio: 0.72;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px 999px 26px 26px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.8) 0 14%, transparent 15%),
    rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.28);
}

.builder-model-preview.has-ply-preview::before {
  display: none;
}

.builder-model-preview > b {
  display: inline-grid;
  min-width: 58px;
  min-height: 34px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #4c4ee5, #46b9ff);
  font-size: 18px;
  font-weight: 950;
}

.builder-model-preview > span:not(.model-preview-label) {
  font-size: 18px;
  font-weight: 950;
}

.builder-model-preview > small {
  max-width: 360px;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 820;
  line-height: 1.55;
}

.builder-step[data-builder-step="3"].has-effect-preview .training-visual .training-face {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
  border-radius: 18px;
  background:
    var(--builder-preview) center center / contain no-repeat,
    linear-gradient(180deg, #eef3ff, #dfe7ff);
}

.builder-step[data-builder-step="3"].has-effect-preview .training-copy {
  min-width: 0;
}

.builder-step[data-builder-step="3"].has-effect-preview .training-card p {
  display: block;
  max-height: 78px;
  overflow: auto;
  -webkit-line-clamp: unset;
}

.builder-step[data-builder-step="3"].has-effect-preview .generated-avatar-card {
  margin-top: 0;
}

/* 真实预览只能展示模型或素材产物，禁止前端用 CSS 假人偶模拟坐姿/服装。 */
.builder-3d-stage,
.builder-3d-hint,
.builder-3d-model-label {
  display: none !important;
}

.builder-step[data-builder-step="3"].has-effect-preview .training-visual {
  cursor: default !important;
  touch-action: auto !important;
  background:
    var(--builder-preview) center center / contain no-repeat,
    linear-gradient(160deg, #fbfcff, #eef4ff 55%, #f9fbff) !important;
}

.builder-step[data-builder-step="3"].has-effect-preview .training-visual:active {
  cursor: default !important;
}

.builder-step[data-builder-step="3"].has-effect-preview .training-visual .training-face {
  background:
    var(--builder-preview) center center / contain no-repeat,
    linear-gradient(180deg, #eef3ff, #dfe7ff) !important;
}

.builder-step[data-builder-step="3"].has-formal-result::after {
  display: none !important;
}

/* Multi-photo avatar creation: let users choose the primary look used for
   cover, draft preview and generation source. */
.builder-primary-selector {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(80, 92, 238, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
}

.builder-primary-selector[hidden] {
  display: none !important;
}

.builder-primary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.builder-primary-head strong {
  color: #20233f;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.builder-primary-head small {
  min-width: 0;
  color: #8a91aa;
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.builder-primary-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}

.builder-primary-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(80, 92, 238, 0.16);
  border-radius: 10px;
  background: #ffffff;
  color: #20233f;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.builder-primary-card:hover {
  border-color: rgba(80, 92, 238, 0.48);
  box-shadow: 0 8px 18px rgba(80, 92, 238, 0.12);
  transform: translateY(-1px);
}

.builder-primary-card.selected {
  border-color: #5651ef;
  box-shadow: inset 0 0 0 1px rgba(86, 81, 239, 0.58), 0 10px 22px rgba(80, 92, 238, 0.16);
}

.builder-primary-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f7ff;
}

.builder-primary-card strong,
.builder-primary-card small {
  display: block;
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.builder-primary-card strong {
  font-size: 12px;
  font-weight: 900;
}

.builder-primary-card small {
  color: #8a91aa;
  font-size: 11px;
}

.primary-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  max-width: calc(100% - 20px);
  padding: 3px 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 29, 55, 0.72);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-primary-card.selected .primary-badge {
  background: linear-gradient(135deg, #5651ef, #37b7ff);
}

/* Product workflow clarity: keep photo-pack mode honest and compact. */
.builder-flow-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid rgba(80, 92, 238, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(86, 81, 239, 0.08), rgba(55, 183, 255, 0.08)),
    #ffffff;
  color: #20233f;
  font-size: 12px;
  line-height: 1.45;
}

.builder-flow-note strong {
  white-space: nowrap;
  color: #5651ef;
  font-weight: 950;
}

.builder-flow-note span {
  min-width: 0;
  color: #6d7289;
  font-weight: 800;
}

.builder-steps strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-step[data-builder-step="2"] .builder-flow-note {
  margin-top: -1px;
}

.avatar-builder .builder-mode-cards {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 6px !important;
}

.avatar-builder .builder-mode-cards button {
  min-height: 86px !important;
  gap: 4px !important;
  padding: 8px 8px 7px !important;
}

.avatar-builder .builder-mode-cards strong {
  max-width: calc(100% - 36px);
  font-size: 12px !important;
  line-height: 1.18 !important;
}

.avatar-builder .builder-mode-cards em {
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  font-size: 9px;
}

.avatar-builder .builder-mode-cards small {
  font-size: 10px !important;
  line-height: 1.25 !important;
  -webkit-line-clamp: 3;
}

/* Avatar builder usability pass: give configuration more room and keep preview compact. */
.avatar-builder .builder-upload input[type="file"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  appearance: none !important;
  color: transparent !important;
  font-size: 0 !important;
}

@media (min-width: 1101px) {
  .avatar-builder .builder-shell {
    grid-template-columns: minmax(390px, 0.94fr) minmax(620px, 1.54fr) minmax(250px, 0.52fr) !important;
  }

  .avatar-builder .builder-step[data-builder-step="3"] {
    padding: 10px 8px !important;
  }
}

@media (min-width: 1101px) and (max-width: 1360px) {
  .avatar-builder .builder-shell {
    grid-template-columns: minmax(350px, 0.92fr) minmax(500px, 1.36fr) minmax(220px, 0.5fr) !important;
  }
}
