/* iPhone live-dashboard and cockpit video refinement v57 */

.dashboard-video-embed .track-actions,
.dashboard-video-embed .live-actions,
.dashboard-video-embed .form-assist-actions,
.dashboard-video-embed .mini-actions {
  display: none !important;
}

.dashboard-video-embed .demo-frame-button,
.dashboard-video-embed .demo-video,
.dashboard-video-embed .demo-motion,
.dashboard-video-embed [class*="demo-frame"],
.dashboard-video-embed [class*="video-frame"],
.dashboard-video-embed [class*="demo-stage"],
.dashboard-video-embed [class*="video-stage"],
.dashboard-video-embed [class*="demo-media"],
.dashboard-video-embed [class*="video-media"] {
  width: 100% !important;
  height: 210px !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  background: #071018 !important;
}

.dashboard-video-embed.demo-shape-square .demo-frame-button,
.dashboard-video-embed.demo-shape-square [class*="demo-frame"],
.dashboard-video-embed.demo-shape-square [class*="video-frame"],
.dashboard-video-embed.demo-shape-square [class*="demo-stage"],
.dashboard-video-embed.demo-shape-square [class*="video-stage"],
.dashboard-video-embed.demo-shape-square [class*="demo-media"],
.dashboard-video-embed.demo-shape-square [class*="video-media"],
.dashboard-video-embed.demo-shape-square img,
.dashboard-video-embed.demo-shape-square video {
  width: min(100%, 340px) !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.dashboard-video-embed.demo-shape-portrait .demo-frame-button,
.dashboard-video-embed.demo-shape-portrait [class*="demo-frame"],
.dashboard-video-embed.demo-shape-portrait [class*="video-frame"],
.dashboard-video-embed.demo-shape-portrait [class*="demo-stage"],
.dashboard-video-embed.demo-shape-portrait [class*="video-stage"],
.dashboard-video-embed.demo-shape-portrait [class*="demo-media"],
.dashboard-video-embed.demo-shape-portrait [class*="video-media"],
.dashboard-video-embed.demo-shape-portrait img,
.dashboard-video-embed.demo-shape-portrait video {
  width: min(100%, 230px) !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 9 / 16 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.dashboard-video-embed.demo-shape-landscape .demo-frame-button,
.dashboard-video-embed.demo-shape-landscape [class*="demo-frame"],
.dashboard-video-embed.demo-shape-landscape [class*="video-frame"],
.dashboard-video-embed.demo-shape-landscape [class*="demo-stage"],
.dashboard-video-embed.demo-shape-landscape [class*="video-stage"],
.dashboard-video-embed.demo-shape-landscape [class*="demo-media"],
.dashboard-video-embed.demo-shape-landscape [class*="video-media"],
.dashboard-video-embed.demo-shape-landscape img,
.dashboard-video-embed.demo-shape-landscape video {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 16 / 9 !important;
}

.dashboard-video-embed .demo-video,
.dashboard-video-embed img,
.dashboard-video-embed video {
  display: block !important;
  width: 100% !important;
  height: 210px !important;
  min-height: 210px !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #071018 !important;
}

.dashboard-video-embed.dashboard-video-controls-pruned {
  padding-bottom: 8px !important;
}

.cockpit-video-shell {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 180px !important;
  padding: 10px !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  background: #071018 !important;
}

.cockpit-video-shell .demo-video,
.cockpit-video-shell .demo-motion,
.cockpit-video-shell [class*="demo-media"] {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 42vh !important;
  border: 0 !important;
  border-radius: 10px !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #071018 !important;
  box-shadow: none !important;
}

.cockpit-video-shell.demo-shape-square .demo-video,
.cockpit-video-shell.demo-shape-square .demo-motion,
.cockpit-video-shell.demo-shape-square [class*="demo-media"],
.cockpit-video-shell.demo-shape-square img,
.cockpit-video-shell.demo-shape-square video {
  width: min(100%, 340px) !important;
  aspect-ratio: 1 / 1 !important;
}

.cockpit-video-shell.demo-shape-square {
  min-height: 260px !important;
}

.cockpit-video-shell.demo-shape-portrait .demo-video,
.cockpit-video-shell.demo-shape-portrait .demo-motion,
.cockpit-video-shell.demo-shape-portrait [class*="demo-media"],
.cockpit-video-shell.demo-shape-portrait img,
.cockpit-video-shell.demo-shape-portrait video {
  width: min(100%, 245px) !important;
  aspect-ratio: 9 / 16 !important;
}

.cockpit-video-shell.demo-shape-portrait {
  min-height: 300px !important;
}

.cockpit-video-shell.demo-shape-landscape .demo-video,
.cockpit-video-shell.demo-shape-landscape .demo-motion,
.cockpit-video-shell.demo-shape-landscape [class*="demo-media"],
.cockpit-video-shell.demo-shape-landscape img,
.cockpit-video-shell.demo-shape-landscape video {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
}

.cockpit-video-shell.demo-shape-landscape {
  min-height: 200px !important;
}

@media (max-width: 520px) {
  .dashboard-video-embed {
    margin: 10px 0 !important;
    padding: 7px !important;
  }

  .cockpit-video-shell {
    min-height: 150px !important;
    padding: 8px !important;
  }

  .cockpit-video-shell .demo-video,
  .cockpit-video-shell .demo-motion,
  .cockpit-video-shell [class*="demo-media"],
  .cockpit-video-shell img,
  .cockpit-video-shell video {
    max-height: 36vh !important;
  }

  .cockpit-video-shell.demo-shape-square .demo-video,
  .cockpit-video-shell.demo-shape-square .demo-motion,
  .cockpit-video-shell.demo-shape-square [class*="demo-media"],
  .cockpit-video-shell.demo-shape-square img,
  .cockpit-video-shell.demo-shape-square video {
    width: min(100%, 300px) !important;
  }

  .cockpit-video-shell.demo-shape-square {
    min-height: 230px !important;
  }

  .cockpit-video-shell.demo-shape-portrait .demo-video,
  .cockpit-video-shell.demo-shape-portrait .demo-motion,
  .cockpit-video-shell.demo-shape-portrait [class*="demo-media"],
  .cockpit-video-shell.demo-shape-portrait img,
  .cockpit-video-shell.demo-shape-portrait video {
    width: min(100%, 210px) !important;
  }

  .cockpit-video-shell.demo-shape-portrait {
    min-height: 280px !important;
  }

  .cockpit-video-shell.demo-shape-landscape {
    min-height: 190px !important;
  }

  .dashboard-video-embed .section-heading {
    margin-bottom: 6px !important;
  }

  .dashboard-video-embed .demo-frame-button,
  .dashboard-video-embed .demo-video,
  .dashboard-video-embed .demo-motion,
  .dashboard-video-embed [class*="demo-frame"],
  .dashboard-video-embed [class*="video-frame"],
  .dashboard-video-embed [class*="demo-stage"],
  .dashboard-video-embed [class*="video-stage"],
  .dashboard-video-embed [class*="demo-media"],
  .dashboard-video-embed [class*="video-media"],
  .dashboard-video-embed img,
  .dashboard-video-embed video {
    height: 176px !important;
    min-height: 176px !important;
  }

  .dashboard-video-embed.demo-shape-square .demo-frame-button,
  .dashboard-video-embed.demo-shape-square [class*="demo-frame"],
  .dashboard-video-embed.demo-shape-square [class*="video-frame"],
  .dashboard-video-embed.demo-shape-square [class*="demo-stage"],
  .dashboard-video-embed.demo-shape-square [class*="video-stage"],
  .dashboard-video-embed.demo-shape-square [class*="demo-media"],
  .dashboard-video-embed.demo-shape-square [class*="video-media"],
  .dashboard-video-embed.demo-shape-square img,
  .dashboard-video-embed.demo-shape-square video {
    width: min(100%, 300px) !important;
    height: auto !important;
  }

  .dashboard-video-embed.demo-shape-portrait .demo-frame-button,
  .dashboard-video-embed.demo-shape-portrait [class*="demo-frame"],
  .dashboard-video-embed.demo-shape-portrait [class*="video-frame"],
  .dashboard-video-embed.demo-shape-portrait [class*="demo-stage"],
  .dashboard-video-embed.demo-shape-portrait [class*="video-stage"],
  .dashboard-video-embed.demo-shape-portrait [class*="demo-media"],
  .dashboard-video-embed.demo-shape-portrait [class*="video-media"],
  .dashboard-video-embed.demo-shape-portrait img,
  .dashboard-video-embed.demo-shape-portrait video {
    width: min(100%, 210px) !important;
    height: auto !important;
  }

  .dashboard-video-embed.demo-shape-landscape .demo-frame-button,
  .dashboard-video-embed.demo-shape-landscape [class*="demo-frame"],
  .dashboard-video-embed.demo-shape-landscape [class*="video-frame"],
  .dashboard-video-embed.demo-shape-landscape [class*="demo-stage"],
  .dashboard-video-embed.demo-shape-landscape [class*="video-stage"],
  .dashboard-video-embed.demo-shape-landscape [class*="demo-media"],
  .dashboard-video-embed.demo-shape-landscape [class*="video-media"],
  .dashboard-video-embed.demo-shape-landscape img,
  .dashboard-video-embed.demo-shape-landscape video {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
  }
}

/* v57 cascade lock: compact cockpit controls and filled video surround. */
.workout-cockpit-modal .modal-exit-button {
  top: calc(10px + env(safe-area-inset-top)) !important;
  right: max(14px, env(safe-area-inset-right)) !important;
  min-height: 28px !important;
  padding: 0 9px !important;
  border-radius: 8px !important;
  font-size: 0.66rem !important;
  line-height: 1 !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(17, 27, 37, 0.74) !important;
  box-shadow: none !important;
}

.workout-cockpit-sheet {
  gap: 6px !important;
  padding: 12px !important;
}

.workout-cockpit-sheet .form-assist-head {
  margin: -12px -12px 0 !important;
  padding: 12px 58px 8px 12px !important;
}

.workout-cockpit-sheet .form-assist-head .eyebrow {
  font-size: 0.64rem !important;
  letter-spacing: 0.12em !important;
}

.workout-cockpit-sheet .form-assist-head h2 {
  font-size: clamp(1.35rem, 6.2vw, 1.95rem) !important;
  line-height: 0.98 !important;
}

.workout-cockpit-sheet .form-assist-head p:not(.eyebrow) {
  margin-top: 4px !important;
  font-size: 0.9rem !important;
  line-height: 1.18 !important;
}

.workout-cockpit-sheet .cockpit-status-rail {
  gap: 6px !important;
}

.workout-cockpit-sheet .cockpit-status-rail article {
  padding: 8px 9px !important;
  border-radius: 10px !important;
}

.workout-cockpit-sheet .cockpit-status-rail span,
.workout-cockpit-sheet .cockpit-target-queue span {
  font-size: 0.62rem !important;
  letter-spacing: 0.1em !important;
}

.workout-cockpit-sheet .cockpit-status-rail strong {
  margin-top: 3px !important;
  font-size: 0.96rem !important;
  line-height: 1 !important;
}

.workout-cockpit-sheet .cockpit-video-shell {
  min-height: 136px !important;
  padding: 6px !important;
  background:
    radial-gradient(circle at 50% 44%, rgba(35, 211, 169, 0.16), transparent 44%),
    #071018 !important;
}

.workout-cockpit-sheet .cockpit-video-shell .demo-video,
.workout-cockpit-sheet .cockpit-video-shell .demo-motion,
.workout-cockpit-sheet .cockpit-video-shell [class*="demo-media"] {
  position: relative !important;
  z-index: 2 !important;
  max-height: 29vh !important;
}

.cockpit-video-backdrop {
  position: absolute !important;
  inset: -16px !important;
  z-index: 0 !important;
  width: calc(100% + 32px) !important;
  height: calc(100% + 32px) !important;
  border: 0 !important;
  border-radius: inherit !important;
  object-fit: cover !important;
  object-position: center center !important;
  opacity: 0.24 !important;
  filter: blur(18px) saturate(1.05) brightness(0.72) !important;
  transform: scale(1.04) !important;
  pointer-events: none !important;
}

.workout-cockpit-sheet .cockpit-video-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(7, 16, 24, 0.5), rgba(7, 16, 24, 0.08) 34%, rgba(7, 16, 24, 0.08) 66%, rgba(7, 16, 24, 0.5));
  pointer-events: none;
}

.workout-cockpit-sheet .cockpit-video-badge {
  z-index: 3 !important;
  right: 8px !important;
  bottom: 8px !important;
  left: auto !important;
  width: auto !important;
  padding: 6px 8px !important;
  border-radius: 9px !important;
  justify-content: flex-end !important;
}

.workout-cockpit-sheet .cockpit-video-badge strong {
  font-size: 0.64rem !important;
}

.workout-cockpit-sheet .cockpit-video-shell.demo-shape-square {
  min-height: 178px !important;
}

.workout-cockpit-sheet .cockpit-video-shell.demo-shape-portrait {
  min-height: 198px !important;
}

.workout-cockpit-sheet .cockpit-video-shell.demo-shape-landscape {
  min-height: 150px !important;
}

.workout-cockpit-sheet .demo-source-row {
  display: none !important;
}

.workout-cockpit-sheet .cockpit-progress {
  height: 8px !important;
}

.workout-cockpit-sheet .cockpit-target-queue {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

.workout-cockpit-sheet .cockpit-target-queue article {
  min-width: 0 !important;
  padding: 6px 8px !important;
  border-radius: 10px !important;
}

.workout-cockpit-sheet .cockpit-target-queue strong {
  display: block !important;
  margin-top: 2px !important;
  overflow: hidden !important;
  font-size: 0.84rem !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.workout-cockpit-sheet .cockpit-target-queue small {
  display: block !important;
  margin-top: 2px !important;
  overflow: hidden !important;
  font-size: 0.66rem !important;
  line-height: 1.08 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* v57 compact cockpit timer: keep action beside clock and reduce rest block height. */
.workout-cockpit-sheet .form-assist-timer {
  display: grid !important;
  grid-template-columns: minmax(0, 0.78fr) minmax(112px, 0.62fr) !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 2px !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
}

.workout-cockpit-sheet .form-assist-timer > div {
  min-width: 0 !important;
}

.workout-cockpit-sheet .form-assist-timer span {
  font-size: 0.62rem !important;
  letter-spacing: 0.1em !important;
}

.workout-cockpit-sheet .form-assist-timer strong {
  margin-top: 2px !important;
  font-size: clamp(1.72rem, 8vw, 2.05rem) !important;
  line-height: 0.95 !important;
}

.workout-cockpit-sheet .assist-complete-button {
  width: 100% !important;
  min-height: 42px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  font-size: 0.86rem !important;
  line-height: 1.05 !important;
}

.workout-cockpit-sheet .form-assist-rest {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-items: stretch !important;
  gap: 10px !important;
  min-height: 92px !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  overflow: visible !important;
}

.workout-cockpit-sheet .rest-ring {
  width: 72px !important;
  height: 72px !important;
  margin: 0 !important;
}

.workout-cockpit-sheet .rest-ring::after {
  inset: 8px !important;
}

.workout-cockpit-sheet .rest-ring strong {
  font-size: 1.05rem !important;
  line-height: 1 !important;
}

.workout-cockpit-sheet .rest-ring span {
  font-size: 0.52rem !important;
  letter-spacing: 0.09em !important;
}

.workout-cockpit-sheet .rest-copy {
  gap: 2px !important;
  text-align: left !important;
}

.workout-cockpit-sheet .rest-copy span {
  font-size: 0.68rem !important;
}

.workout-cockpit-sheet .rest-copy small {
  max-width: none !important;
  font-size: 0.72rem !important;
  line-height: 1.12 !important;
}

.workout-cockpit-sheet .assist-rest-controls {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin-top: 0 !important;
}

.workout-cockpit-sheet .assist-rest-controls .mini-button {
  min-height: 32px !important;
  padding: 0 6px !important;
  border-radius: 9px !important;
  font-size: 0.74rem !important;
}

.workout-cockpit-sheet .assist-rest-controls .danger-button {
  grid-column: auto !important;
}

/* v59: keep rest timer controls inside their card and separate Undo actions. */
.workout-cockpit-sheet .form-assist-rest {
  grid-template-columns: 72px minmax(0, 1fr) !important;
  grid-auto-rows: auto !important;
  row-gap: 8px !important;
  min-height: 138px !important;
  overflow: hidden !important;
}

.workout-cockpit-sheet .assist-rest-controls {
  position: relative !important;
  z-index: 2 !important;
  grid-column: 1 / -1 !important;
  align-self: stretch !important;
}

.workout-cockpit-sheet .assist-rest-controls .mini-button {
  min-height: 34px !important;
}

.workout-cockpit-sheet .form-assist-actions {
  margin-top: 10px !important;
  gap: 8px !important;
  padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
}

/* v60: cockpit footer actions use a compact 2x2 grid. */
.workout-cockpit-sheet .form-assist-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 10px !important;
  padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
}

.workout-cockpit-sheet .form-assist-actions .primary-button,
.workout-cockpit-sheet .form-assist-actions .secondary-button,
.workout-cockpit-sheet .form-assist-actions .danger-button,
.workout-cockpit-sheet .form-assist-actions button {
  width: 100% !important;
  min-height: 38px !important;
  padding: 8px 10px !important;
  font-size: 0.8rem !important;
  line-height: 1.1 !important;
  white-space: normal !important;
}
