/* Keep Scienshell's existing chrome around the authorized Gumlet iframe. */
.stage.is-gumlet #gumlet-player {
  position: absolute;
  inset: auto;
  left: 50%;
  top: 50%;
  max-width: none;
  border: 0;
  transform: translate(-50%, -50%);
  background: #000;
  pointer-events: none;
}
.stage.is-gumlet .pc {
  background: linear-gradient(transparent, rgba(3, 7, 11, .92) 55%, #03070b);
}
.stage.is-gumlet .pc-seek { touch-action: none; }
.stage.is-gumlet #quality { display: none; }

/* Keep the settings surface in the site's chrome, including full screen. */
.stage.is-gumlet #set-panel {
  --set-bg: #111a23;
  --set-ink: #edf5fa;
  --set-muted: #b0c2cf;
  --set-line: rgba(182, 222, 244, .1);
  --set-accent: #b6def4;
  width: min(360px, var(--player-menu-width, 82vw));
  max-height: min(480px, var(--player-menu-height, calc(100dvh - 110px)));
  padding: 0 18px 16px;
  border: 1px solid rgba(182, 222, 244, .18);
  border-radius: 16px;
  color: var(--set-ink);
  background: var(--set-bg);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 14px;
  line-height: 1.5;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #506879 transparent;
}
.stage.is-gumlet #set-panel::-webkit-scrollbar { width: 4px; }
.stage.is-gumlet #set-panel::-webkit-scrollbar-thumb { border-radius: 4px; background: #506879; }
.stage.is-gumlet #set-panel ::selection { color: #111a23; background: #b6def4; }
.stage.is-gumlet #set-panel .set-header {
  min-height: 56px;
  margin: 0 0 2px;
  padding: 4px 0;
  border-bottom: 1px solid var(--set-line);
  background: var(--set-bg);
}
.stage.is-gumlet #set-panel .set-header h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.4;
}
.stage.is-gumlet #set-panel .set-close {
  min-width: 36px;
  min-height: 36px;
  margin-right: -8px;
  border-radius: 8px;
  color: var(--set-muted);
}
.stage.is-gumlet #set-panel .set-close:hover { color: var(--set-ink); background: #1d2a35; }
.stage.is-gumlet #set-panel .set-close svg { width: 16px; height: 16px; }
.stage.is-gumlet #set-panel .set-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 52px;
  gap: 12px;
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid var(--set-line);
}
.stage.is-gumlet #set-panel .set-label {
  min-width: 0;
  gap: 9px;
  color: var(--set-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
.stage.is-gumlet #set-panel .set-label svg {
  width: 16px;
  height: 16px;
  color: #8baabd;
}
.stage.is-gumlet #set-panel .set-control { min-width: 0; }
.stage.is-gumlet #set-panel .set-segments {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  padding: 3px;
  border: 0;
  border-radius: 8px;
  background: #080f16;
}
.stage.is-gumlet #set-panel .set-segments button {
  flex: 1 1 0;
  min-width: 40px;
  min-height: 32px;
  margin: 0;
  padding: 6px 7px;
  border: 0;
  border-radius: 5px;
  color: var(--set-muted);
  background: transparent;
  font: 500 12px/1.3 var(--ui-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}
.stage.is-gumlet #set-panel .set-segments button:hover:not(:disabled) {
  color: var(--set-ink);
  background: #1b2b37;
}
.stage.is-gumlet #set-panel .set-segments button[aria-pressed="true"] {
  color: #e6f6ff;
  background: #304c60;
}
.stage.is-gumlet #set-panel #set-fit .set-segments button { min-width: 64px; }
.stage.is-gumlet #set-panel #set-quality .set-segments button { min-width: 64px; }
.stage.is-gumlet #set-panel .set-toggle {
  width: 44px;
  min-width: 44px;
  min-height: 40px;
  border-radius: 7px;
}
.stage.is-gumlet #set-panel .set-toggle::before {
  inset: 8px 2px;
  border-radius: 14px;
  background: #3c5060;
}
.stage.is-gumlet #set-panel .set-toggle::after {
  top: 11px;
  left: 5px;
  width: 18px;
  height: 18px;
  background: #d7e4ec;
  box-shadow: none;
}
.stage.is-gumlet #set-panel .set-toggle[aria-checked="true"]::before { background: #9dcee8; }
.stage.is-gumlet #set-panel .set-toggle[aria-checked="true"]::after {
  background: #152837;
  transform: translateX(16px);
}
.stage.is-gumlet #set-panel .set-range {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  max-width: 100%;
  height: 36px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.stage.is-gumlet #set-panel .set-range::-webkit-slider-runnable-track {
  height: 3px;
  border: 0;
  border-radius: 3px;
  background: #526d80;
}
.stage.is-gumlet #set-panel .set-range::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 3px;
  background: #526d80;
}
.stage.is-gumlet #set-panel .set-range::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--set-accent); }
.stage.is-gumlet #set-panel .set-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--set-accent);
}
.stage.is-gumlet #set-panel .set-range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--set-accent);
}
.stage.is-gumlet #set-panel :is(button, input, summary):focus-visible {
  outline: 2px solid var(--set-accent);
  outline-offset: 3px;
}
.stage.is-gumlet #set-panel button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 719px) {
  .stage.is-gumlet #set-panel {
    position: fixed;
    inset: auto 12px calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    max-height: min(76dvh, calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    margin: 0;
    padding: 0 18px 16px;
    border-radius: 16px;
    transform-origin: bottom center;
  }
  .stage.is-gumlet #set-panel::backdrop { background: rgba(3, 7, 11, .7); }
  .stage.is-gumlet #set-panel .set-row { min-height: 54px; gap: 10px; }
  .stage.is-gumlet #set-panel .set-label { gap: 8px; font-size: 14px; }
  .stage.is-gumlet #set-panel .set-segments button { min-height: 36px; padding-inline: 6px; }
  .stage.is-gumlet #set-panel .set-close { min-width: 44px; min-height: 44px; }
  .stage.is-gumlet #set-panel .set-toggle { min-height: 44px; }
  .stage.is-gumlet #set-panel .set-toggle::before { inset-block: 10px; }
  .stage.is-gumlet #set-panel .set-toggle::after { top: 13px; }
  .stage.is-gumlet #set-panel .set-range { height: 44px; }
}
@media (max-width: 359px) {
  .stage.is-gumlet #set-panel { inset-inline: 8px; padding-inline: 14px; }
  .stage.is-gumlet #set-panel .set-label { gap: 6px; font-size: 13px; }
  .stage.is-gumlet #set-panel .set-label svg { width: 14px; height: 14px; }
  .stage.is-gumlet #set-panel .set-segments button { min-width: 36px; padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-gumlet #set-panel .set-segments button { transition: none; }
}

#gumlet-playback-note { color: #fff; }

/* Feedback belongs to the film surface, and never intercepts a click. */
.watch-page .stage .pc-skip,
.watch-page .stage .pc-boost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  background: rgba(10, 19, 27, .92);
  color: #fff;
  font: 500 14px/1.4 var(--ui-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}
.watch-page .stage .pc-skip[hidden],
.watch-page .stage .pc-boost[hidden] { display: none !important; }
.watch-page .stage .pc-skip svg,
.watch-page .stage .pc-boost svg { width: 20px; height: 20px; flex: none; color: #b6def4; }
.watch-page .stage .pc-skip {
  min-width: 86px;
  opacity: 0;
  transform: translateY(-50%) scale(.97);
  transition: opacity 140ms ease-out, transform 180ms cubic-bezier(.16, 1, .3, 1);
}
.watch-page .stage .pc-skip.is-on { opacity: 1; transform: translateY(-50%) scale(1); animation: none; }
.watch-page .stage .pc-skip.is-volume {
  left: auto;
  right: 18px;
  top: max(18px, env(safe-area-inset-top));
  min-width: 150px;
  flex-wrap: wrap;
  column-gap: 9px;
  row-gap: 8px;
  transform: translateY(3px) scale(.97);
}
.watch-page .stage .pc-skip.is-volume.is-on { transform: translateY(0) scale(1); }
.watch-page .stage .pc-feedback-meter {
  display: block;
  flex-basis: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #40515c;
}
.watch-page .stage .pc-feedback-meter > i { display: block; height: 100%; background: #b6def4; }
.watch-page .stage .pc-boost { top: max(18px, env(safe-area-inset-top)); }
.watch-page .stage .pc { transition-duration: 180ms, 200ms; }
.watch-page .stage #set-panel { transition-duration: 180ms; }
.watch-page .stage:fullscreen.is-fs-ready .pc,
.watch-page .stage:-webkit-full-screen.is-fs-ready .pc { animation-duration: 180ms; animation-delay: 0ms; }
@media (prefers-reduced-motion: reduce) {
  .watch-page .stage .pc-skip,
  .watch-page .stage .pc,
  .watch-page .stage #set-panel { transition: none; animation: none; }
  .watch-page .stage:fullscreen.is-fs-ready .pc,
  .watch-page .stage:-webkit-full-screen.is-fs-ready .pc { animation: none; }
}

/* A touch player has no decorative light rim. Keyboard focus remains visible. */
@media (any-pointer: coarse) {
  .watch-page .stage.is-gumlet:not(:focus-visible) { outline: 0; }
}
.watch-page .stage:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) {
  background: #000;
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
}
.watch-page .stage:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen):focus-visible {
  outline: 2px solid #b6def4;
  outline-offset: -3px;
}
.watch-page.is-touch-fullscreen { background: #000; }
.watch-page .stage.is-gumlet .yt-fullscreen-exit { display: none !important; }

/* Keep the complete stage in the visible viewport when iOS cannot rotate it. */
.watch-page .stage.is-touch-fullscreen {
  --touch-stage-width: var(--touch-viewport-width, 100vw);
  --touch-stage-height: var(--touch-viewport-height, 100dvh);
  --player-safe-top: env(safe-area-inset-top, 0px);
  --player-safe-right: env(safe-area-inset-right, 0px);
  --player-safe-bottom: env(safe-area-inset-bottom, 0px);
  --player-safe-left: env(safe-area-inset-left, 0px);
  position: fixed;
  inset: auto;
  left: var(--touch-viewport-left, 0px);
  top: var(--touch-viewport-top, 0px);
  width: var(--touch-stage-width);
  height: var(--touch-stage-height);
  max-width: none;
  min-height: 0;
  margin: 0;
  aspect-ratio: auto;
  transform: none !important;
  transform-origin: center;
}
.watch-page .stage.is-touch-fullscreen.is-touch-rotated {
  --touch-stage-width: var(--touch-viewport-height, 100dvh);
  --touch-stage-height: var(--touch-viewport-width, 100vw);
  --player-safe-top: env(safe-area-inset-right, 0px);
  --player-safe-right: env(safe-area-inset-bottom, 0px);
  --player-safe-bottom: env(safe-area-inset-left, 0px);
  --player-safe-left: env(safe-area-inset-top, 0px);
  left: calc(var(--touch-viewport-left, 0px) + var(--touch-viewport-width, 100vw) / 2);
  top: calc(var(--touch-viewport-top, 0px) + var(--touch-viewport-height, 100dvh) / 2);
  transform: translate(-50%, -50%) rotate(90deg) !important;
}
.watch-page .stage.is-touch-fullscreen .pc {
  padding-left: max(12px, var(--player-safe-left));
  padding-right: max(12px, var(--player-safe-right));
  padding-bottom: max(6px, var(--player-safe-bottom));
}
.watch-page .stage.is-touch-fullscreen #pc-now { left: max(12px, var(--player-safe-left)); }
.watch-page .stage.is-touch-fullscreen .pc-dur { right: max(12px, var(--player-safe-right)); }
.watch-page .stage.is-touch-fullscreen .yt-fullscreen-exit {
  top: max(12px, var(--player-safe-top));
  right: max(12px, var(--player-safe-right));
}
.watch-page .stage.is-touch-fullscreen .pc-boost { top: max(18px, var(--player-safe-top)); }
.watch-page .stage.is-touch-fullscreen .pc-skip.is-volume {
  top: max(18px, var(--player-safe-top));
  right: max(18px, var(--player-safe-right));
}
.watch-page .stage.is-touch-fullscreen .player-set { position: static; }
.watch-page .stage.is-gumlet.is-touch-fullscreen #set-panel {
  position: absolute;
  inset: auto max(12px, var(--player-safe-right)) calc(100% + 8px) auto;
  width: min(360px, calc(var(--touch-stage-width) - 24px - var(--player-safe-left) - var(--player-safe-right)));
  max-width: none;
  max-height: min(480px, var(--player-menu-height, 480px), calc(var(--touch-stage-height) - 144px - var(--player-safe-top) - var(--player-safe-bottom)));
  margin: 0;
  border-radius: 16px;
  transform-origin: bottom right;
}

/* On a short fullscreen stage the menu shares the film height, rather than
   competing for the few pixels above the control bar. Reserve its right edge
   for the fullscreen exit, and keep Close reachable while settings scroll. */
.watch-page .stage.is-gumlet.is-compact-menu:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) .pc {
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.watch-page .stage.is-gumlet.is-compact-menu:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) .pc-timeline,
.watch-page .stage.is-gumlet.is-compact-menu:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) .pc-bar {
  flex-shrink: 0;
}
.watch-page .stage.is-gumlet.is-compact-menu:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) .pc-bar,
.watch-page .stage.is-gumlet.is-compact-menu:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) .player-set {
  position: static;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.watch-page .stage.is-gumlet.is-compact-menu:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) #set-panel {
  --compact-menu-top: max(8px, var(--player-safe-top, env(safe-area-inset-top, 0px)));
  --compact-menu-bottom: max(8px, var(--player-safe-bottom, env(safe-area-inset-bottom, 0px)));
  --compact-menu-right: max(72px, calc(64px + var(--player-safe-right, env(safe-area-inset-right, 0px))));
  --compact-menu-left: max(8px, var(--player-safe-left, env(safe-area-inset-left, 0px)));
  position: absolute;
  inset: var(--compact-menu-top) var(--compact-menu-right) auto auto;
  width: min(360px, calc(100% - var(--compact-menu-left) - var(--compact-menu-right)));
  height: auto;
  min-height: 0;
  max-height: calc(100% - var(--compact-menu-top) - var(--compact-menu-bottom));
  margin: 0;
  padding: 0 14px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-top: 52px;
  border-radius: 12px;
  transform-origin: top right;
}
.watch-page .stage.is-gumlet.is-compact-menu:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) #set-panel .set-header {
  position: sticky;
  top: 0;
  min-height: 48px;
  padding: 2px 0;
  margin: 0;
  z-index: 2;
}
.watch-page .stage.is-gumlet.is-compact-menu:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) #set-panel .set-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}
.watch-page .stage.is-gumlet.is-compact-menu:is(:fullscreen, :-webkit-full-screen, .is-touch-fullscreen) #set-panel .set-row {
  min-height: 48px;
  padding-block: 4px;
  gap: 8px;
}

/* The related article is a complete destination, distinct from More films. */
.watch-page .column-rec-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.watch-page .column-rec-head .watch-section-heading { flex: 1 1 auto; }
.watch-page .column-rec-head .watch-section-link { flex: 0 0 auto; }
.watch-page .column-rec-card {
  align-items: center;
  gap: 24px;
  text-decoration: none;
  border-radius: 14px;
}
.watch-page .column-rec-card .thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.watch-page .column-rec-card .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.watch-page .column-rec-copy h3 {
  margin: 0 0 12px;
  color: #edf5fa;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: break-word;
}
.watch-page .column-rec-copy p {
  margin: 0;
  color: #b0c2cf;
  font-size: 15px;
  line-height: 1.65;
}
.watch-page .column-rec-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 10px;
  color: #b6def4;
  font-size: 14px;
  font-weight: 500;
}
.watch-page .column-rec-read svg,
.watch-page .column-rec-head .watch-section-link svg { width: 16px; height: 16px; flex: none; }
.watch-page .column-rec-card:hover .column-rec-read { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.watch-page .column-rec-card:focus-visible,
.watch-page .column-rec-head .watch-section-link:focus-visible {
  outline: 2px solid #b6def4;
  outline-offset: 5px;
}
@media (max-width: 719px) {
  .watch-page .column-rec-head { gap: 12px; margin-bottom: 16px; }
  .watch-page .column-rec-card { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .watch-page .column-rec-copy h3 { font-size: clamp(22px, 5.8vw, 24px); line-height: 1.3; }
  .watch-page .column-rec-copy p { font-size: 15px; line-height: 1.65; }
}

/* A network retry has its own surface so recovery never dismisses other notices. */
.stage .gumlet-network-toast {
  position: absolute; z-index: 9; left: 12px; right: 12px; top: 12px;
  display: flex; align-items: center; gap: 12px; width: fit-content;
  max-width: calc(100% - 24px); padding: 6px 8px 6px 14px;
  border: 1px solid rgba(182, 222, 244, .22); border-radius: 12px;
  background: rgba(8, 15, 22, .96); color: #edf5fa;
  font: 400 13px/1.45 var(--ui-font); text-align: left;
}
.stage .gumlet-network-toast[hidden] { display: none !important; }
.stage .gumlet-network-toast span { min-width: 0; max-width: 390px; }
.stage .gumlet-network-toast button {
  flex: none; min-width: 64px; min-height: 44px; padding: 8px 12px;
  border: 1px solid rgba(182, 222, 244, .25); border-radius: 8px;
  background: #243b4b; color: #edf5fa; font: inherit; cursor: pointer;
}
.stage .gumlet-network-toast button:hover { background: #304c60; }
.stage .gumlet-network-toast button:focus-visible { outline: 2px solid #b6def4; outline-offset: 2px; }
.stage .gumlet-network-toast button:disabled { opacity: .65; cursor: wait; }
@media (max-width: 479px) {
  .stage .gumlet-network-toast { top: 4px; gap: 8px; padding: 4px 4px 4px 10px; font-size: 12px; }
}


/* Show the desktop volume control in its reserved space. Keeping its width
   fixed prevents hover/focus from shifting the mute and playback hit targets.
   Mobile retains the existing <=720px display:none rule. */
@media (min-width: 721px) {
  .watch-page .stage.is-gumlet .pc-vol .pc-range {
    flex: 0 0 88px;
    width: 88px;
    opacity: 1;
    pointer-events: none;
    transition: opacity .35s var(--ease);
  }
  .watch-page .stage.is-gumlet:not(.is-chrome-off) .pc-vol .pc-range {
    pointer-events: auto;
  }
}
@media (min-width: 721px) and (prefers-reduced-motion: reduce) {
  .watch-page .stage.is-gumlet .pc-vol .pc-range { transition: none; }
}
