.format-filters {
  display: grid;
  grid-template-columns: minmax(0, 220px);
  gap: 12px;
  margin: 20px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7faff;
}

.format-filters label {
  display: grid;
  gap: 6px;
  color: #526887;
  font-size: 12px;
  font-weight: 750;
}

.format-filters select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid #cdd9e8;
  border-radius: 8px;
  background: #fff;
  color: #10213c;
  font: inherit;
  font-size: 14px;
}

.format-list {
  display: grid;
  gap: 12px;
  border: 0;
  overflow: visible;
}

.format-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.format-group h4 {
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #f3f7fd;
  color: #244b7c;
  font-size: 13px;
  letter-spacing: .01em;
}

.format-group .format-row:first-of-type {
  border-top: 0;
}

.format-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed #c6d5e8;
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.download-action:disabled {
  cursor: progress;
  opacity: .75;
}

.download-progress-widget {
  min-width: 220px;
  max-width: 320px;
  padding: 8px 12px;
  background: #f7faff;
  border: 1.5px solid #c9defc;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(8, 103, 242, 0.09);
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: progressFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

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

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.progress-status-label {
  font-size: 12px;
  font-weight: 750;
  color: #0b2f6b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-percent-badge {
  font-size: 12px;
  font-weight: 800;
  color: #0867f2;
  font-variant-numeric: tabular-nums;
  background: #e4efff;
  padding: 1px 7px;
  border-radius: 6px;
  letter-spacing: -0.02em;
}

.progress-track {
  width: 100%;
  height: 7px;
  background: #e1ebf7;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d6df2 0%, #00b4d8 100%);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
  animation: progressShimmer 1.8s infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-fill.complete {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.progress-sub-detail {
  font-size: 11px;
  font-weight: 550;
  color: #5c7292;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.cancel-download-btn {
  width: 32px;
  height: 32px;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 1px solid #c9d8eb !important;
  background: #fff !important;
  color: #5b7191 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: all 0.15s ease !important;
  align-self: center;
}

.cancel-download-btn:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  transform: scale(1.06);
}

.format-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Video Duration Overlay Badge */
.thumbnail-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(9, 27, 54, 0.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Sidebar Media Info Card */
.media-info-card {
  background: #f8fafd;
  border: 1px solid #dce6f5;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 750;
  color: #0c203d;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-meta-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid #e3edf8;
}

.media-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  line-height: 1.35;
}

.meta-label {
  color: #5c7292;
  font-weight: 600;
}

.meta-val {
  color: #0b1e38;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-highlight {
  color: #0867f2;
}

/* Enhanced Format Row with File Size & Codec */
.format-row {
  display: grid;
  grid-template-columns: minmax(65px, max-content) minmax(60px, max-content) 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
}

.format-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.format-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5fa;
  color: #486182;
  border: 1px solid #dce5f0;
  font-variant-numeric: tabular-nums;
}

.format-chip.size-chip {
  background: #f0f7ff;
  color: #1355ae;
  border-color: #cde0f7;
  font-weight: 750;
}

@media (max-width: 760px) {
  .result-sidebar {
    max-width: 100%;
    position: static;
  }

  .format-filters {
    grid-template-columns: 1fr;
  }

  .format-row {
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "quality type meta"
      "actions actions actions";
    gap: 8px;
    padding: 10px 14px;
  }

  .format-meta {
    justify-content: flex-end;
  }

  .format-actions {
    grid-area: actions;
    width: 100%;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .format-actions .download-action {
    display: grid !important;
  }

  .download-progress-widget {
    min-width: 100%;
    max-width: 100%;
  }
}

/* Multi-Step Download Page Styles */
.download-page-container {
  max-width: 840px;
  margin: 30px auto 60px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.download-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  align-self: flex-start;
  transition: transform 0.15s ease;
}

.download-back-link:hover {
  transform: translateX(-2px);
}

.download-media-summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 2px 8px rgba(9, 27, 54, 0.04);
}

.download-media-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.download-media-title {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  color: #0b2144;
  line-height: 1.35;
}

.download-media-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.download-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  background: #edf5ff;
  color: #0867f2;
  border: 1px solid #cde0f7;
}

/* Ensure hidden elements are never displayed */
.download-spotlight-card[hidden],
.download-active-status[hidden],
.countdown-wrapper[hidden],
[hidden] {
  display: none !important;
}

.download-spotlight-card {
  background: #fff;
  border: 1.5px solid #d4e4f7;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  box-shadow: 0 6px 24px rgba(8, 103, 242, 0.08);
}

.countdown-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}

.countdown-heading {
  font-size: 20px;
  font-weight: 800;
  color: #0c234b;
  margin: 0;
}

.countdown-subtext {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.countdown-skip-link {
  background: none;
  border: 0;
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 4px;
  font-size: 13.5px;
}

.countdown-skip-link:hover {
  color: #0755cc;
}

.countdown-timer-number {
  font-size: 24px;
  font-weight: 900;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

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

.countdown-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1d6df2, #00b4d8);
  border-radius: 999px;
  transition: width 1s linear;
}

/* Big Central Sponsored Feature */
.sponsor-spotlight-box {
  width: 100%;
  background: linear-gradient(145deg, #f0f7ff 0%, #e5f1fe 100%);
  border: 1.5px solid #b9d7fb;
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.sponsor-spotlight-tag {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  color: #125ec7;
  text-transform: uppercase;
  background: rgba(18, 94, 199, 0.1);
  padding: 3px 10px;
  border-radius: 6px;
}

.sponsor-spotlight-box h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #092247;
}

.sponsor-spotlight-box p {
  margin: 0;
  font-size: 14px;
  color: #4b6282;
  max-width: 520px;
  line-height: 1.45;
}

.sponsor-spotlight-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  background: linear-gradient(135deg, #1d6df2 0%, #0857db 100%);
  color: #fff;
  font-weight: 750;
  font-size: 15px;
  border-radius: 11px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(8, 87, 219, 0.35);
  transition: all 0.2s ease;
}

.sponsor-spotlight-btn:hover {
  background: linear-gradient(135deg, #2b7af7 0%, #0f60e3 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(8, 87, 219, 0.45);
}

.download-active-status {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  align-items: center;
  animation: downloadFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes downloadFadeIn {
  from { opacity: 0; transform: scale(0.98) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.download-hero-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.download-hero-visual {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(8, 103, 242, 0.14);
  position: relative;
}

.download-hero-visual.is-audio {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.18);
}

.sound-wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
  padding: 2px;
}

.sound-wave-bars .bar {
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  animation: soundBarDance 1s ease-in-out infinite alternate;
}

.sound-wave-bars .bar-1 { height: 14px; animation-delay: 0.1s; }
.sound-wave-bars .bar-2 { height: 28px; animation-delay: 0.3s; }
.sound-wave-bars .bar-3 { height: 20px; animation-delay: 0.5s; }
.sound-wave-bars .bar-4 { height: 32px; animation-delay: 0.2s; }
.sound-wave-bars .bar-5 { height: 16px; animation-delay: 0.4s; }

@keyframes soundBarDance {
  0% { transform: scaleY(0.35); opacity: 0.65; }
  100% { transform: scaleY(1); opacity: 1; filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5)); }
}

.download-pulse-ring {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0867f2;
}

.download-hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 850;
  color: #092247;
  letter-spacing: -0.02em;
}

.download-hero-subtitle {
  margin: 0;
  font-size: 14px;
  color: #4b6282;
  font-weight: 500;
}

.download-page-container .download-actions-slot {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.download-page-container .download-progress-widget {
  min-width: 100%;
  max-width: 100%;
  padding: 24px 28px;
  background: linear-gradient(145deg, #ffffff 0%, #f6faff 100%);
  border: 2px solid #b9d7fb;
  border-radius: 16px;
  box-shadow: 0 10px 32px rgba(8, 103, 242, 0.1), 0 2px 6px rgba(8, 103, 242, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.download-page-container .progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

.download-page-container .progress-status-label {
  font-size: 16px;
  font-weight: 800;
  color: #08295b;
  letter-spacing: -0.01em;
}

.download-page-container .progress-percent-badge {
  font-size: 38px;
  font-weight: 900;
  color: #0867f2;
  font-variant-numeric: tabular-nums;
  background: none;
  padding: 0;
  letter-spacing: -0.03em;
  line-height: 1;
}

.download-page-container .progress-track {
  height: 16px;
  background: #e3effe;
  border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(9, 27, 54, 0.08);
}

.download-page-container .progress-fill {
  background: linear-gradient(90deg, #1d6df2 0%, #00b4d8 60%, #10b981 100%);
  box-shadow: 0 2px 10px rgba(8, 103, 242, 0.4);
}

.download-page-container .progress-sub-detail {
  font-size: 14px;
  font-weight: 650;
  color: #3b5a82;
  margin-top: 2px;
}

.download-guarantees-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

.guarantee-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f0f7ff;
  border: 1px solid #cce2fd;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0c4a9e;
}

.guarantee-pill .pill-icon {
  font-size: 14px;
}

.download-page-container .cancel-download-btn {
  width: auto !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 20px !important;
  border-radius: 999px !important;
  border: 1px solid #d0dbe7 !important;
  background: #fff !important;
  color: #556982 !important;
  font-size: 13.5px !important;
  font-weight: 650 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.15s ease !important;
}

.download-page-container .cancel-download-btn:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  transform: translateY(-1px);
}

.download-manual-fallback {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.download-manual-fallback button {
  background: none;
  border: 0;
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.download-return-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.hero.compact {
  padding: 36px 20px 20px;
}

.hero.compact h1 {
  font-size: clamp(24px, 3.5vw, 36px);
  margin-bottom: 12px;
}

.hero.compact form {
  max-width: 720px;
  margin: 0 auto;
}

.download-step-tag {
  font-size: 11.5px;
  font-weight: 800;
  color: #1768d6;
  letter-spacing: 0.08em;
}

.download-transfer-status {
  font-size: 14px;
  font-weight: 700;
  color: #0c234b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.download-actions-slot {
  width: 100%;
}

.download-empty-btn {
  margin-top: 10px;
}

.site-header nav a.active {
  color: var(--blue);
  font-weight: 750;
}
