:root {
  --bg: #10110f;
  --bg-soft: #171914;
  --panel: #f4f0e8;
  --panel-strong: #fffaf1;
  --ink: #161713;
  --muted: #686b61;
  --line: rgba(22, 23, 19, 0.14);
  --line-dark: rgba(244, 240, 232, 0.16);
  --accent: #d9a441;
  --accent-2: #35a7a0;
  --good: #147b55;
  --bad: #b13d3d;
  --warn: #a86f16;
  --topbar-title-font-size: 1.55rem;
  --workspace-gutter: clamp(12px, 1.2vw, 56px);
  --workspace-gap: clamp(0.75rem, 0.85vw, 1.4rem);
  font-family: "Noto Sans SC", "Source Han Sans SC", "Source Han Sans CN", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
}

@media (min-width: 1041px) {
  html[data-display-profile="scaled-2k"] {
    --topbar-title-font-size: 1.28rem;
    --workspace-gutter: 8px;
    --workspace-gap: 0.62rem;
    font-size: 14px;
  }

  html[data-display-profile="scaled-4k"] {
    --topbar-title-font-size: 1.2rem;
    --workspace-gutter: 8px;
    --workspace-gap: 0.58rem;
    font-size: 13px;
  }

  html[data-display-profile="scaled-2k"] .topbar,
  html[data-display-profile="scaled-4k"] .topbar {
    padding-block: 0.62rem;
  }

  html[data-display-profile="scaled-2k"] .tabs,
  html[data-display-profile="scaled-4k"] .tabs {
    padding-bottom: 0.5rem;
  }

  html[data-display-profile="scaled-2k"] .voice-workbench,
  html[data-display-profile="scaled-4k"] .voice-workbench,
  html[data-display-profile="scaled-2k"] .voice-clone-workbench,
  html[data-display-profile="scaled-4k"] .voice-clone-workbench {
    height: calc(100svh - 8.9rem);
    max-height: calc(100svh - 8.9rem);
  }
}

html.voice-active,
body.voice-active {
  height: 100svh;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0.72rem 1rem;
  color: #11120f;
  background: var(--accent);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: #efbd58;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

button.danger-button {
  color: #fffaf1;
  background: var(--bad);
}

button.danger-button:hover {
  background: #c34b4b;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.74);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(53, 167, 160, 0.16);
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0.65rem;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent-2);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 0.85fr);
  min-height: 100vh;
}

.login-art {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: var(--panel-strong);
  background:
    url("/assets/login-hero.png") center / cover no-repeat,
    #f7efe1;
}

.login-art::before {
  content: none;
}

.login-art h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.login-subtitle {
  position: relative;
  margin: 0.85rem 0 0;
  color: rgba(244, 240, 232, 0.86);
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 650;
}

.login-art .muted {
  position: relative;
  max-width: 35rem;
  color: rgba(244, 240, 232, 0.76);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 4rem;
  background: var(--panel);
}

.login-panel h2,
.section-title h2,
.topbar h1 {
  margin: 0;
  font-weight: 740;
}

.login-panel h2 {
  font-size: 2.5rem;
}

.workspace {
  width: calc(100% - var(--workspace-gutter));
  margin: 0 auto;
  padding: 0.75rem 0 1rem;
  animation: rise 360ms ease both;
}

.topbar,
.tabs,
.panel-grid,
.records,
.admin {
  background: rgba(23, 25, 20, 0.96);
  border: 1px solid var(--line-dark);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 8px 8px 0 0;
  padding: clamp(1rem, 0.9vw, 1.45rem) clamp(1.15rem, 1.2vw, 1.9rem);
}

.topbar h1 {
  color: var(--panel-strong);
  font-size: var(--topbar-title-font-size);
  line-height: 1.08;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.user-strip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

#queueBadge,
#userBadge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  background: rgba(255, 250, 241, 0.56);
  white-space: nowrap;
}

.ghost {
  color: var(--panel-strong);
  background: #20221d;
}

.ghost:hover {
  background: #2c3028;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  border-top: 0;
  border-bottom: 0;
  padding: 0 clamp(1.15rem, 1.2vw, 1.9rem) clamp(0.9rem, 0.85vw, 1.35rem);
}

.tabs button {
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
}

.tabs button:hover {
  color: var(--ink);
  background: rgba(22, 23, 19, 0.05);
}

.tabs button.active {
  color: var(--panel-strong);
  border-color: var(--line);
  background: rgba(53, 167, 160, 0.18);
}

.panel-grid {
  display: grid;
  grid-template-columns:
    minmax(20rem, clamp(23rem, 20vw, 34rem))
    minmax(38rem, 1fr)
    minmax(18rem, clamp(19rem, 16vw, 30rem));
  gap: var(--workspace-gap);
  border-radius: 0 0 8px 8px;
  min-height: calc(100vh - 10rem);
  padding: var(--workspace-gap);
}

.creator {
  min-height: 0;
  padding: 1rem;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: rgba(244, 240, 232, 0.06);
  overflow-y: auto;
  overflow-x: visible;
}

.section-title {
  margin-bottom: 1.2rem;
}

.section-title h2 {
  color: var(--panel-strong);
  font-size: 1.15rem;
  line-height: 1.16;
}

.upload-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  max-width: none;
}

.upload-form button,
.upload-progress,
.upload-form .form-message {
  grid-column: 1 / -1;
}

.create-button {
  min-height: 58px;
  border-radius: 8px;
  font-size: 1.08rem;
  font-weight: 760;
}

.file-drop {
  min-height: 8.5rem;
  place-items: center;
  align-content: center;
  padding: 1rem;
  border: 1px dashed rgba(22, 23, 19, 0.34);
  border-radius: 8px;
  color: var(--panel-strong);
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.file-drop:hover {
  border-color: var(--accent-2);
  background: rgba(255, 255, 255, 0.08);
}

.file-drop input {
  display: none;
}

.file-drop span {
  font-size: 1.1rem;
  font-weight: 700;
}

.file-drop small {
  max-width: 100%;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.file-drop.has-file {
  border-style: solid;
  border-color: rgba(53, 167, 160, 0.86);
  background: rgba(53, 167, 160, 0.12);
  box-shadow: inset 0 0 0 1px rgba(53, 167, 160, 0.18);
}

.file-drop.has-file span::before {
  content: "已上传 ";
  color: var(--accent-2);
}

.file-drop.has-file small {
  color: rgba(244, 240, 232, 0.82);
}

.file-preview {
  display: block;
  width: min(100%, 10.5rem);
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(244, 240, 232, 0.18);
  object-fit: cover;
  background: #0d0f0d;
}

.upload-progress {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: rgba(244, 240, 232, 0.82);
  background: rgba(255, 255, 255, 0.045);
}

.upload-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
}

.upload-progress strong {
  color: var(--panel-strong);
  font-variant-numeric: tabular-nums;
}

.upload-progress progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.18);
}

.upload-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.18);
}

.upload-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent-2);
}

.upload-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent-2);
}

.preview-stage {
  display: grid;
  grid-template-rows: auto minmax(24rem, 1fr) auto;
  gap: 1.1rem;
  align-items: start;
  min-height: 100%;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: rgba(13, 15, 13, 0.74);
}

.preview-copy h3 {
  margin: 0;
  color: var(--panel-strong);
  font-size: 1.25rem;
}

.video-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: visible;
  width: 100%;
  min-width: 0;
  height: clamp(28rem, calc(100vh - 17rem), 66vh);
  justify-self: center;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.video-frame video,
.task-dialog video {
  display: block;
  background: #0d0f0d;
  object-fit: contain;
}

.video-frame video {
  width: auto;
  max-width: min(100%, calc((100vh - 17rem) * 9 / 16));
  height: 100%;
  max-height: 66vh;
}

.video-frame.empty video {
  display: none;
}

.video-frame p {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: rgba(244, 240, 232, 0.68);
}

.video-frame:not(.empty) p {
  display: none;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.preview-actions .ghost {
  min-height: 32px;
  border-radius: 999px;
  padding: 0.35rem 1.05rem;
}

.preview-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  width: 48px;
  min-height: 48px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  color: rgba(244, 240, 232, 0.88);
  background: rgba(41, 48, 50, 0.76);
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-50%);
}

.preview-nav.previous {
  left: 1rem;
}

.preview-nav.next {
  right: 1rem;
}

.preview-nav:hover {
  background: rgba(52, 62, 64, 0.94);
  transform: translateY(-50%);
}

.preview-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.download-button,
.result-actions a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border-radius: 6px;
  padding: 0.72rem 1rem;
  color: #11120f;
  background: var(--accent);
  text-decoration: none;
}

.status-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1rem;
  overflow: visible;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--line);
}

.status-rail > div {
  display: grid;
  align-content: center;
  min-height: 4.9rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
}

.status-rail p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.info-tip {
  position: relative;
  display: inline-grid;
  width: 16px;
  height: 16px;
  margin-left: 0.25rem;
  place-items: center;
  border: 1px solid rgba(244, 240, 232, 0.36);
  border-radius: 50%;
  color: rgba(244, 240, 232, 0.8);
  font-size: 0.7rem;
  line-height: 1;
  cursor: help;
}

.info-tip::after {
  content: "提示\A当前展示为预计消耗\A最终以实际运行时长计算";
  position: absolute;
  right: -0.35rem;
  bottom: calc(100% + 10px);
  z-index: 5;
  width: 12.5rem;
  max-width: calc(100vw - 2rem);
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(244, 240, 232, 0.18);
  border-radius: 6px;
  color: rgba(244, 240, 232, 0.74);
  background: #262724;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.65;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.info-tip:hover::after,
.info-tip:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.metric {
  color: var(--panel-strong);
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 760;
}

.history-rail {
  position: relative;
  min-height: 0;
  overflow: visible;
  border: 0;
  border-left: 8px solid rgba(53, 167, 160, 0.58);
  border-radius: 0;
  background: transparent;
  transition: border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.panel-grid.history-collapsed {
  grid-template-columns:
    minmax(20rem, clamp(23rem, 20vw, 34rem))
    minmax(38rem, 1fr)
    3.5rem;
}

.history-toggle {
  position: absolute;
  top: 50%;
  left: -4px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: 34px;
  min-height: 96px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 240, 232, 0.2);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  padding: 0;
  color: #0d1414;
  background: linear-gradient(180deg, #62f2e8, #d9a441);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42), 0 0 0 4px rgba(53, 167, 160, 0.12);
  font-size: 0.86rem;
  font-weight: 860;
  line-height: 1.2;
  transform: translate(-50%, -50%);
}

.history-toggle-text,
.history-toggle-arrow {
  display: block;
  text-align: center;
}

.history-toggle-arrow {
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.history-toggle:hover {
  background: linear-gradient(180deg, #7ffff6, #efbd58);
  transform: translate(-50%, -50%) scale(1.04);
}

.history-rail.collapsed {
  overflow: visible;
  border-left-color: rgba(244, 240, 232, 0.12);
  background: transparent;
}

.history-rail.collapsed header,
.history-rail.collapsed .history-list {
  opacity: 0;
  pointer-events: none;
}

.history-rail.collapsed .history-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  align-items: center;
  justify-content: center;
  right: -1px;
  left: auto;
  width: 42px;
  min-height: 132px;
  border: 1px solid rgba(244, 240, 232, 0.2);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  color: #0d1414;
  background: linear-gradient(180deg, #62f2e8, #d9a441);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
  font-size: 0.82rem;
  font-weight: 860;
  letter-spacing: 0;
  line-height: 1.25;
  transform: translateY(-50%);
}

.history-rail.collapsed .history-toggle:hover {
  color: #0d1414;
  background: linear-gradient(180deg, #7ffff6, #efbd58);
  transform: translateY(-50%);
}

.history-rail header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line-dark);
}

.history-rail h2 {
  margin: 0;
  color: var(--panel-strong);
  font-size: 1.1rem;
}

.history-list {
  display: grid;
  gap: 1rem;
  max-height: calc(100vh - 14rem);
  overflow: auto;
  padding: 0.85rem;
}

.history-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: visible;
  border-bottom: 1px solid var(--line-dark);
  padding: 0 0.25rem 1rem;
  background: transparent;
}

.history-media {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  aspect-ratio: 9 / 16;
  background: #0d0f0d;
}

.history-media.video {
  border-radius: 0;
  overflow: hidden;
}

.history-media.audio {
  display: grid;
  place-items: center;
  aspect-ratio: auto;
  min-height: 5.8rem;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  padding: 0.8rem;
}

.history-media.audio audio {
  width: 100%;
}

.history-video-menu {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 3;
}

.history-menu-trigger {
  display: grid;
  width: 42px;
  min-height: 42px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  color: var(--panel-strong);
  background: rgba(41, 45, 45, 0.84);
  font-size: 1.1rem;
  line-height: 1;
}

.history-menu-trigger:hover {
  background: rgba(54, 60, 60, 0.94);
  transform: none;
}

.history-menu-popover {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  display: none;
  min-width: 6.5rem;
  overflow: hidden;
  border: 1px solid rgba(244, 240, 232, 0.16);
  border-radius: 8px;
  background: #1d201d;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}

.history-video-menu:hover .history-menu-popover,
.history-video-menu:focus-within .history-menu-popover {
  display: grid;
}

.history-menu-popover a,
.history-menu-popover button {
  display: flex;
  min-height: 34px;
  align-items: center;
  border-radius: 0;
  padding: 0.45rem 0.75rem;
  color: var(--panel-strong);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.history-menu-popover a:hover,
.history-menu-popover button:hover {
  color: var(--accent-2);
  background: rgba(255, 255, 255, 0.06);
  transform: none;
}

.history-menu-popover button {
  color: #ff6475;
}

.history-media video,
.history-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-placeholder {
  display: grid;
  place-items: center;
  color: rgba(244, 240, 232, 0.72);
}

.history-card-body {
  display: grid;
  gap: 0.35rem;
  padding: 0;
}

.history-card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.history-card strong {
  flex: 1;
  min-width: 0;
  color: var(--panel-strong);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card p {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.history-card p span {
  white-space: nowrap;
}

.history-delete {
  min-height: auto;
  padding: 0;
  color: #ff4b5f;
  background: transparent;
  font-size: 0.78rem;
}

.history-delete:hover {
  color: #ff6b7b;
  background: transparent;
  transform: none;
}

.history-state.failed {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: rgba(244, 240, 232, 0.68);
}

.history-state.failed::after {
  content: "!";
  display: inline-grid;
  width: 13px;
  height: 13px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #ef4056;
  font-size: 0.68rem;
  font-weight: 800;
}

.history-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.22);
}

.history-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0;
}

.history-actions button,
.history-actions a {
  min-height: 30px;
  border-radius: 6px;
  padding: 0.32rem 0.5rem;
  font-size: 0.8rem;
}

.history-actions button {
  color: var(--panel-strong);
  background: transparent;
}

.history-actions button:hover {
  color: var(--accent-2);
  background: transparent;
  transform: none;
}

.history-empty {
  color: var(--muted);
}

.voice-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, clamp(25rem, 24vw, 42rem));
  grid-template-rows: minmax(0, 1fr) auto minmax(12.4rem, 15rem);
  gap: clamp(0.65rem, 0.75vw, 1.2rem);
  height: calc(100svh - 11.6rem);
  min-height: 0;
  max-height: calc(100svh - 11.6rem);
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  padding: 0.65rem;
  color: var(--panel-strong);
  background:
    radial-gradient(circle at 76% 22%, rgba(53, 167, 160, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(13, 15, 13, 0.98), rgba(25, 28, 24, 0.98));
  border: 1px solid var(--line-dark);
}

.voice-hero {
  display: grid;
  grid-template-columns: minmax(5.8rem, 8.4rem) minmax(0, 1fr);
  gap: clamp(0.55rem, 1.2vw, 1.1rem);
  align-items: start;
  min-height: 0;
  overflow: hidden;
  padding: clamp(0.68rem, 1.35vw, 1rem);
  border: 1px solid rgba(244, 240, 232, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(90deg, rgba(244, 240, 232, 0.045) 0 1px, transparent 1px 42px);
}

.voice-copy h2 {
  margin: 0;
  max-width: 4.2em;
  font-size: clamp(1.65rem, 2.25vw, 2.65rem);
  line-height: 1.04;
  font-weight: 820;
  text-wrap: balance;
}

.voice-copy p:not(.eyebrow) {
  max-width: 9.2rem;
  color: rgba(244, 240, 232, 0.72);
  line-height: 1.62;
  font-size: 0.84rem;
}

.voice-copy {
  min-height: 0;
  overflow: hidden;
}

.voice-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(32px, auto) auto minmax(34px, auto);
  gap: 0.28rem;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.voice-form > label {
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.voice-form textarea {
  min-height: 0;
  height: 100%;
  color: var(--panel-strong);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(244, 240, 232, 0.16);
  font-size: calc(var(--topbar-title-font-size) * 0.5);
  font-weight: 740;
  line-height: 1.45;
  resize: none;
}

.voice-script-tools {
  position: relative;
  display: grid;
  gap: 0.34rem;
  min-height: 0;
  margin-top: 0.28rem;
}

.file-drop .voice-script-tools,
.misplaced-voice-script-tools {
  display: none;
}

.voice-script-toolbar {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.voice-script-toolbar::-webkit-scrollbar {
  display: none;
}

.voice-script-toolbar button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid rgba(244, 240, 232, 0.18);
  border-radius: 8px;
  padding: 0.3rem 0.72rem;
  color: rgba(244, 240, 232, 0.86);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.78rem;
  font-weight: 760;
  white-space: nowrap;
}

.voice-script-toolbar button:hover,
.voice-script-toolbar button.active {
  color: #11120f;
  border-color: transparent;
  background: #b8a4ff;
}

.voice-script-help {
  justify-self: center;
  max-width: min(100%, 24rem);
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(244, 240, 232, 0.16);
  border-radius: 8px;
  color: rgba(244, 240, 232, 0.72);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.78rem;
  line-height: 1.45;
}

.voice-script-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 12;
  display: flex;
  gap: 0.32rem;
  max-width: min(100%, 23rem);
  padding: 0.38rem;
  border: 1px solid rgba(244, 240, 232, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.voice-script-toast {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 14;
  max-width: min(100%, 24rem);
  padding: 0.54rem 0.72rem;
  border: 1px solid rgba(244, 240, 232, 0.18);
  border-radius: 8px;
  color: #fffaf1;
  background: rgba(22, 23, 19, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  font-size: 0.8rem;
  line-height: 1.45;
}

.voice-script-toast.success {
  border-color: rgba(53, 167, 160, 0.34);
}

.voice-script-toast.error {
  border-color: rgba(177, 61, 61, 0.42);
  background: rgba(78, 28, 28, 0.96);
}

.voice-script-popover.hidden {
  display: none;
}

.voice-script-popover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(5.2rem, 1fr));
}

.voice-script-popover-list {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr);
  max-height: 13rem;
  overflow-y: auto;
}

.voice-script-popover button {
  min-height: 28px;
  border: 1px solid rgba(22, 23, 19, 0.1);
  border-radius: 6px;
  padding: 0.28rem 0.58rem;
  color: #5c6070;
  background: rgba(245, 247, 251, 0.92);
  font-size: 0.78rem;
  font-weight: 740;
  white-space: nowrap;
}

.voice-script-popover button:hover,
.voice-script-popover button.active {
  color: #694fff;
  border-color: rgba(105, 79, 255, 0.16);
  background: rgba(105, 79, 255, 0.08);
}

.voice-script-tool-group {
  display: none;
}

.voice-cost {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.34rem 0.58rem;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  color: rgba(244, 240, 232, 0.72);
  background: rgba(255, 255, 255, 0.045);
}

.voice-cost strong {
  color: var(--accent-2);
  font-size: 0.95rem;
}

.voice-cost small {
  display: none;
}

.voice-cost em {
  color: rgba(244, 240, 232, 0.54);
  font-size: 0.74rem;
  font-style: normal;
  white-space: nowrap;
}

.voice-form .create-button {
  width: 25.5rem;
  max-width: 100%;
  min-height: 48px;
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  white-space: nowrap;
}

.voice-settings-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.48rem;
  gap: 0;
  padding: 0.06rem 0.28rem;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.voice-settings-head {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

.voice-settings-title {
  display: none;
  gap: 0;
}

.voice-settings-title .eyebrow {
  display: none;
}

.voice-settings-title strong {
  color: var(--panel-strong);
  font-size: 0.74rem;
}

.voice-settings-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  min-height: 24px;
  border-radius: 999px;
  padding: 0.12rem 0.48rem;
  color: var(--panel-strong);
  background: rgba(53, 167, 160, 0.16);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.voice-settings-reset:hover {
  color: var(--panel-strong);
  background: rgba(53, 167, 160, 0.26);
  transform: none;
}

.voice-settings-reset span[aria-hidden="true"] {
  font-size: 0.9rem;
  line-height: 1;
}

.voice-settings-grid {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

.voice-setting-group {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.34rem;
  row-gap: 0;
  min-width: 0;
  min-height: 0.46rem;
}

.voice-setting-meta {
  display: contents;
}

.voice-setting-meta span {
  grid-column: 1;
  color: var(--accent-2);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.voice-setting-meta strong {
  grid-column: 2;
  display: inline-grid;
  min-width: 1.65rem;
  min-height: 0.82rem;
  place-items: center;
  padding: 0 0.24rem;
  border-radius: 999px;
  color: var(--panel-strong);
  background: rgba(53, 167, 160, 0.18);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.voice-setting-range {
  grid-column: 3;
  --voice-slider-percent: 50%;
  --voice-track-border: rgba(53, 167, 160, 0.38);
  width: 100%;
  height: 12px;
  margin: 0;
  border-radius: 999px;
  outline: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.voice-setting-range:focus {
  --voice-track-border: var(--accent);
}

.voice-setting-range::-webkit-slider-runnable-track {
  height: 4px;
  border: 1px solid var(--voice-track-border);
  border-radius: 999px;
  background: linear-gradient(90deg, #11120f 0 var(--voice-slider-percent), #e8e8e8 var(--voice-slider-percent) 100%);
}

.voice-setting-range::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  background: #050607;
  box-shadow: 0 0 0 1px rgba(255, 250, 241, 0.74);
}

.voice-setting-range::-moz-range-track {
  height: 4px;
  border: 1px solid var(--voice-track-border);
  border-radius: 999px;
  background: #e8e8e8;
}

.voice-setting-range::-moz-range-progress {
  height: 4px;
  border: 1px solid var(--voice-track-border);
  border-radius: 999px;
  background: #11120f;
}

.voice-setting-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #050607;
  box-shadow: 0 0 0 1px rgba(255, 250, 241, 0.72);
}

.voice-submit-row {
  display: grid;
  grid-template-columns: auto auto minmax(13rem, 1fr) minmax(0, 0.75fr);
  align-items: center;
  column-gap: 0.72rem;
  row-gap: 0.35rem;
  min-height: 0;
}

.voice-submit-row .create-button {
  margin-right: 0.9rem;
}

.voice-library-summary {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(53, 167, 160, 0.28);
  border-radius: 999px;
  padding: 0.18rem 0.58rem;
  color: var(--accent-2);
  background: rgba(53, 167, 160, 0.1);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.voice-submit-row .form-message {
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-text-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.voice-text-actions {
  display: inline-flex;
  gap: 0.35rem;
}

.voice-text-actions button {
  min-height: 28px;
  border-radius: 6px;
  padding: 0.24rem 0.5rem;
  color: var(--panel-strong);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
}

.voice-text-actions button:hover {
  color: var(--accent-2);
  background: rgba(53, 167, 160, 0.12);
  transform: none;
}

.selected-voice-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 0.45rem;
  align-items: center;
  min-height: 36px;
  border: 1px solid rgba(53, 167, 160, 0.24);
  border-left: 3px solid var(--accent-2);
  border-radius: 7px;
  padding: 0.24rem 0.42rem;
  background: rgba(53, 167, 160, 0.075);
}

.selected-voice-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.42rem;
  min-width: 0;
}

.selected-voice-copy span {
  display: block;
  color: rgba(244, 240, 232, 0.58);
  font-size: 0.68rem;
  white-space: nowrap;
}

.selected-voice-copy small {
  display: none;
}

.selected-voice-copy strong {
  display: block;
  margin: 0;
  overflow: hidden;
  color: var(--panel-strong);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-play-button {
  display: grid;
  width: 32px;
  min-height: 28px;
  place-items: center;
  border-radius: 6px;
  padding: 0;
  color: var(--panel-strong);
  background: rgba(53, 167, 160, 0.92);
  font-size: 0.74rem;
  line-height: 1;
}

.voice-play-button:hover {
  background: var(--accent-2);
  transform: none;
}

.voice-play-button:disabled {
  opacity: 0.36;
}

.voice-wave {
  display: none;
  grid-template-columns: repeat(18, minmax(3px, 1fr));
  gap: 0.32rem;
  align-items: center;
  height: 30px;
  min-width: 0;
}

.voice-wave span {
  display: block;
  height: 28%;
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.28);
}

.voice-wave span:nth-child(3n + 1) {
  height: 72%;
}

.voice-wave span:nth-child(3n + 2) {
  height: 46%;
}

.voice-wave span:nth-child(5n) {
  height: 88%;
}

.selected-voice-panel.has-preview .voice-wave span {
  background: linear-gradient(180deg, #62f2e8, #d9a441);
}

.voice-side {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid rgba(244, 240, 232, 0.18);
}

.voice-side header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0 0.85rem 1rem;
}

.voice-side h2,
.audio-preview-stage h2 {
  margin: 0;
  font-size: 1.15rem;
}

.voice-list {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  max-height: none;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0 0.45rem 0 1rem;
  scrollbar-color: #62f2e8 rgba(244, 240, 232, 0.12);
  scrollbar-width: thin;
}

.voice-list::-webkit-scrollbar {
  width: 12px;
}

.voice-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.12);
}

.voice-list::-webkit-scrollbar-thumb {
  border: 3px solid rgba(20, 23, 21, 0.96);
  border-radius: 999px;
  background: linear-gradient(180deg, #62f2e8, #d9a441);
}

.voice-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7ffff6, #efbd58);
}

.voice-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  color: rgba(244, 240, 232, 0.84);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  transform: none;
}

.voice-option:hover,
.voice-option.active {
  border-color: rgba(53, 167, 160, 0.74);
  background: rgba(53, 167, 160, 0.13);
  transform: none;
}

.voice-option strong {
  flex: 1;
  min-width: 0;
  color: var(--panel-strong);
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-option span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.audio-preview-stage {
  grid-column: 1;
  display: grid;
  grid-template-columns: minmax(8rem, 0.55fr) minmax(14rem, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  border-top: 1px solid rgba(244, 240, 232, 0.14);
  min-height: 64px;
  max-height: 76px;
  overflow: hidden;
  padding-top: 0.55rem;
}

.audio-preview-stage .eyebrow,
.audio-preview-stage .muted {
  display: none;
}

.audio-preview-stage audio {
  width: 100%;
}

.audio-preview-stage audio:not([src]) {
  display: none;
}

#audioPreviewEmpty {
  margin: 0;
  color: var(--muted);
}

#audioPreviewDownload.hidden + * {
  display: none;
}

.voice-history-stage {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.45rem;
  min-height: 0;
  overflow: visible;
  border-top: 1px solid rgba(244, 240, 232, 0.14);
  padding-top: 0.52rem;
}

.voice-history-stage header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 0;
}

.voice-history-stage h2,
.voice-history-stage .eyebrow {
  margin: 0;
}

.voice-history-stage h2 {
  font-size: 0.98rem;
}

.voice-history-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15.5rem, 22rem);
  gap: 0.55rem;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 0.9rem;
  scrollbar-width: thin;
}

.voice-history-card {
  display: grid;
  grid-template-rows: auto auto auto 4px auto auto;
  gap: 0.26rem;
  min-width: 0;
  min-height: 0;
  height: max-content;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  padding: 0.5rem 0.58rem;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.voice-history-card.selected {
  border-color: rgba(53, 167, 160, 0.76);
  background: rgba(53, 167, 160, 0.11);
}

.voice-history-head,
.voice-history-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.voice-history-head strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--panel-strong);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-history-head .history-video-menu {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
}

.voice-history-head .history-menu-trigger {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  background: rgba(244, 240, 232, 0.12);
  font-size: 0.9rem;
}

.voice-history-text {
  margin: 0;
  overflow: hidden;
  color: rgba(244, 240, 232, 0.72);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-history-meta {
  justify-content: space-between;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.voice-history-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-history-card .history-actions {
  flex-wrap: nowrap;
  overflow: visible;
}

.voice-history-card .history-actions button,
.voice-history-card .history-actions a {
  min-height: 26px;
  padding: 0.24rem 0.42rem;
  font-size: 0.76rem;
}

.voice-clone-workbench {
  display: grid;
  grid-template-columns: minmax(14rem, 0.78fr) minmax(20rem, 1.32fr) minmax(16rem, 0.9fr);
  gap: clamp(0.85rem, 0.85vw, 1.4rem);
  height: calc(100svh - 11.6rem);
  max-height: calc(100svh - 11.6rem);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 0 0 8px 8px;
  padding: 0.75rem;
  color: var(--panel-strong);
  background:
    radial-gradient(circle at 18% 18%, rgba(217, 164, 65, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(13, 15, 13, 0.98), rgba(25, 28, 24, 0.98));
}

.clone-copy,
.voice-clone-form,
.clone-notes {
  min-height: 0;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.clone-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.clone-copy-intro {
  display: grid;
  gap: 0.6rem;
}

.clone-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1.06;
}

.clone-copy p:not(.eyebrow),
.clone-notes p {
  color: rgba(244, 240, 232, 0.72);
  line-height: 1.65;
}

.clone-copyright-note {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(244, 240, 232, 0.14);
  border-radius: 8px;
  background: rgba(17, 19, 17, 0.34);
}

.clone-copyright-note h3 {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.98rem;
}

.clone-copyright-note p {
  margin: 0;
  color: rgba(244, 240, 232, 0.78);
  font-size: 0.83rem;
  line-height: 1.7;
}

.voice-clone-form {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 0.75rem;
  padding: clamp(0.9rem, 1.7vw, 1.35rem);
  overflow-y: auto;
  overflow-x: hidden;
}

.voice-clone-form input {
  color: var(--panel-strong);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(244, 240, 232, 0.16);
}

.clone-audio-drop {
  min-height: 9.5rem;
  color: var(--panel-strong);
  background:
    repeating-linear-gradient(90deg, rgba(244, 240, 232, 0.045) 0 1px, transparent 1px 38px),
    rgba(255, 255, 255, 0.038);
}

.clone-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.clone-mode-tabs button {
  min-height: 34px;
  color: var(--panel-strong);
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.82rem;
}

.clone-mode-tabs button.active,
.clone-mode-tabs button:hover {
  color: #11120f;
  background: var(--accent);
  transform: none;
}

.clone-cost {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-height: 2.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  color: rgba(244, 240, 232, 0.72);
  background: rgba(255, 255, 255, 0.04);
}

.clone-cost strong {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-size: 1rem;
}

.clone-recorder {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(42px, auto);
  gap: 0.54rem;
  min-height: max-content;
  align-content: start;
  border: 1px dashed rgba(244, 240, 232, 0.24);
  border-radius: 8px;
  padding: clamp(0.8rem, 1.6vw, 1.2rem);
  background:
    repeating-linear-gradient(90deg, rgba(244, 240, 232, 0.045) 0 1px, transparent 1px 38px),
    rgba(255, 255, 255, 0.038);
}

.clone-recorder-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-height: 2rem;
  color: var(--panel-strong);
}

.clone-recorder-status span {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-weight: 800;
}

.clone-recorder-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "start start"
    "stop delete";
  gap: 0.55rem;
}

.clone-recorder-actions button {
  --clone-recorder-icon: none;
  --clone-recorder-icon-color: #6f5cff;
  display: grid;
  place-items: center;
  gap: 0.38rem;
  min-height: 64px;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(198, 190, 232, 0.75);
  border-radius: 999px;
  color: #332d4d;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 246, 255, 0.94));
  box-shadow:
    0 10px 24px rgba(12, 16, 28, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  font-size: 0.78rem;
  font-weight: 560;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

.clone-recorder-actions button::before {
  content: "";
  width: 22px;
  height: 22px;
  background: var(--clone-recorder-icon-color);
  -webkit-mask: var(--clone-recorder-icon) center / contain no-repeat;
  mask: var(--clone-recorder-icon) center / contain no-repeat;
}

.clone-recorder-actions button:hover:not(:disabled) {
  border-color: rgba(138, 121, 240, 0.48);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 240, 255, 0.96));
  box-shadow:
    0 12px 26px rgba(12, 16, 28, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.clone-recorder-actions button:disabled {
  border-color: rgba(198, 190, 232, 0.42);
  color: rgba(51, 45, 77, 0.66);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 243, 252, 0.86));
  box-shadow:
    0 6px 16px rgba(12, 16, 28, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.clone-recorder-actions button:disabled::before {
  background: rgba(111, 92, 255, 0.45);
}

#cloneRecordStartBtn {
  grid-area: start;
  min-height: 74px;
  --clone-recorder-icon-color: #6f5cff;
  --clone-recorder-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15.25a4.25 4.25 0 0 0 4.25-4.25V6.25a4.25 4.25 0 1 0-8.5 0V11a4.25 4.25 0 0 0 4.25 4.25Zm6.25-5a1 1 0 1 0-2 0 4.25 4.25 0 0 1-8.5 0 1 1 0 1 0-2 0A6.27 6.27 0 0 0 11 16.41V19H8.75a1 1 0 1 0 0 2h6.5a1 1 0 1 0 0-2H13v-2.59a6.27 6.27 0 0 0 5.25-6.16Z'/%3E%3C/svg%3E");
}

#cloneRecordStartBtn::before {
  width: 28px;
  height: 28px;
}

#cloneRecordStopBtn {
  grid-area: stop;
  --clone-recorder-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5A2.5 2.5 0 0 1 10.5 3h3A2.5 2.5 0 0 1 16 5.5v13a2.5 2.5 0 0 1-2.5 2.5h-3A2.5 2.5 0 0 1 8 18.5v-13Z'/%3E%3C/svg%3E");
}

#cloneRecordDeleteBtn {
  grid-area: delete;
  --clone-recorder-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.25 3A2.25 2.25 0 0 0 7 5.25V6H4.75a1 1 0 1 0 0 2h.67l.83 10.04A3 3 0 0 0 9.24 21h5.52a3 3 0 0 0 2.99-2.96L18.58 8h.67a1 1 0 1 0 0-2H17v-.75A2.25 2.25 0 0 0 14.75 3h-5.5Zm5.75 3h-6v-.75A.25.25 0 0 1 9.25 5h5.5a.25.25 0 0 1 .25.25V6Zm-5 3.5a1 1 0 0 1 1 1v5.5a1 1 0 1 1-2 0V10.5a1 1 0 0 1 1-1Zm5 0a1 1 0 0 1 1 1v5.5a1 1 0 1 1-2 0V10.5a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E");
}

.clone-samples {
  display: grid;
  gap: 0.5rem;
  min-height: 0;
  padding: 0.58rem;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.clone-sample-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.38rem;
}

.clone-sample-tabs button {
  min-height: 28px;
  padding: 0.24rem 0.34rem;
  color: rgba(244, 240, 232, 0.72);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
}

.clone-sample-tabs button.active,
.clone-sample-tabs button:hover {
  color: #11120f;
  background: var(--accent);
  transform: none;
}

.clone-samples p {
  margin: 0;
  min-height: 7.2rem;
  max-height: 9rem;
  overflow-y: auto;
  color: rgba(244, 240, 232, 0.84);
  font-size: calc(var(--topbar-title-font-size) * 0.5);
  font-weight: 740;
  line-height: 1.45;
}

.clone-wave-canvas {
  width: 100%;
  height: clamp(3.7rem, 9svh, 5.5rem);
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.clone-recorder audio {
  width: 100%;
}

.clone-recorder audio:not([src]) {
  display: none;
}

.clone-notes {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  padding: clamp(0.9rem, 1.7vw, 1.35rem);
}

.clone-notes-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.7rem;
}

.clone-notes-copy {
  display: grid;
  gap: 0.35rem;
}

.clone-notes h2 {
  margin: 0;
  font-size: 1.15rem;
}

.clone-notes-copy p {
  margin: 0;
}

.clone-voice-filter {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.clone-voice-list {
  min-height: 0;
  padding: 0;
}

.clone-voice-list .voice-option {
  padding-inline: 0.7rem;
}

.clone-voice-list .voice-option strong {
  white-space: normal;
}

.clone-voice-jump {
  justify-self: start;
}

.records,
.admin {
  border-radius: 0 0 8px 8px;
  padding: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.62);
}

.status {
  display: inline-flex;
  min-width: 4.2rem;
  justify-content: center;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  background: rgba(22, 23, 19, 0.08);
  white-space: nowrap;
}

.status.succeeded {
  color: var(--good);
  background: rgba(20, 123, 85, 0.1);
}

.status.failed {
  color: var(--bad);
  background: rgba(177, 61, 61, 0.1);
}

.status.running,
.status.starting,
.status.queued {
  color: var(--warn);
  background: rgba(168, 111, 22, 0.12);
}

.poll-time {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.task-progress {
  width: 7rem;
  height: 4px;
  margin-top: 0.38rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 23, 19, 0.14);
}

.task-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(23rem, 22vw, 34rem);
  gap: 1rem;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.feature-editor {
  display: grid;
  align-content: start;
  gap: 1.2rem;
  border-left: 1px solid var(--line);
  padding-left: 1rem;
}

.feature-editor form,
.queue-form {
  display: grid;
  gap: 0.75rem;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkline input {
  width: auto;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.coin-adjust-form {
  display: grid;
  grid-template-columns: 6rem auto auto;
  gap: 0.35rem;
  align-items: center;
}

.user-edit-form {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) 8.5rem minmax(14rem, 1.25fr) auto;
  gap: 0.35rem;
  align-items: center;
  min-width: min(100%, 46rem);
}

.coin-adjust-form input {
  min-height: 32px;
  padding: 0.35rem 0.45rem;
}

.user-edit-form input,
.user-edit-form textarea {
  min-height: 32px;
  padding: 0.35rem 0.45rem;
}

.user-edit-form textarea {
  resize: vertical;
}

.dedicated-key-mask {
  display: inline-block;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.coin-log-panel {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.coin-log-toolbar {
  display: grid;
  grid-template-columns: minmax(8rem, 1.2fr) minmax(7rem, 0.8fr) repeat(2, minmax(8rem, 1fr)) auto auto;
  gap: 0.5rem;
  align-items: center;
}

.coin-log-toolbar select,
.coin-log-toolbar input {
  min-height: 36px;
}

.coin-log-table {
  max-height: 20rem;
  overflow: auto;
}

.cell-ellipsis {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions button,
.coin-adjust-form button,
.user-edit-form button,
.priority-form button {
  min-height: 32px;
  padding: 0.38rem 0.55rem;
  font-size: 0.82rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.result-actions button,
.result-actions a {
  min-height: 32px;
  padding: 0.38rem 0.55rem;
  font-size: 0.82rem;
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(16, 17, 15, 0.72);
}

.task-dialog {
  width: min(760px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 1rem;
}

.task-dialog video {
  width: auto;
  max-width: min(100%, calc((100vh - 16rem) * 9 / 16));
  height: auto;
  max-height: min(58vh, 34rem);
  margin: 0 auto;
  border-radius: 8px;
}

.task-dialog audio {
  display: block;
  width: 100%;
  margin: 0.75rem 0;
}

.task-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.task-dialog-head h2 {
  margin: 0;
}

.task-detail-list {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.65rem 1rem;
  margin: 1rem 0 0;
}

.task-detail-list dt {
  color: var(--muted);
}

.task-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.priority-form {
  display: grid;
  grid-template-columns: 5rem auto;
  gap: 0.35rem;
  align-items: center;
  min-width: 9rem;
}

.priority-form input {
  min-height: 32px;
  padding: 0.35rem 0.45rem;
}

.form-message {
  min-height: 1.2rem;
  color: var(--muted);
}

.form-message.error {
  color: var(--bad);
}

.form-message.success {
  color: var(--good);
}

a {
  color: #1f817b;
  font-weight: 700;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1040px) {
  .login-shell,
  .panel-grid,
  .admin-layout,
  .voice-workbench,
  .voice-clone-workbench,
  .voice-hero,
  .voice-history-stage,
  .audio-preview-stage {
    grid-template-columns: 1fr;
  }

  .voice-workbench {
    grid-template-rows: minmax(0, 0.9fr) minmax(6.4rem, 20%) auto minmax(11.8rem, 14rem);
    height: calc(100svh - 10.8rem);
    max-height: calc(100svh - 10.8rem);
  }

  .voice-clone-workbench {
    grid-template-rows: auto minmax(16rem, 1fr) auto;
    height: calc(100svh - 10.8rem);
    max-height: calc(100svh - 10.8rem);
    overflow-y: auto;
  }

  .voice-copy p:not(.eyebrow) {
    display: none;
  }

  .voice-hero {
    gap: 0.65rem;
    padding: 0.62rem;
  }

  .voice-copy h2 {
    max-width: none;
    font-size: clamp(1.55rem, 4vw, 2.4rem);
    white-space: nowrap;
  }

  .voice-side {
    grid-column: 1;
    grid-row: auto;
    border-left: 0;
    border-top: 1px solid rgba(244, 240, 232, 0.18);
    padding-top: 0.5rem;
  }

  .voice-side header {
    padding-top: 0.35rem;
    padding-bottom: 0.45rem;
  }

  .voice-side header,
  .voice-list {
    padding-left: 0;
  }

  .login-art {
    min-height: 44vh;
    padding: 4rem 2rem;
  }

  .login-art h1 {
    font-size: clamp(1.9rem, 7vw, 3.3rem);
  }

  .login-subtitle {
    font-size: 1.45rem;
  }

  .inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coin-log-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-editor {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 1rem 0 0;
  }
}

@media (max-height: 620px) {
  :root {
    --topbar-title-font-size: 1.25rem;
  }

  .workspace {
    padding-top: 0.45rem;
    padding-bottom: 0.55rem;
  }

  .topbar {
    padding: 0.58rem 0.9rem;
  }

  .page-subtitle {
    display: none;
  }

  .tabs {
    padding: 0 0.9rem 0.45rem;
  }

  .tabs button {
    min-height: 34px;
    padding: 0.42rem 0.72rem;
  }

  .voice-workbench {
    height: calc(100svh - 8.6rem);
    max-height: calc(100svh - 8.6rem);
  }

  .voice-clone-workbench {
    height: calc(100svh - 8.6rem);
    max-height: calc(100svh - 8.6rem);
  }

  .clone-recorder {
    grid-template-rows: auto auto auto auto minmax(38px, auto);
  }

  .clone-samples p {
    min-height: 5.9rem;
    max-height: 6.8rem;
  }

  .clone-wave-canvas {
    height: clamp(2.8rem, 7svh, 4.4rem);
  }

  .clone-recorder-actions button {
    min-height: 58px;
    padding: 0.68rem 0.9rem;
    font-size: 0.74rem;
  }

  #cloneRecordStartBtn {
    min-height: 68px;
  }

  .voice-hero {
    padding: 0.72rem;
  }

  .voice-copy p:not(.eyebrow) {
    display: none;
  }

  .voice-settings-panel {
    padding: 0.06rem 0.28rem;
  }

  .selected-voice-panel {
    min-height: 34px;
    padding: 0.22rem 0.4rem;
  }

  .voice-wave {
    display: none;
  }

  .voice-option {
    min-height: 38px;
    padding: 0.5rem 0.65rem;
  }

  .audio-preview-stage {
    min-height: 50px;
    max-height: 56px;
    padding-top: 0.35rem;
  }

  .voice-workbench {
    grid-template-rows: minmax(0, 0.9fr) minmax(5.6rem, 18%) auto minmax(10.8rem, 12.8rem);
  }

  .voice-history-stage {
    gap: 0.32rem;
    padding-top: 0.35rem;
  }

  .voice-history-list {
    grid-auto-columns: minmax(14rem, 18rem);
    padding-bottom: 0.85rem;
  }

  .voice-history-card {
    gap: 0.24rem;
    padding: 0.42rem 0.52rem;
  }
}

@media (max-width: 680px) {
  .voice-copy h2 {
    max-width: none;
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .voice-form textarea {
    min-height: 0;
  }

  .voice-script-tools {
    padding: 0.36rem;
  }

  .voice-script-tool-group span {
    min-width: 2.3rem;
  }

  .voice-settings-head {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
  }

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

  .voice-setting-meta span {
    font-size: 0.95rem;
  }

  .voice-setting-meta strong {
    min-width: 1.65rem;
    min-height: 0.82rem;
    font-size: 0.95rem;
  }

  .selected-voice-panel {
    grid-template-columns: minmax(0, 1fr) 32px;
    min-height: 36px;
    padding: 0.24rem 0.42rem;
  }

  .voice-submit-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .voice-submit-row .form-message {
    grid-column: auto;
  }

  .voice-submit-row .create-button {
    width: 100%;
    margin-right: 0;
  }

  .voice-cost {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .voice-cost small {
    grid-column: 1 / -1;
    text-align: left;
  }

  .selected-voice-copy {
    grid-column: auto;
  }

  .voice-wave {
    display: none;
  }

  .audio-preview-stage {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 52px;
    max-height: 60px;
  }

  .voice-workbench {
    grid-template-rows: minmax(0, 0.78fr) minmax(5.2rem, 18%) auto minmax(10.2rem, 12rem);
  }

  .voice-clone-workbench {
    grid-template-rows: auto minmax(14rem, 1fr) auto;
  }

  .clone-recorder-actions button {
    padding-inline: 0.8rem;
    font-size: 0.74rem;
  }

  #cloneRecordStartBtn::before {
    width: 24px;
    height: 24px;
  }

  .clone-sample-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .voice-history-list {
    padding-bottom: 0.85rem;
  }

  .audio-preview-stage > div,
  #audioPreviewEmpty {
    display: none;
  }

  .workspace {
    width: min(100% - 16px, 1480px);
    padding-top: 0.5rem;
  }

  .topbar,
  .user-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
  }

  .creator {
    padding: 1rem;
  }

  .upload-form,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .coin-log-toolbar {
    grid-template-columns: 1fr;
  }

  .preview-stage,
  .task-detail-list {
    grid-template-columns: 1fr;
  }

  .video-frame {
    min-width: 0;
    height: min(58vh, 34rem);
  }

  .video-frame video {
    max-width: 100%;
    max-height: min(58vh, 34rem);
  }

  .preview-nav {
    width: 40px;
    min-height: 40px;
    font-size: 1.65rem;
  }

  .preview-nav.previous {
    left: 0.35rem;
  }

  .preview-nav.next {
    right: 0.35rem;
  }

  .history-media {
    min-width: 0;
    max-height: none;
  }

  .task-dialog video {
    max-width: 100%;
    max-height: min(56vh, 32rem);
  }

  .login-panel {
    padding: 2rem;
  }

  .login-art h1,
  .topbar h1 {
    font-size: var(--topbar-title-font-size);
  }

  .login-art h1 {
    font-size: clamp(1.45rem, 6.4vw, 2.2rem);
  }

  .login-subtitle {
    font-size: 1.2rem;
  }
}
