.tv-mode .tool-hero {
  display: none;
}

.tv-mode .tool-detail-head {
  display: none;
}

.tv-mode {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
}

.tv-root {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.tv-root,
.tv-root * {
  box-sizing: border-box;
}

.tv-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tv-page.hidden {
  display: none;
}

.tv-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tv-back-link:hover {
  background: #f1f5f9;
  color: #334155;
}

.tv-back-link svg {
  width: 18px;
  height: 18px;
  color: #6366f1;
}

.tv-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tv-page-head-copy {
  min-width: 0;
}

.tv-page-head-copy p {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.tv-page-head-copy h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.tv-form-card,
.tv-result-card,
.tv-history-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.tv-form-header,
.tv-stage-header,
.tv-history-head,
.tv-state-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tv-form-header-copy,
.tv-stage-copy {
  flex: 1;
  min-width: 0;
}

.tv-form-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  background: #ede9fe;
  color: #6366f1;
}

.tv-form-header-icon svg {
  width: 16px;
  height: 16px;
}

.tv-form-header h3,
.tv-stage-copy h3,
.tv-history-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.tv-form-header p,
.tv-stage-copy p,
.tv-history-subtitle {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #64748b;
}

.tv-history-head {
  align-items: center;
  justify-content: space-between;
}

.tv-history-tag {
  margin: 0 0 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.tv-history-count {
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
}

.tv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tv-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.tv-title-input,
.tv-textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.tv-title-input {
  min-height: 44px;
  padding: 0 12px;
}

.tv-textarea {
  min-height: 140px;
  padding: 12px;
  line-height: 1.6;
  resize: vertical;
}

.tv-title-input:focus,
.tv-textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: #fff;
}

.tv-field-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tv-field-hint {
  font-size: 0.72rem;
  line-height: 1.5;
  color: #94a3b8;
}

.tv-char-count {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.tv-char-count.is-near-limit {
  color: #d97706;
}

.tv-char-count.is-at-limit {
  color: #dc2626;
}

.tv-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 210px;
  padding: 24px 16px;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tv-upload-area:hover {
  border-color: #6366f1;
  background: #f5f3ff;
}

.tv-upload-area.has-photo {
  border-style: solid;
  border-color: #6366f1;
  padding: 8px;
}

.tv-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ede9fe;
  color: #6366f1;
}

.tv-upload-icon svg {
  width: 22px;
  height: 22px;
}

.tv-upload-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.tv-upload-sub {
  font-size: 0.72rem;
  color: #94a3b8;
}

.tv-upload-preview {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.tv-upload-change {
  font-size: 0.72rem;
  color: #6366f1;
}

.tv-ratio-group {
  display: flex;
  gap: 8px;
}

.tv-ratio-option {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tv-ratio-option strong {
  font-size: 0.82rem;
  font-weight: 700;
}

.tv-ratio-option span {
  font-size: 0.72rem;
  color: #94a3b8;
}

.tv-ratio-option.active {
  border-color: #6366f1;
  background: #ede9fe;
  color: #4f46e5;
}

.tv-ratio-option.active span {
  color: #6366f1;
}

.tv-submit-btn,
.tv-download-btn,
.tv-secondary-btn,
.tv-recent-delete {
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.tv-submit-btn,
.tv-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  cursor: pointer;
}

.tv-submit-btn {
  background: #6366f1;
  color: #fff;
}

.tv-submit-btn:hover,
.tv-download-btn:hover {
  opacity: 0.92;
}

.tv-submit-btn:disabled,
.tv-download-btn:disabled,
.tv-secondary-btn:disabled,
.tv-recent-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tv-download-btn {
  background: #0f172a;
  color: #fff;
}

.tv-actions {
  display: flex;
  gap: 10px;
}

.tv-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}

.tv-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tv-result-time {
  font-size: 0.74rem;
  color: #64748b;
}

.tv-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.tv-status-badge.is-pending {
  background: #eef2ff;
  color: #4f46e5;
}

.tv-status-badge.is-success {
  background: #ecfdf3;
  color: #15803d;
}

.tv-status-badge.is-failed {
  background: #fef2f2;
  color: #dc2626;
}

.tv-state-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.tv-state-header {
  align-items: center;
}

.tv-state-dot {
  width: 10px;
  height: 10px;
  margin-top: 2px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #6366f1;
}

.tv-state-header.is-success .tv-state-dot {
  background: #16a34a;
}

.tv-state-header.is-failed .tv-state-dot {
  background: #dc2626;
}

.tv-state-copy {
  flex: 1;
  min-width: 0;
}

.tv-state-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
}

.tv-state-meta {
  margin-top: 2px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #64748b;
}

.tv-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tv-progress-fill {
  width: 60%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #818cf8, #6366f1);
  animation: tv-pulse 2s ease-in-out infinite;
}

.tv-stage-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.tv-stage-photo-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  overflow: hidden;
}

.tv-stage-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.tv-stage-photo.is-generating {
  filter: saturate(0.9) brightness(0.88);
}

.tv-stage-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.tv-stage-info strong {
  font-size: 0.88rem;
  color: #1e293b;
}

.tv-stage-info span {
  font-size: 0.74rem;
  line-height: 1.6;
  color: #64748b;
}

.tv-video-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #0f172a;
  overflow: hidden;
}

.tv-video-player {
  display: block;
  width: 100%;
  max-height: 560px;
  background: #020617;
}

.tv-msg {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.6;
  background: #eef2ff;
  color: #4f46e5;
}

.tv-msg.hidden {
  display: none;
}

.tv-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tv-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tv-history-item:hover {
  background: #f1f5f9;
}

.tv-history-item.is-active {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.tv-history-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tv-history-main strong {
  font-size: 0.85rem;
  color: #1e293b;
}

.tv-history-main span {
  font-size: 0.72rem;
  color: #64748b;
}

.tv-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tv-recent-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #94a3b8;
  cursor: pointer;
}

.tv-recent-delete:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.tv-history-empty {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 0.78rem;
  text-align: center;
  color: #94a3b8;
}

.tv-hidden-input {
  display: none;
}

@keyframes tv-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes tv-pulse {
  0%,
  100% {
    opacity: 0.72;
  }

  50% {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .tv-stage-preview {
    grid-template-columns: 1fr;
  }

  .tv-stage-photo {
    min-height: 180px;
  }

  .tv-actions {
    flex-direction: column;
  }

  .tv-history-item {
    align-items: flex-start;
  }

  .tv-history-actions {
    flex-direction: column;
    align-items: flex-end;
  }
}
