/* =========================================================
   ZestyClip — global styles
   ========================================================= */

/* Privacy / trust badges shown under the hero */
.privacy-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
  margin-top: 14px;
}
.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.privacy-pill svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.privacy-pill:nth-child(2) {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.privacy-pill:nth-child(3) {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

/* =========================================================
   Loading skeleton (shown while /api/extract is in flight)
   ========================================================= */
.skeleton-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  animation: fadeUp 0.2s ease-out both;
}
.skel-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.skel-thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  flex-shrink: 0;
}
.skel-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}
.skel-badge { width: 70px;  height: 16px; border-radius: 4px; }
.skel-title { width: 92%;   height: 18px; border-radius: 4px; }
.skel-title-2 { width: 60%; height: 18px; border-radius: 4px; }
.skel-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  margin-bottom: 16px;
}
.skel-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.skel-btn { width: 110px; height: 38px; border-radius: 10px; }
.skel-status {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.skel {
  background:
    linear-gradient(90deg,
      rgba(226, 232, 240, 0.6) 0%,
      rgba(241, 245, 249, 1) 50%,
      rgba(226, 232, 240, 0.6) 100%);
  background-size: 200% 100%;
  animation: skelShimmer 1.3s ease-in-out infinite;
}
@keyframes skelShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; background: #e2e8f0; }
}

/* Logo lightning strike + spark flash */
.logo-zap .bolt {
  transform-origin: center;
  animation: bolt-strike 4.2s ease-in-out infinite;
}
.logo-zap .sparks line {
  opacity: 0;
  animation: spark-flash 4.2s steps(1, end) infinite;
}
@keyframes bolt-strike {
  0%   { clip-path: inset(0 0 100% 0); opacity: 0; }
  4%   { clip-path: inset(0 0 80% 0); opacity: 1; }
  16%  { clip-path: inset(0 0 0 0); opacity: 1; filter: drop-shadow(0 0 6px rgba(255,255,255,0.8)); }
  20%, 100% { clip-path: inset(0 0 0 0); }
  /* flash 1 */
  22%  { opacity: 0.45; filter: drop-shadow(0 0 10px rgba(255,255,255,0.95)); }
  26%  { opacity: 1; filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  /* flash 2 */
  30%  { opacity: 0.45; filter: drop-shadow(0 0 10px rgba(255,255,255,0.95)); }
  34%  { opacity: 1; filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  /* flash 3 */
  38%  { opacity: 0.45; filter: drop-shadow(0 0 10px rgba(255,255,255,0.95)); }
  42%  { opacity: 1; filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
}
@keyframes spark-flash {
  0%, 21%  { opacity: 0; }
  22%, 26% { opacity: 1; }
  27%, 29% { opacity: 0; }
  30%, 34% { opacity: 1; }
  35%, 37% { opacity: 0; }
  38%, 42% { opacity: 1; }
  43%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-zap .bolt,
  .logo-zap .sparks line { animation: none; opacity: 1; clip-path: none; }
  .logo-zap .sparks line { opacity: 0; }
}


@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp 0.25s ease-out both; }

video { background: #000; max-height: 60vh; }

@media (hover: none) {
  button, a { min-height: 44px; }
}

summary::-webkit-details-marker { display: none; }
summary { list-style: none; }

body {
  padding-bottom: env(safe-area-inset-bottom);
  padding-left:   env(safe-area-inset-left);
  padding-right:  env(safe-area-inset-right);
}

/* Push the sticky header below the iPhone notch / Dynamic Island so the
   logo and "Home" link stay visible in standalone PWA mode (iOS reports
   safe-area-inset-top > 0 only on devices with a notch). */
body > header {
  padding-top: env(safe-area-inset-top);
}

/* =========================================================
   Title clamp + show more
   ========================================================= */

.title-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.title-clamp.expanded {
  display: block;
  -webkit-line-clamp: unset;
}
.title-toggle {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-left: 4px;
}
.title-toggle:hover { color: #0f172a; text-decoration: underline; }

/* =========================================================
   Help cards (device-aware)
   ========================================================= */

.help-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  scroll-margin-top: 76px;
}
.help-card[open] {
  box-shadow: 0 6px 24px -8px rgba(15, 23, 42, 0.08);
}
.help-card summary {
  border-radius: 16px;
}
.help-card[data-recommended="true"] {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.help-card[data-recommended="true"] .recommended-badge {
  display: inline-flex;
  animation: badgePulse 2s ease-in-out 1.4s 2;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.help-card.is-pulsing {
  position: relative;
}
.help-card.is-pulsing::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  border: 2.5px solid #f59e0b;
  pointer-events: none;
  animation: helpRingPulse 1.6s ease-out;
}
@keyframes helpRingPulse {
  0%   { transform: scale(1);    opacity: 0.85; }
  100% { transform: scale(1.05); opacity: 0;    }
}
#help { scroll-margin-top: 76px; }

/* "How to use" header pill */
.how-to-use-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.how-to-use-btn:hover {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border-color: #fcd34d;
  color: #78350f;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -6px rgba(245, 158, 11, 0.5);
}
.how-to-use-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px -2px rgba(245, 158, 11, 0.4);
}
.how-to-use-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Method cards inside help */
.method-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
}
.method-card-highlight {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border-color: #fcd34d;
}
.method-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.method-card-highlight .method-num {
  background: #f59e0b;
  color: #78350f;
}
.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}
.step-list > li {
  counter-increment: step;
  position: relative;
  padding: 6px 0 6px 32px;
  color: #334155;
  line-height: 1.55;
}
.step-list > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 6px;
  width: 22px;
  height: 22px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.method-card-highlight .step-list > li::before {
  border-color: #f59e0b;
  color: #b45309;
}

.step-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #78350f;
  font-size: 12.5px;
  line-height: 1.5;
}

.step-sublist {
  margin-top: 6px;
  padding-left: 18px;
  list-style: disc;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.6;
}
.step-sublist > li { margin-bottom: 2px; }
.step-sublist > li b { color: #0f172a; }

.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  word-break: break-all;
}

/* =========================================================
   Animated device icons (SVG)
   ========================================================= */

.device-icon { display: inline-flex; }
.device-icon svg { width: 100%; height: 100%; transition: transform 0.35s cubic-bezier(.34,1.56,.64,1); }
.device-icon .icon-accent { transform-origin: 24px 24px; }

/* iPhone — bolt fades in & pulses on hover/open */
.device-icon-ios .icon-accent { transition: opacity 0.35s, transform 0.35s; transform-origin: 24px 24px; }
.help-card:hover .device-icon-ios svg,
.help-card[open] .device-icon-ios svg { transform: rotate(-4deg) scale(1.1); }
.help-card:hover .device-icon-ios .icon-accent,
.help-card[open] .device-icon-ios .icon-accent { opacity: 1; animation: bolt 1.4s ease-in-out infinite; }
@keyframes bolt {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* Android — arms wave + eyes blink on hover/open */
.device-icon-android svg { transition: transform 0.35s cubic-bezier(.34,1.56,.64,1); }
.device-icon-android .arm { transform-box: fill-box; transition: transform 0.3s; }
.device-icon-android .arm-l { transform-origin: 50% 8%; }
.device-icon-android .arm-r { transform-origin: 50% 8%; }
.device-icon-android .eye { transform-box: fill-box; transform-origin: center; }
.help-card:hover .device-icon-android svg,
.help-card[open] .device-icon-android svg { transform: scale(1.06); }
.help-card:hover .device-icon-android .arm-l,
.help-card[open] .device-icon-android .arm-l { animation: arm-wave-l 0.9s ease-in-out infinite alternate; }
.help-card:hover .device-icon-android .arm-r,
.help-card[open] .device-icon-android .arm-r { animation: arm-wave-r 0.9s ease-in-out infinite alternate; }
.help-card:hover .device-icon-android .eye,
.help-card[open] .device-icon-android .eye { animation: android-blink 2.6s ease-in-out infinite; }
@keyframes arm-wave-l {
  from { transform: rotate(-6deg); }
  to   { transform: rotate(10deg); }
}
@keyframes arm-wave-r {
  from { transform: rotate(6deg); }
  to   { transform: rotate(-10deg); }
}
@keyframes android-blink {
  0%, 90%, 100% { transform: scaleY(1); }
  94%, 96%      { transform: scaleY(0.1); }
}

/* Desktop — download arrow slides down on hover */
.device-icon-pc .icon-accent { transition: opacity 0.35s, transform 0.35s; }
.help-card:hover .device-icon-pc svg,
.help-card[open] .device-icon-pc svg { transform: scale(1.06); }
.help-card:hover .device-icon-pc .icon-accent,
.help-card[open] .device-icon-pc .icon-accent { opacity: 1; animation: slideDown 1.4s ease-in-out infinite; }
@keyframes slideDown {
  0% { transform: translateY(-6px); opacity: 0; }
  30%, 70% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(4px); opacity: 0.4; }
}

/* =========================================================
   Ad slots — reserved space, real ads can be injected later
   ========================================================= */

.ad-slot {
  display: block;
  width: 100%;
  min-height: 90px;
  text-align: center;
  border: 1px dashed transparent;
  border-radius: 12px;
}
.ad-slot:empty { display: none; }

@media (min-width: 768px) {
  .ad-slot[data-ad-slot="mid"] { min-height: 250px; }
}

/* =========================================================
   Result card extras
   ========================================================= */

.result-thumb { width: 64px; height: 64px; }
.format-row {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  margin-top: 12px;
  background: #fff;
}
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.25s ease, filter 0.2s ease;
  box-shadow: 0 3px 8px -2px rgba(22, 163, 74, 0.4);
}
.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 10px 20px -6px rgba(22, 163, 74, 0.55);
  filter: saturate(1.1);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px -2px rgba(22, 163, 74, 0.4);
}

.btn-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.22s, background 0.22s, color 0.22s, box-shadow 0.22s;
}
.btn-secondary:hover {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1.5px);
  box-shadow: 0 8px 16px -6px rgba(15, 23, 42, 0.22);
}
.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px -2px rgba(15, 23, 42, 0.18);
}

.action-btn > svg,
.action-btn > span:not(.btn-shine) {
  position: relative;
  z-index: 1;
}
.action-btn .btn-shine {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-130%);
  pointer-events: none;
}
.action-btn:hover .btn-shine {
  animation: btnShine 0.9s ease-out;
}
.btn-secondary .btn-shine {
  background: linear-gradient(105deg, transparent 35%, rgba(15, 23, 42, 0.08) 50%, transparent 65%);
}
@keyframes btnShine {
  0%   { transform: translateX(-130%); }
  100% { transform: translateX(130%);  }
}

.dl-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: rgba(255, 255, 255, 0.85);
  transition: width 0.15s ease-out;
  pointer-events: none;
  z-index: 2;
  border-radius: 0 0 10px 10px;
}
.btn-secondary .dl-progress {
  background: rgba(15, 23, 42, 0.55);
}
.action-btn[data-dl-busy="1"] {
  pointer-events: none;
}
.action-btn[data-dl-busy="1"] .btn-shine { display: none; }

.action-icon { transition: transform 0.3s cubic-bezier(.4, 0, .2, 1); }
.action-btn:hover .dl-icon {
  animation: dlBounce 0.7s ease-in-out infinite;
}
@keyframes dlBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(2.5px); }
}
.action-btn:hover .open-icon {
  transform: translate(2px, -2px);
}

/* =========================================================
   Get Video — main submit button
   ========================================================= */

.get-video-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #312e81 100%);
  background-size: 180% 180%;
  background-position: 0% 50%;
  overflow: hidden;
  transition: background-position 0.5s ease, transform 0.2s ease, box-shadow 0.25s ease, opacity 0.2s ease;
  box-shadow: 0 4px 14px -4px rgba(15, 23, 42, 0.45);
}
.get-video-btn:hover:not(:disabled) {
  background-position: 100% 50%;
  transform: translateY(-1.5px);
  box-shadow: 0 12px 24px -8px rgba(67, 56, 202, 0.55);
}
.get-video-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 3px 8px -2px rgba(15, 23, 42, 0.45);
}
.get-video-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.get-btn-shine {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-130%);
  pointer-events: none;
}
.get-btn-arrow,
.get-btn-label {
  position: relative;
  z-index: 1;
}
.get-video-btn:hover:not(:disabled) .get-btn-shine {
  animation: btnShine 0.9s ease-out;
}
.get-btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
}
.get-video-btn:hover:not(:disabled) .get-btn-arrow {
  transform: translateX(4px);
}
.get-video-btn:active:not(:disabled) .get-btn-arrow {
  transform: translateX(2px);
}
.quality-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
}
.quality-badge-best {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
}
.quality-badge-muted {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Primary format gets a subtle highlight */
.format-row-primary {
  border-color: #cbd5e1;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

/* MP3 audio extraction row — server-side, slower, so we keep it small
   and unobtrusive below the video. */
.audio-extract-row {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.audio-extract-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1.5px dashed #c4b5fd;
  border-radius: 999px;
  background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
  color: #6d28d9;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.22s, background 0.22s, color 0.22s, box-shadow 0.22s;
}
.audio-extract-link svg {
  width: 16px;
  height: 16px;
}
.audio-extract-link:hover {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: #5b21b6;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 14px -6px rgba(139, 92, 246, 0.45);
}
.audio-extract-link[data-dl-busy="1"] {
  pointer-events: none;
  border-style: solid;
}
.audio-extract-link .dl-progress {
  background: rgba(139, 92, 246, 0.55);
  border-radius: 0 0 999px 999px;
}

/* Compact rows for non-primary qualities */
.format-row-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.format-row-compact + .format-row-compact { margin-top: 8px; }

/* Collapsible "Other qualities" section */
.other-formats {
  margin-top: 12px;
}
.other-formats > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.other-formats > summary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}
.other-formats-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
}
.other-formats-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  transition: transform 0.32s cubic-bezier(.4, 0, .2, 1);
  flex-shrink: 0;
}
.other-formats[open] > summary .other-formats-chevron,
.help-card[open] > summary .other-formats-chevron {
  transform: rotate(180deg);
}
.other-formats[data-collapsing] > summary .other-formats-chevron,
.help-card[data-collapsing] > summary .other-formats-chevron {
  transform: rotate(0deg);
}
.help-card > summary .other-formats-chevron {
  width: 20px;
  height: 20px;
  margin-left: 0;
}
.other-formats[open] > summary {
  border-style: solid;
  border-color: #94a3b8;
  background: #fff;
  margin-bottom: 10px;
}

/* =========================================================
   iOS save-to-Photos prominence
   ========================================================= */

.ios-callout {
  position: relative;
  margin: 4px 0 16px;
  padding: 16px 18px 14px;
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border: 1.5px solid #fcd34d;
  border-radius: 16px;
  box-shadow: 0 8px 24px -12px rgba(245, 158, 11, 0.45);
  overflow: hidden;
}
.ios-callout::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.0), rgba(249, 115, 22, 0.25), rgba(251, 191, 36, 0.0));
  background-size: 200% 200%;
  z-index: -1;
  animation: ios-shimmer 4s ease-in-out infinite;
}
@keyframes ios-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.ios-callout-head {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.ios-finger {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}
.ios-finger .tap-hand,
.ios-gesture-hint .tap-hand {
  transform-origin: 38.74px 47.75px;
  transform-box: fill-box;
  animation: tap-press 1.8s ease-in-out infinite;
}
@keyframes tap-press {
  0%, 100% { transform: translate(2px, -2px); }
  35%, 70% { transform: translate(0, 0); }
}
.ios-callout-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b45309;
}
.ios-callout-headline {
  font-size: 16px;
  font-weight: 800;
  color: #78350f;
  line-height: 1.25;
}
.ios-callout-steps {
  list-style: none;
  counter-reset: ios-step;
  padding: 0;
  margin: 0 0 10px;
}
.ios-callout-steps > li {
  counter-increment: ios-step;
  position: relative;
  padding: 4px 0 4px 30px;
  color: #78350f;
  font-size: 14px;
  line-height: 1.5;
}
.ios-callout-steps > li::before {
  content: counter(ios-step);
  position: absolute;
  left: 0;
  top: 4px;
  width: 22px;
  height: 22px;
  background: #f59e0b;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(180, 83, 9, 0.3);
}
.ios-callout-hint {
  font-size: 12px;
  color: #92400e;
  margin: 0;
  padding-top: 8px;
  border-top: 1px dashed #fcd34d;
}

/* Video glow + overlaid hint chip — iOS only */
.video-wrap { position: relative; }
.ios-video-glow {
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
  animation: ios-pulse-glow 2s ease-in-out 4;
}
@keyframes ios-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.0); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.35); }
}
.ios-gesture-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #fde68a;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: hint-bob 1.6s ease-in-out infinite;
  transition: opacity 0.35s ease;
  z-index: 2;
}
.ios-gesture-hint .hint-tap-icon {
  width: 22px;
  height: 22px;
  color: #fbbf24;
  flex-shrink: 0;
}
.ios-gesture-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
  animation-play-state: paused;
}
@keyframes hint-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .ios-callout::before,
  .ios-finger .tap-hand,
  .ios-gesture-hint .tap-hand,
  .ios-video-glow,
  .ios-gesture-hint { animation: none; }
}

/* ---------- URL input clear button ---------- */

.url-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.url-clear:hover { background: #e2e8f0; color: #0f172a; }
.url-clear:active { transform: translateY(-50%) scale(0.92); }
.url-clear[hidden] { display: none; }
.url-clear svg { width: 14px; height: 14px; }
html[dir="rtl"] .url-clear { right: auto; left: 8px; }
html[dir="rtl"] #url { padding-right: 1rem; padding-left: 2.75rem; }

/* ---------- Language picker (header) ---------- */

.lang-picker {
  position: relative;
  display: inline-block;
}

.lang-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.lang-picker-btn:hover {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border-color: #fcd34d;
  color: #78350f;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -6px rgba(245, 158, 11, 0.5);
}
.lang-picker-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px -2px rgba(245, 158, 11, 0.4);
}
.lang-picker-btn[aria-expanded="true"] {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border-color: #fcd34d;
  color: #78350f;
}
.lang-flag-trigger {
  display: inline-block;
  width: 21px;
  height: 14px; /* 3:2 — matches SVG viewBox so flags fill cleanly */
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  line-height: 0;
}
.lang-flag-trigger svg {
  display: block;
  width: 100%;
  height: 100%;
}
.lang-flag-trigger.is-globe,
.lang-flag.is-globe {
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  opacity: 0.85;
}
.lang-current {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.lang-chevron {
  width: 10px;
  height: 6px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.2s ease;
}
.lang-picker-btn[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18), 0 4px 10px -4px rgba(15, 23, 42, 0.08);
  z-index: 50;
  transform-origin: top right;
  animation: lang-menu-in 0.16s cubic-bezier(.4, 0, .2, 1);
}
.lang-menu[hidden] { display: none; }
@keyframes lang-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.lang-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-menu li:hover,
.lang-menu li:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
  outline: none;
}
.lang-menu li[aria-selected="true"] {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  color: #78350f;
  font-weight: 600;
}
.lang-menu li[aria-selected="true"]:hover {
  background: linear-gradient(135deg, #ffedd5, #fde68a);
}
.lang-flag {
  display: inline-block;
  width: 24px;
  height: 16px; /* 3:2 — matches SVG viewBox so flags fill cleanly */
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  line-height: 0;
}
.lang-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}
.lang-name { flex: 1; }
.lang-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #d97706;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.lang-menu li[aria-selected="true"] .lang-check { opacity: 1; }

@media (max-width: 480px) {
  .lang-picker-btn { padding: 5px 8px; font-size: 12px; }
  .lang-menu { min-width: 180px; }
}

/* ---------- RTL overrides (Arabic, etc.) ---------- */

html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
  transform-origin: top left;
}
html[dir="rtl"] .ios-callout-steps,
html[dir="rtl"] .other-formats-list { text-align: right; }
html[dir="rtl"] .dl-icon,
html[dir="rtl"] .open-icon { transform: scaleX(-1); }
html[dir="rtl"] .other-formats-chevron { /* still points down */ }
html[dir="rtl"] .skel-row,
html[dir="rtl"] .skel-actions { direction: rtl; }
html[dir="rtl"] .format-row-compact { flex-direction: row-reverse; }

