/* Subtitle Downloader workspace. */
.transcript-page-head {
  margin: 0 auto 30px;
  text-align: center;
}

.transcript-page-head h1 {
  margin: 0 0 10px;
  color: #f4f6fb;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.transcript-page-head p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
}

.transcript-url-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 850px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

.transcript-url-form input {
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  font-size: 0.96rem;
}

.transcript-url-form input:focus { outline: none; box-shadow: none; }

.transcript-url-form button,
.download-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 11px;
  background: #a7bfff;
  color: #142143;
  font-weight: 760;
  cursor: pointer;
  transition: filter 150ms ease, transform 100ms ease;
}

.transcript-url-form button:hover,
.download-primary:hover { filter: brightness(1.06); }
.transcript-url-form button:active,
.download-primary:active { transform: translateY(1px); }
.transcript-url-form button:disabled,
.download-primary:disabled { opacity: 0.58; cursor: wait; }

.transcript-url-form svg,
.download-primary svg { width: 18px; height: 18px; }

.transcript-example {
  min-height: 24px;
  margin: 12px auto 0;
  color: var(--muted-2);
  font-size: 0.84rem;
  text-align: center;
}

.transcript-status {
  max-width: 850px;
  min-height: 22px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.transcript-status.error { color: var(--danger); }
.transcript-status.success { color: var(--ok); }

.transcript-cost { display: flex; max-width: 850px; margin: 12px auto 0; padding: 12px 14px; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid rgba(137,166,245,.24); border-radius: 11px; background: rgba(91,121,198,.08); }
.transcript-cost > div span { display: block; color: var(--muted-2); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.transcript-cost > div strong { display: block; margin-top: 3px; color: #b9caff; font-size: .86rem; }
.transcript-cost p { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.45; text-align: right; }

.transcript-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.8fr);
  gap: 22px;
  margin-top: 34px;
  align-items: start;
}

.transcript-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.transcript-video-cover {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 7.6;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(140deg, #172333, #0f131a 60%, #1c2535);
}

.transcript-video-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.transcript-video-cover::after {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(8, 10, 14, 0.88));
  content: "";
  pointer-events: none;
}

.video-duration {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(5, 7, 10, 0.85);
  color: #fff;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.video-fallback {
  display: grid;
  place-items: center;
  color: var(--muted-2);
  text-align: center;
}

.video-fallback svg { width: 42px; height: 42px; margin-bottom: 8px; }

.video-summary { padding: 20px 22px; }
.video-summary h2 {
  margin: 0;
  color: #d6e0ff;
  font-size: 1.25rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.video-meta span { display: inline-flex; align-items: center; gap: 6px; }
.video-meta .verified { color: #a7bfff; }

.preview-panel { margin-top: 20px; }
.preview-head,
.download-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
}

.preview-head h2,
.download-panel-head h2 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-count { color: var(--muted-2); font-size: 0.78rem; }

.subtitle-preview {
  max-height: 470px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #3a414f transparent;
}

.subtitle-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.subtitle-row:last-child { border-bottom: 0; }
.subtitle-row:hover { background: rgba(255, 255, 255, 0.025); }

.subtitle-time {
  color: #9db9ff;
  font-size: 0.82rem;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.subtitle-time:hover { text-decoration: underline; }

.subtitle-text { margin: 0; color: #d2d6df; font-size: 0.9rem; line-height: 1.55; }

.download-panel { position: sticky; top: calc(var(--app-topbar-height) + 22px); }
.download-panel-body { padding: 20px; }

.control-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

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

.format-option { position: relative; }
.format-option input { position: absolute; opacity: 0; pointer-events: none; }
.format-option span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #191c22;
  color: #c9cfdb;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.format-option span b { visibility: hidden; }
.format-option input:checked + span b { visibility: visible; }
.format-option input:checked + span b::before { content: "✓"; }

.format-option input:checked + span {
  border-color: #91afff;
  background: rgba(108, 140, 255, 0.11);
  color: #b8cbff;
}
.format-option input:focus-visible + span { box-shadow: var(--focus-ring); }

.field-block { margin-top: 20px; }
.readonly-field,
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #191c22;
}

.readonly-field strong,
.toggle-copy strong { display: block; color: #d9dde6; font-size: 0.88rem; }
.readonly-field small,
.toggle-copy small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 0.72rem; }

.toggle {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
}
.toggle input { position: absolute; opacity: 0; }
.toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #3a3f49;
  cursor: pointer;
  transition: background 150ms ease;
}
.toggle span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cbd1dc;
  content: "";
  transition: transform 150ms ease;
}
.toggle input:checked + span { background: #91afff; }
.toggle input:checked + span::after { transform: translateX(18px); background: #fff; }
.toggle input:focus-visible + span { box-shadow: var(--focus-ring); }

.download-divider { height: 1px; margin: 20px 0; background: var(--border); }
.download-primary { width: 100%; }
.download-hint { margin: 10px 0 0; color: var(--muted-2); font-size: 0.75rem; line-height: 1.45; text-align: center; }

.pro-tip {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.pro-tip strong { display: block; color: #cbd6f7; font-size: 0.9rem; }
.pro-tip p { margin: 7px 0 0; color: var(--muted); font-size: 0.79rem; line-height: 1.5; }

.transcript-marketing {
  margin-top: 60px;
  padding-top: 42px;
  border-top: 1px solid var(--border);
}
.transcript-marketing h2 { margin: 34px 0 15px; font-size: 1.25rem; }
.transcript-marketing h2:first-child { margin-top: 0; }
.marketing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.marketing-grid article,
.transcript-faq details {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.marketing-grid h3 { margin: 0 0 6px; font-size: 0.92rem; }
.marketing-grid p,
.transcript-faq p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.transcript-faq { display: grid; gap: 8px; }
.transcript-faq summary { color: #d6dae3; font-size: 0.9rem; font-weight: 650; cursor: pointer; }
.transcript-faq p { margin-top: 10px; }

@media (max-width: 1023px) {
  .transcript-workspace { grid-template-columns: 1fr; }
  .download-panel { position: static; }
  .marketing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .transcript-cost { align-items: flex-start; flex-direction: column; gap: 7px; }.transcript-cost p { text-align: left; }
  .transcript-page-head { margin-bottom: 22px; }
  .transcript-page-head h1 { font-size: 2rem; }
  .transcript-url-form { grid-template-columns: 1fr; padding: 6px; }
  .transcript-url-form button { width: 100%; }
  .transcript-workspace { margin-top: 24px; }
  .transcript-video-cover { aspect-ratio: 16 / 9; }
  .video-summary { padding: 16px; }
  .video-summary h2 { font-size: 1.05rem; }
  .subtitle-row { grid-template-columns: 66px minmax(0, 1fr); padding: 12px 14px; }
  .preview-head, .download-panel-head { padding: 15px 16px; }
  .download-panel-body { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .format-option span,
  .toggle span,
  .toggle span::after,
  .transcript-url-form button,
  .download-primary { transition: none; }
}
