:root {
  --navy-950: #07172d;
  --navy-900: #0c1d35;
  --navy-800: #142845;
  --paper: #f4f6fa;
  --surface: #ffffff;
  --line: #d9dee8;
  --ink: #0b1c35;
  --muted: #647086;
  --gold: #c4a15a;
  --gold-dark: #927138;
  --danger: #b44b3f;
  --radius: 8px;
  --font-sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-compact: "DIN Alternate", "Bahnschrift", "Segoe UI", var(--font-sans);
  --weight-title: 800;
  --weight-strong: 700;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100dvh;
  padding-bottom: 86px;
  background: linear-gradient(180deg, var(--navy-950) 0 74px, var(--paper) 74px 100%);
}

.topbar,
.content-band {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.topbar {
  padding-top: 14px;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.brand,
.top-actions,
.section-heading,
.block-title,
.progress-top,
.action-row,
.profile-head,
.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark,
.avatar-button,
.profile-avatar {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #06152b;
  font-weight: var(--weight-title);
}

.brand-name,
.brand-sub,
.eyebrow {
  margin: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: var(--weight-title);
}

.brand-sub {
  margin-top: 2px;
  color: #8ea0ba;
  font-size: 11px;
}

.top-actions {
  gap: 10px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
  color: #dfe7f5;
  transition: transform .22s cubic-bezier(.16,1,.3,1), background .22s;
}

.icon-button.light {
  background: #fff;
  color: var(--navy-800);
  border-color: var(--line);
}

.content-band {
  padding-top: 20px;
  padding-bottom: 34px;
}

.tab-page {
  animation: pageIn .32s cubic-bezier(.16,1,.3,1) both;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.eyebrow {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: var(--weight-strong);
  letter-spacing: .01em;
}

.section-heading h2,
.profile-card h2 {
  margin: 4px 0 0;
  font-size: 25px;
  line-height: 1.18;
  font-weight: var(--weight-title);
  letter-spacing: 0;
}

.soft-pill,
.status-dot {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-compact);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-dot.is-done {
  background: #eaf3ec;
  color: #3b7450;
}

.generate-layout {
  display: grid;
  gap: 12px;
}

.voice-panel,
.video-card,
.creator-panel,
.profile-card,
.asset-toolbar,
.voice-clone-box,
.task-row {
  background: var(--surface);
  border: 1px solid #e1e6ef;
  border-radius: var(--radius);
  box-shadow: 0 18px 44px -30px rgba(7,23,45,.45);
}

.helper-text,
.asset-note,
.voice-clone-box p,
.profile-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.sub-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eaf0f7;
}

.generate-tabs {
  grid-template-columns: repeat(2, 1fr);
}

.task-filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.task-filter {
  min-height: 34px;
  border: 1px solid #dce3ee;
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--weight-strong);
}

.task-filter.is-active {
  border-color: var(--gold);
  background: #fff7e7;
  color: var(--gold-dark);
  box-shadow: inset 0 0 0 1px rgba(196,161,90,.22);
}

.sub-tab {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: var(--weight-strong);
}

.sub-tab.is-active {
  background: var(--navy-950);
  color: #fff;
  font-weight: var(--weight-title);
}

.material-pane {
  animation: pageIn .24s cubic-bezier(.16,1,.3,1) both;
}

.block-title {
  justify-content: space-between;
  margin-bottom: 10px;
}

.block-title h3,
.video-card h3 {
  margin: 0;
  font-weight: var(--weight-title);
  line-height: 1.32;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--gold-dark);
  font-weight: var(--weight-strong);
}

.text-button:disabled {
  color: #aab3c2;
  cursor: not-allowed;
}

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

.material-item {
  position: relative;
  min-width: 0;
}

.material-item > .image-card {
  width: 100%;
}

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

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

.hot-tag-filter {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.hot-tag-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(189, 155, 98, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #4f3a19;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
}

.hot-tag-pill.is-active {
  background: #bd9b62;
  color: #0b1728;
}

.image-card {
  position: relative;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(145deg, #172a46, #c4a15a);
  aspect-ratio: 9 / 14;
  box-sizing: border-box;
  transition: transform .22s cubic-bezier(.16,1,.3,1), box-shadow .22s;
}

.image-card.real-image,
.mini-choice.real-image {
  background: var(--img) center / cover no-repeat;
}

.image-card:hover,
.video-card:hover {
  transform: translateY(-2px);
}

.image-card.portrait::before,
.mini-choice.portrait::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 38%;
  height: 58%;
  transform: translateX(-50%);
  border-radius: 999px 999px 14px 14px;
  background: rgba(255,255,255,.72);
}

.image-card.real-image.portrait::before,
.mini-choice.real-image.portrait::before {
  content: none;
}

.image-card span {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(7,23,45,.78);
  color: #f0c45e;
  font-size: 12px;
  font-weight: var(--weight-strong);
}

.add-card {
  border: 1px dashed #b9c2d1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: #f8fafc;
  color: var(--navy-800);
}

.add-card svg {
  width: 30px;
  height: 30px;
}

.add-card.is-loaded {
  border-style: solid;
  border-color: var(--gold);
  background: #fffaf0;
}

.bg.warm {
  background: linear-gradient(135deg, #e8d7b1, #b7934a);
}

.bg.green,
.green-tone {
  background: linear-gradient(135deg, #243b31, #a9b59e);
}

.bg.blue {
  background: linear-gradient(135deg, #102441, #647d9a);
}

.voice-table,
.task-list {
  display: grid;
  gap: 10px;
}

.voice-row {
  display: grid;
  grid-template-columns: 30px minmax(110px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.voice-row::before {
  content: "";
  width: 24px;
  height: 24px;
  background: url("/assets/voice-wave.png") center / contain no-repeat;
}

.voice-name-input,
.text-input,
.modal-title-input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-weight: var(--weight-title);
  outline: none;
}

.voice-name-input:not([readonly]),
.text-input:focus,
.modal-title-input:not([readonly]) {
  border-color: var(--gold);
  background: #fffaf0;
  padding: 6px 8px;
}

.voice-status {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #eef2f8;
  color: var(--navy-900);
  font-weight: var(--weight-strong);
}

.voice-row[data-status="enabled"] .voice-status {
  color: #3b7450;
  background: #eaf3ec;
}

.voice-row[data-status="disabled"] .voice-status {
  color: var(--muted);
}

.voice-row[data-status="cloning"] .voice-status {
  color: var(--gold-dark);
  background: #fff7e5;
}

.voice-row button:disabled,
.voice-clone-actions button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.danger-text {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: var(--weight-strong);
}

.voice-clone-box {
  position: relative;
  margin-top: 12px;
  padding: 14px;
}

.voice-clone-box.is-coming-soon {
  background: #f4f6fa;
  border-color: #d8dee8;
  box-shadow: none;
  min-height: 176px;
  padding-top: 72px;
  opacity: .78;
}

.coming-soon-badge {
  position: absolute;
  left: 50%;
  top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(86%, 280px);
  min-height: 44px;
  padding: 0 14px;
  transform: translateX(-50%) rotate(-1.5deg);
  border: 1px solid rgba(191,157,91,.42);
  border-radius: 8px;
  background: rgba(255,250,238,.92);
  color: #6f5526;
  font-size: clamp(18px, 5vw, 24px);
  font-weight: var(--weight-strong);
  text-align: center;
  box-shadow: 0 14px 28px -24px rgba(7,23,45,.45);
}

.voice-clone-box.is-coming-soon .field-label,
.voice-clone-box.is-coming-soon .helper-text {
  color: #8b96a8;
}

.voice-clone-box.is-coming-soon .text-input,
.voice-clone-box.is-coming-soon button {
  cursor: not-allowed;
}

.text-input {
  min-height: 42px;
  border-color: var(--line);
  background: #fbfcfe;
  padding: 0 12px;
}

.voice-clone-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.video-card {
  position: relative;
  padding: 10px;
  transition: transform .22s cubic-bezier(.16,1,.3,1);
}

.video-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  min-height: auto;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  display: block;
  color: #fff;
  background:
    radial-gradient(circle at 70% 26%, rgba(97,112,84,.65), transparent 24%),
    linear-gradient(90deg, #090909, #161719 42%, #111);
}

.real-media {
  background: #111923;
}

.demo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-preview.large {
  min-height: 430px;
  aspect-ratio: auto;
}

.gold-tone {
  background: linear-gradient(135deg, #111923, #c4a15a 70%, #2b2113);
}

.video-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.74) 0%, rgba(0,0,0,.46) 34%, rgba(0,0,0,.16) 68%, rgba(0,0,0,0) 100%) top / 100% 92px no-repeat,
    linear-gradient(180deg, transparent 62%, rgba(7,23,45,.7));
  pointer-events: none;
}

.video-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: rgba(8, 15, 28, .58);
  color: rgba(255,255,255,.92);
  font-family: var(--font-compact);
  font-size: clamp(22px, 7vw, 34px);
  font-weight: var(--weight-title);
  letter-spacing: 0;
  pointer-events: none;
}

.video-loading-overlay[hidden] {
  display: none;
}

.video-label,
.caption-line,
.play-mark,
.overlay-title,
.duration-badge,
.asset-date,
.center-play {
  position: absolute;
  z-index: 1;
  font-family: var(--font-compact);
  font-weight: var(--weight-title);
  letter-spacing: 0;
}

.video-label {
  top: 14px;
  left: 16px;
  font-size: 13px;
}

.caption-line {
  top: 38px;
  left: 16px;
  right: 16px;
  color: #f8d64c;
  line-height: 1.35;
  text-align: left;
}

.speaker-frame {
  position: absolute;
  left: 50%;
  bottom: 62px;
  width: 42%;
  max-width: 132px;
  height: 58%;
  transform: translateX(-50%);
}

.face {
  display: block;
  width: 58px;
  height: 68px;
  margin: 0 auto;
  border-radius: 48% 48% 44% 44%;
  background: linear-gradient(#e7c0a0, #c89376);
  border: 4px solid #222;
}

.face.cloned {
  background: linear-gradient(#d9b896, #a8755f);
}

.torso {
  display: block;
  height: 132px;
  margin-top: -8px;
  border-radius: 34px 34px 0 0;
  background: linear-gradient(145deg, #3f535b, #222f36);
}

.play-mark {
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.overlay-title {
  top: 12px;
  left: 10px;
  right: 10px;
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
}

#page-hot .video-card .overlay-title,
.asset-card .overlay-title {
  font-size: 10.5px;
  line-height: 1.22;
}

.asset-date {
  top: 44px;
  left: 10px;
  right: 10px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
}

.video-tags {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 62px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.video-tags em {
  border-radius: 999px;
  background: rgba(10, 17, 30, 0.5);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  padding: 4px 6px;
}

.center-play {
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
}

.duration-badge {
  left: 10px;
  bottom: 10px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(7,23,45,.72);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.transcript-card-btn {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 3;
  min-height: 26px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(7,23,45,.72);
  color: #fff;
  font-family: var(--font-compact);
  font-size: 12px;
  font-weight: var(--weight-title);
  line-height: 1;
}

.video-card h3 {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.45;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--danger);
  background: #f5e5e0;
}

.generate-layout {
  grid-template-columns: minmax(0, .95fr) minmax(340px, 1fr);
  align-items: start;
}

.generate-pane {
  animation: pageIn .24s cubic-bezier(.16,1,.3,1) both;
}

.result-stage,
.creator-panel {
  min-width: 0;
}

.creator-panel {
  padding: 16px;
}

.replicate-source {
  min-height: 72px;
}

.selected-template {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.selected-template-media {
  position: relative;
  aspect-ratio: 9 / 14;
  overflow: hidden;
  border-radius: 7px;
  background: #111923;
}

.selected-template-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-template-text {
  min-width: 0;
}

.selected-template-text strong {
  display: block;
  color: var(--navy-950);
  font-size: 14px;
  line-height: 1.35;
}

.selected-template-text span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.step-group,
.progress-card,
.action-row,
.asset-note {
  margin-top: 16px;
}

.creator-panel > .step-group {
  padding: 12px;
  border: 1px solid #dde4ee;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

.creator-panel > .step-group:first-child {
  margin-top: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--navy-900);
  font-size: 13px;
  font-weight: var(--weight-strong);
  letter-spacing: 0;
}

.creator-panel > .step-group > .field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: var(--weight-title);
}

.creator-panel > .step-group > .field-label::after {
  content: "";
  flex: 1;
  height: 1px;
  min-width: 24px;
  background: linear-gradient(90deg, rgba(196,161,90,.62), rgba(196,161,90,0));
}

.step-index {
  display: inline-grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  box-shadow: 0 8px 18px -12px rgba(146,113,56,.9);
  font-family: var(--font-compact);
  font-size: 12px;
  font-weight: var(--weight-title);
}

.choice-row,
.frame-grid,
.voice-select {
  display: grid;
  gap: 8px;
}

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

.mini-choice {
  position: relative;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, #172a46, #c4a15a);
}

.mini-choice {
  aspect-ratio: 9 / 14;
}

.mini-choice.alt {
  background: linear-gradient(160deg, #263d31, #dfd0af);
}

.add-choice {
  display: grid;
  place-items: center;
  color: var(--navy-800);
  background: #f3f6fa;
}

.generated-frame {
  width: 100%;
  margin-top: 12px;
  margin-bottom: 16px;
}

.frame-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.confirmed-frame-slot {
  margin-top: 12px;
}

.confirmed-frame-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.confirmed-frame-card {
  width: 33.333%;
  max-width: 180px;
}

.confirmed-frame-card .image-card {
  width: 100%;
}

.confirmed-frame-clear {
  position: absolute;
  left: calc(50% + min(16.666%, 90px) + 8px);
  top: 0;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(196,161,90,.45);
  border-radius: 50%;
  background: #fff;
  color: var(--gold-dark);
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 12px 24px -18px rgba(7,23,45,.45);
}

.frame-modal-panel {
  width: min(760px, 100%);
}

.frame-modal-content {
  max-height: min(72dvh, 760px);
  overflow: auto;
  padding-right: 2px;
}

.frame-select-grid {
  margin-top: 12px;
  margin-bottom: 16px;
}

.material-item.is-dragging {
  opacity: .34;
  transform: scale(.98);
}

.media-grid.is-reordering .material-item {
  opacity: .42;
}

.material-pane:not(.is-managing) .material-item {
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.material-item.is-pointer-dragging {
  z-index: 2;
  opacity: .32;
}

.media-grid.is-reordering .material-item.is-pointer-dragging {
  opacity: .28;
}

.material-drag-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  pointer-events: none;
  opacity: .95;
  transform-origin: 0 0;
  filter: drop-shadow(0 18px 30px rgba(7,23,45,.26));
}

.image-card.is-selected,
.mini-choice.is-selected,
.voice-pick.is-selected {
  border-color: var(--gold) !important;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px rgba(196,161,90,.82),
    0 18px 34px -22px rgba(7,23,45,.7);
  transform: translateY(-1px);
}

.image-card.is-selected::after,
.mini-choice.is-selected::after,
.voice-pick.is-selected::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 45%, #fff 46% 55%, transparent 56%) 5px 8px / 8px 5px no-repeat,
    var(--gold);
  box-shadow: 0 4px 10px rgba(7,23,45,.22);
}

.voice-pick.is-selected::after {
  top: 50%;
  right: 52px;
  transform: translateY(-50%);
}

.voice-select {
  grid-template-columns: 1fr;
  margin-bottom: 16px;
}

.voice-pick {
  position: relative;
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.voice-pick-play {
  border: 0;
  background: transparent;
  color: inherit;
}

.voice-pick-play {
  padding: 0 4px;
  color: var(--gold-dark);
  font-weight: var(--weight-strong);
}

.progress-card {
  padding: 12px;
  border-radius: var(--radius);
  background: #f5f7fb;
  border: 1px solid #e2e7ef;
}

.progress-top {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-compact);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7ebf2;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  opacity: .72;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(196,161,90,0) 21%,
      rgba(196,161,90,.24) 38%,
      rgba(196,161,90,.46) 50%,
      rgba(196,161,90,.24) 62%,
      rgba(196,161,90,0) 79%,
      transparent 100%
    ) 0 0 / 33.333% 100% repeat-x;
}

.progress-card.is-active .progress-track span {
  width: 100%;
  animation: progressDrift 10s linear infinite;
}

@keyframes progressDrift {
  0% {
    background-position-x: 0;
  }
  100% {
    background-position-x: 100%;
  }
}

.script-confirm,
.transcript-viewer {
  min-height: 132px;
  border-color: var(--line);
  background: #fbfcfe;
  padding: 10px 12px;
  line-height: 1.65;
  resize: vertical;
}

.script-confirm:focus {
  border-color: var(--line);
  background: #fbfcfe;
  padding: 10px 12px;
}

.transcript-viewer:focus {
  border-color: var(--line);
  background: #fbfcfe;
  padding: 10px 12px;
}

.transcript-viewer {
  min-height: min(58dvh, 520px);
  margin-top: 14px;
}

.transcript-panel {
  width: min(760px, 100%);
}

.primary-button,
.outline-button,
.ghost-button,
.danger-button,
.manage-btn {
  min-height: 42px;
  border-radius: var(--radius);
  font-weight: var(--weight-strong);
  transition: transform .22s cubic-bezier(.16,1,.3,1), background .22s, border-color .22s;
}

.primary-button {
  width: 100%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--navy-950);
  color: #fff;
}

.outline-button,
.manage-btn {
  border: 1px solid var(--gold);
  background: #fff;
  color: var(--gold-dark);
}

.outline-button.full {
  width: 100%;
  margin-top: 16px;
}

.ghost-button {
  border: 0;
  background: #f0f3f8;
  color: var(--navy-900);
}

.danger-button {
  border: 0;
  background: var(--danger);
  color: #fff;
  padding: 0 14px;
}

.action-row {
  gap: 10px;
}

.action-row > * {
  flex: 1;
}

.task-row {
  min-height: 64px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.task-row span {
  color: var(--muted);
  font-family: var(--font-compact);
  font-variant-numeric: tabular-nums;
}

.task-row strong {
  font-weight: var(--weight-title);
}

.task-detail {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.task-detail small {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--weight-strong);
}

.task-row[data-task-status="queued"] strong {
  color: #647086;
}

.task-row[data-task-status="running"] strong {
  color: var(--gold-dark);
}

.task-row[data-task-status="done"] strong {
  color: #3b7450;
}

.task-row[data-task-status="failed"] strong {
  color: var(--danger);
}

.asset-note {
  text-align: center;
}

.asset-note.is-success {
  color: #3b7450;
  font-weight: var(--weight-strong);
}

.asset-toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  justify-content: space-between;
}

.asset-card .select-check {
  display: none;
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  place-items: center;
  background: rgba(255,255,255,.9);
}

.material-item .select-check {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  place-items: center;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 18px -14px rgba(7,23,45,.62);
}

.asset-wall.is-managing .select-check {
  display: grid;
}

.material-pane.is-managing .material-item .select-check {
  display: grid;
}

.material-pane.is-managing .voice-row.material-item {
  grid-template-columns: 30px 28px minmax(110px, 1fr) auto auto auto auto;
}

.voice-row.material-item .select-check {
  position: static;
}

.select-check input {
  accent-color: var(--gold-dark);
}

.profile-card {
  padding: 18px;
}

.profile-head {
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar {
  width: 58px;
  height: 58px;
  font-size: 24px;
}

.settings-list {
  display: grid;
  margin-top: 8px;
}

.settings-list button {
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--navy-900);
}

.settings-list strong {
  font-weight: var(--weight-strong);
}

.logout-button {
  color: var(--danger) !important;
}

.logged-out-card {
  display: grid;
  gap: 16px;
}

.logged-out-card .profile-head {
  border-bottom: 0;
  padding-bottom: 0;
}

.bottom-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px max(12px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
  background: rgba(255,255,255,.92);
  border-top: 1px solid rgba(217,222,232,.9);
  backdrop-filter: blur(16px);
}

.bottom-tab {
  min-height: 54px;
  border: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--weight-strong);
}

.bottom-tab.is-active {
  background: var(--navy-950);
  color: #fff;
  font-weight: var(--weight-title);
}

.bottom-tab.is-locked {
  opacity: .48;
}

.modal,
.dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7,23,45,.68);
}

.modal-panel,
.dialog-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  border-radius: 14px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 28px 70px -34px rgba(0,0,0,.55);
}

.dialog-panel {
  width: min(390px, 100%);
  padding: 18px;
}

.dialog-panel h3 {
  margin: 0;
  font-weight: var(--weight-title);
}

.dialog-panel p {
  margin: 8px 0 16px;
  color: var(--muted);
}

#taskErrorMessage {
  max-height: min(42dvh, 260px);
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.6;
}

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

.confirm-actions .outline-button,
.confirm-actions .danger-button {
  width: 100%;
}

.password-form {
  display: grid;
  gap: 8px;
  margin: 14px 0 16px;
}

.dialog-status {
  min-height: 20px;
  margin: -6px 0 14px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.modal-head,
.modal-actions {
  justify-content: space-between;
  gap: 10px;
}

.modal-head .outline-button {
  flex: 0 0 auto;
  min-width: 64px;
  padding-inline: 14px;
  white-space: nowrap;
}

.modal-title-edit {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.modal-title-input {
  font-size: 18px;
  line-height: 1.25;
}

.modal-title-input.is-editable-title:not([readonly]) {
  border-color: transparent;
  background: transparent;
  padding: 0;
}

.modal-media {
  min-height: 420px;
  margin: 14px 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #102441, #c4a15a);
  overflow: hidden;
}

.modal-media .video-preview,
.modal-media .image-card,
.modal-media .mini-choice {
  width: 100%;
  min-height: 420px;
  border-radius: var(--radius);
}

.modal-video {
  width: 100%;
  max-height: calc(100dvh - 180px);
  border-radius: var(--radius);
  background: #111923;
}

.modal-actions .outline-button,
.modal-actions .primary-button {
  width: auto;
  flex: 1;
}

button:active {
  transform: translateY(1px) scale(.98);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .topbar,
  .content-band {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-sub {
    display: none;
  }

  .generate-layout {
    grid-template-columns: 1fr;
  }

  .video-preview.large {
    min-height: 220px;
  }

  .speaker-frame {
    width: 112px;
    height: 160px;
    bottom: 54px;
  }

  .face {
    width: 48px;
    height: 56px;
  }

  .torso {
    height: 104px;
  }

  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

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

  .confirmed-frame-card {
    width: 33.333%;
  }
}

@media (max-width: 420px) {
  .video-card {
    padding: 6px;
  }

  .video-card h3 {
    font-size: 12px;
  }

  .caption-line {
    font-size: 11px;
  }

  .video-label,
  .play-mark,
  .meta-row {
    font-size: 10px;
  }

  .video-card .overlay-title {
    font-size: 10px;
  }
}
