.video-page {
  --video-text: #111827;
  --video-text-2: #4b5563;
  --video-text-3: #6b7280;
  --video-border: rgba(17, 24, 39, 0.08);
  --video-border-strong: rgba(17, 24, 39, 0.16);
  --video-field-bg: #f3f4f6;
  --video-muted-card: #fff7ed;
  --video-gradient: linear-gradient(135deg, #ffb623 0%, #ea580c 55%, #fbbf24 100%);
}

.video-main {
  width: 100%;
  min-height: calc(100vh - 57px);
  padding: 40px 24px;
}

.video-content {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 24px;
}

.video-heading h1 {
  margin: 0;
  color: var(--video-text);
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 32px;
}

.video-heading p {
  margin: 4px 0 0;
  color: var(--video-text-2);
  font-size: 14px;
  line-height: 23.1px;
}

.video-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
}

.video-steps {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.video-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--video-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(17, 24, 39, 0.08);
}

.video-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.video-card__title-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
}

.video-step {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  border-radius: 50%;
  color: #fff;
  background: var(--video-gradient);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
}

.video-card h2 {
  margin: 0;
  color: var(--video-text);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 23.1px;
}

.video-card__title-row p {
  margin: 2px 0 0;
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 16px;
}

.video-card__action {
  flex: 0 0 auto;
  color: #f59e0b;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-decoration: none;
}

.video-card__action:hover {
  color: #f59e0b;
}

.video-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-stack--12 {
  gap: 12px;
}

.video-stack--8 {
  gap: 8px;
}

.video-chips {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--video-border);
  border-radius: 8px;
  background: var(--video-muted-card);
}

.video-chip {
  flex: 1 1 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  color: var(--video-text-2);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 23.1px;
  transition: color 150ms ease, background-color 150ms ease,
    box-shadow 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.video-chip:hover:not(.video-chip--active) {
  color: var(--video-text);
}

.video-chip--active {
  color: #fff;
  background: var(--video-gradient);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.video-chip:active {
  transform: translateY(1px);
}

.video-chip:disabled {
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.65;
}

.video-input {
  display: block;
  width: 100%;
  min-height: 45.09375px;
  padding: 10px 14px;
  border: 1px solid var(--video-border-strong);
  border-radius: 8px;
  outline: 0;
  color: var(--video-text);
  background: var(--video-field-bg);
  font-size: 14px;
  line-height: 23.1px;
  transition: border-color 150ms ease, background-color 150ms ease,
    box-shadow 150ms ease;
}

.video-input::placeholder {
  color: var(--video-text-3);
  opacity: 1;
}

.video-input:focus {
  border-color: #f59e0b;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.video-input[type="file"],
.video-file {
  cursor: pointer;
  padding-top: 8px;
  padding-bottom: 8px;
}

.video-file::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  color: var(--video-text-2);
  background: #fff7ed;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.video-selected-file {
  margin: 8px 0 0;
  color: var(--video-text-2);
  font-size: 12px;
  line-height: 16px;
}

.video-avatar-preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.video-avatar-preview > div {
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid var(--video-border-strong);
  border-radius: 12px;
  background: var(--video-muted-card);
}

.video-avatar-preview img {
  display: block;
  width: 100%;
  max-height: 288px;
  margin: 0 auto;
  object-fit: contain;
}

.video-empty-hint {
  padding: 24px;
  border: 1px dashed #e7d4bd;
  border-radius: 12px;
  color: var(--video-text-3);
  background: #fff8ef;
  font-size: 14px;
  line-height: 23.1px;
  text-align: center;
}

.video-empty-hint a {
  color: var(--video-text-2);
  font-weight: 500;
  text-underline-offset: 2px;
}

.video-empty-hint .video-button-secondary {
  margin: 12px auto 0;
}

.video-media-library {
  min-width: 0;
}

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

.video-library-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-library-grid > .video-empty-hint,
.video-library-list > .video-empty-hint {
  grid-column: 1 / -1;
}

.video-library-item {
  display: flex;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--video-border-strong);
  border-radius: 8px;
  color: var(--video-text-2);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease,
    box-shadow 150ms ease;
}

.video-library-grid .video-library-item {
  flex-direction: column;
  gap: 8px;
}

.video-library-list .video-library-item {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-library-item:hover {
  border-color: rgba(245, 158, 11, 0.45);
  background: #fff8ef;
}

.video-library-item[aria-pressed="true"] {
  border-color: #f59e0b;
  background: #fff7ed;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.16);
}

.video-library-item__preview {
  position: relative;
  display: flex;
  width: 100%;
  aspect-ratio: 1 / 1;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  background: var(--video-muted-card);
}

.video-library-item__preview img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.video-library-item__preview img[hidden] {
  display: none !important;
}

.video-library-item__preview-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.video-library-item__preview-placeholder[hidden] {
  display: none !important;
}

.video-library-item__preview[data-video-media-state="loading"] .video-library-item__preview-placeholder::before {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(245, 158, 11, 0.25);
  border-top-color: #f59e0b;
  border-radius: 50%;
  content: '';
  animation: video-library-preview-spin 700ms linear infinite;
}

.video-library-item__preview[data-video-media-state="error"] .video-library-item__preview-placeholder {
  color: #b45309;
}

@keyframes video-library-preview-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-library-item__preview[data-video-media-state="loading"] .video-library-item__preview-placeholder::before {
    animation-duration: 1.5s;
  }
}

.video-library-item__details {
  min-width: 0;
}

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

.video-library-item strong {
  font-size: 13px;
  line-height: 20px;
}

.video-library-item small {
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 18px;
}

.video-audio-preview {
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.video-audio-preview audio {
  display: block;
  width: 100%;
  height: 40px;
}

.video-script {
  min-height: 144px;
  resize: vertical;
  line-height: 23.1px;
}

.video-counter {
  margin: 0;
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 16px;
  text-align: right;
}

.video-counter--limit {
  color: #be123c;
}

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

.video-goods-grid__wide {
  grid-column: 1 / -1;
}

.video-goods-copy {
  min-height: 96px;
  resize: vertical;
}

.video-label {
  display: block;
  margin: 0 0 6px;
  color: var(--video-text-3);
  font-size: 14px;
  font-weight: 500;
  line-height: 23.1px;
}

.video-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.video-label-row .video-label {
  margin: 0;
}

.video-voice-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

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

.video-help {
  margin: 6px 0 0;
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 19.8px;
}

.video-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 9999px;
  color: #c56e00;
  background: rgba(245, 158, 11, 0.12);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.video-range {
  width: 100%;
  margin: 12px 0 0;
  accent-color: #f59e0b;
}

.video-clone {
  gap: 12px;
}

.video-recording {
  gap: 16px;
}

.video-recording__section {
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.video-recording__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.video-recording__status {
  color: var(--video-text-3);
  font-size: 13px;
  line-height: 20px;
}

.video-recording__status[data-state="recording"] {
  color: #b91c1c;
  font-weight: 600;
}

.video-listen {
  margin-top: 16px;
}

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

.video-listen > div {
  display: flex;
  gap: 8px;
}

.video-listen .video-input {
  flex: 1;
}

.video-listen > .video-system-preview {
  display: block;
  margin-top: 12px;
}

.video-system-preview[hidden] {
  display: none;
}

.video-system-preview audio {
  display: block;
  width: 100%;
  height: 48px;
}

.video-button-secondary {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--video-border-strong);
  border-radius: 8px;
  color: var(--video-text-2);
  background: var(--video-muted-card);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 23.1px;
  transition: color 150ms ease, border-color 150ms ease,
    background-color 150ms ease;
}

[data-video-listen][hidden] {
  display: none;
}

.video-button-secondary:hover {
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--video-text);
  background: #ffedd5;
}

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

.video-button-secondary--danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff1f2;
}

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

.video-duration-field {
  margin-bottom: 16px;
}

.video-duration-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.video-duration-option {
  position: relative;
  min-width: 0;
  cursor: default;
}

.video-duration-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.video-duration-option > span {
  display: flex;
  min-height: 64px;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--video-border-strong);
  border-radius: 8px;
  color: var(--video-text-2);
  background: var(--video-field-bg);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.video-duration-option strong {
  color: var(--video-text);
  font-size: 14px;
  line-height: 22px;
}

.video-duration-option small {
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 20px;
}

.video-duration-option input:checked + span {
  border-color: #f59e0b;
  background: #fff7ed;
}

.video-duration-option input:focus-visible + span {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

.video-duration-state {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 20px;
}

.video-duration-state--ready {
  color: #047857;
}

.video-duration-state--error {
  color: #be123c;
}

.video-subtitle-settings {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.video-subtitle-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-subtitle-copy {
  min-height: 88px;
  resize: vertical;
  line-height: 22px;
}

.video-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-color-row input[type="color"] {
  width: 56px;
  height: 40px;
  flex: 0 0 56px;
  padding: 4px;
  border: 1px solid var(--video-border-strong);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.video-color-text {
  font-family: "Courier New", Courier, monospace;
}

.video-subtitle-preview {
  display: flex;
  width: 100%;
  min-height: 144px;
  max-height: 192px;
  aspect-ratio: 16 / 9;
  align-items: flex-end;
  justify-content: center;
  padding: 32px 12px 12px;
  border-radius: 8px;
  background: var(--video-gradient);
}

.video-subtitle-preview p {
  max-width: 100%;
  margin: 0;
  color: #fff;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.375;
  text-align: center;
  overflow-wrap: anywhere;
}

.video-sidebar {
  position: sticky;
  top: 72px;
}

.video-sidebar__card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.video-sidebar__card .video-input {
  background: var(--video-field-bg);
}

.video-status-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: var(--video-muted-card);
}

.video-status-list > div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 16px;
}

.video-status-list > div:has(.video-status-dot--ready) {
  color: var(--video-text-2);
}

.video-status-dot {
  display: inline-flex;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--video-muted-card);
}

.video-status-dot--ready {
  background: #10b981;
}

.video-retention {
  margin: 0;
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 19.8px;
}

.video-cost {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  background: #fff8ef;
}

.video-cost__main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--video-text-2);
  font-size: 13px;
  line-height: 20px;
}

.video-cost__main strong {
  color: #c56e00;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.video-cost__main strong span {
  font-variant-numeric: tabular-nums;
}

.video-cost p {
  margin: 4px 0 0;
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 18px;
}

.video-submit {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--video-gradient);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.28);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 23.1px;
  transition: filter 150ms ease, opacity 150ms ease,
    box-shadow 150ms ease, transform 150ms ease;
}

.video-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.video-submit:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.video-submit-hint {
  margin: -4px 0 0;
  color: var(--video-text-3);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
}

[data-video-panel][hidden],
.video-avatar-preview[hidden],
[data-video-record-stop][hidden],
[data-video-record-clear][hidden],
[data-video-subtitle-copy-field][hidden],
[data-video-subtitle-settings][hidden] {
  display: none;
}

@media (max-width: 1023px) {
  .video-layout {
    grid-template-columns: 1fr;
  }

  .video-sidebar {
    position: static;
  }
}

@media (max-width: 900px) {
  .video-main {
    padding: 28px 16px 40px;
  }
}

@media (max-width: 640px) {
  .video-main {
    padding: 24px 12px 36px;
  }

  .video-heading h1 {
    font-size: 22px;
    line-height: 30px;
  }

  .video-card {
    padding: 16px;
  }

  .video-card__header {
    margin-bottom: 16px;
  }

  .video-chips {
    width: 100%;
  }

  .video-chip {
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 12px;
  }

  .video-voice-grid,
  .video-output-grid,
  .video-duration-options,
  .video-subtitle-settings,
  .video-goods-grid,
  .video-library-grid {
    grid-template-columns: 1fr;
  }

  .video-goods-grid__wide {
    grid-column: auto;
  }

  .video-listen > div {
    align-items: stretch;
  }

  .video-recording__actions {
    align-items: stretch;
  }

  .video-subtitle-preview {
    min-height: 128px;
  }
}

@media (max-width: 420px) {
  .video-card__header {
    flex-direction: column;
  }

  .video-card__action {
    margin-left: 36px;
  }

  .video-listen > div {
    flex-direction: column;
  }
}
