.tpv-trigger {
  display: inline-flex; align-items: center; gap: .65rem;
  margin: 0 0 0.25rem; padding: .54rem .82rem;
  min-height: 44px; box-sizing: border-box;
  border: 1px solid #c7aa75; border-radius: 3px;
  color: #f4dfb9; background: rgba(8, 20, 37, .25);
  font: 600 .875rem/1.25 system-ui, sans-serif;
  text-decoration: none; text-transform: none; letter-spacing: .015em;
}
.tpv-trigger:hover { color: #fff6e6; background: rgba(199, 170, 117, .14); }
.tpv-trigger:focus-visible, .tpv-close:focus-visible {
  outline: 2px solid #f1d6a4; outline-offset: 4px;
}
.tpv-trigger svg { width: 1em; height: 1em; fill: currentColor; flex: none; }
.tpv-duration { color: #decba7; padding-left: .55rem; border-left: 1px solid #a08862; font-weight: 400; }
.tpv-dialog:not([open]) { display: none; }
.tpv-dialog {
  box-sizing: border-box; width: max-content; max-width: calc(100vw - 1.5rem);
  max-height: calc(100vh - 1.5rem); max-height: calc(100dvh - 1.5rem - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
  padding: .8rem; margin: auto; overflow: auto; overscroll-behavior: contain;
  background: #0e1e34; color: #fff6e6; border: 1px solid #c7aa75;
  border-radius: 5px; box-shadow: 0 18px 70px rgba(0,0,0,.48);
}
.tpv-dialog::backdrop { background: rgba(5, 11, 21, .83); }
.tpv-dialog-bar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .55rem; }
.tpv-dialog-title { margin: 0; color: #fff6e6; font: 600 .94rem/1.25 system-ui, sans-serif; }
.tpv-close {
  min-width: 44px; min-height: 44px; padding: 0 .55rem; color: #f4dfb9;
  background: transparent; border: 1px solid #a08862; border-radius: 3px;
  font: 600 .8rem/1 system-ui, sans-serif; cursor: pointer;
}
.tpv-dialog video {
  display: block; width: min(375px, calc(100vw - 3.25rem), calc(56.25vh - 63px));
  width: min(375px, calc(100vw - 3.25rem), calc(56.25dvh - 63px));
  height: auto; aspect-ratio: 9 / 16; object-fit: contain; background: #060d19; margin: auto;
}
/* Lock the page, not the player, while the portrait dialog is active. */
html.tpv-open { overflow: hidden; overscroll-behavior: contain; }
.page-portrait .tpv-trigger { margin-left: 12px; margin-bottom: 12px; }
@media (max-width: 540px) {
  .page-portrait .tpv-trigger {
    display: flex; inline-size: calc(100% - 24px); min-block-size: 48px;
    justify-content: flex-start; margin: 4px 12px 12px;
    touch-action: manipulation;
  }
  .tpv-trigger .tpv-duration { margin-inline-start: auto; white-space: nowrap; }
  .tpv-dialog { max-width: calc(100vw - 1rem); padding: .625rem; }
  .tpv-dialog video { width: min(375px, calc(100vw - 2.5rem), calc(56.25vh - 53px));
    width: min(375px, calc(100vw - 2.5rem), calc(56.25dvh - 53px)); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .tpv-dialog { padding: .5rem; }
  .tpv-dialog-bar { margin-bottom: .35rem; gap: .55rem; }
  .tpv-dialog video { width: min(275px, calc(100vw - 2.25rem), calc(56.25vh - 52px));
    width: min(275px, calc(100vw - 2.25rem), calc(56.25dvh - 52px)); }
}
