/*
 * Witness — a skin for Video.js 10.
 *
 * The language is lens-barrel engraving: a matte body, paint-filled marks cut by a round cutter, a second scale in
 * amber, and one fixed witness mark that everything is read against. The body is smoked, never clear: every mark keeps
 * a floor of contrast whatever the picture is doing.
 *
 * Contents
 *   1. Tokens          5. Buttons and icons      9. Feedback
 *   2. Root and media  6. Readout and volume    10. Error dialog
 *   3. Controls        7. Overview slider       11. Sizes
 *   4. Ring            8. Popups and menu       12. Preferences
 */

/*
 * The face carries two sets of vertical metrics, and engines disagree about which to use. These are the ones the
 * skin was set on (hhea: 1277, 380 and 92 over 1024), pinned so every label sits the same in every browser.
 */
@font-face {
  font-family: "Routed Gothic";
  src: url("fonts/routed-gothic.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  ascent-override: 124.71%;
  descent-override: 37.11%;
  line-gap-override: 8.98%;
}

/* ------------------------------------------------------------------ 1. Tokens */

witness-skin {
  /* Public: five of the custom properties the packaged Video.js skins accept, under the same names. */
  --witness-mark: var(--media-accent-color, #ff4b1f);
  --witness-radius: var(--media-border-radius, 0px);
  --witness-font: var(
    --media-font-family,
    "Routed Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    sans-serif
  );

  /*
   * Body and marks. The body is smoked rather than solid: enough of the picture comes through to tint it, never
   * enough to cost a mark its contrast (over pure white it still measures darker than #2d2d2e).
   */
  --witness-body: rgb(10 10 11 / 0.86);
  --witness-solid: #0a0a0b;
  --witness-plate: #161618;
  --witness-ink: #f4f1ea;
  --witness-ink-dim: rgb(244 241 234 / 0.62);
  --witness-second: #ffb000;
  --witness-line: rgb(244 241 234 / 0.13);
  --witness-rail: rgb(244 241 234 / 0.4);
  --witness-wash: rgb(244 241 234 / 0.1);
  /* Small surfaces that stand on the picture itself: the front element, the way back, key-press feedback. */
  --witness-veil: rgb(10 10 11 / 0.8);
  --witness-veil-edge: rgb(244 241 234 / 0.2);
  /* How strongly an unpainted mark on the ring shows, from 0 to 1. Read by the ring. */
  --witness-bare: 0.55;
  --witness-focus: var(--witness-ink);
  --witness-shadow: 0 0 0 1px var(--witness-line), 0 10px 30px rgb(0 0 0 / 0.5);

  /* Motion. Reduced motion collapses every one of these. */
  --witness-quick: 110ms;
  --witness-calm: 180ms;
  --witness-slow: 320ms;
  --witness-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Sizes live on the children so container queries can change them. */
witness-skin > * {
  --w-ring: 46px;
  --w-row: 48px;
  --w-band: calc(var(--w-ring) + var(--w-row));
  --w-button: 40px;
  --w-icon: 20px;
  --w-gutter: 8px;
  --w-readout: 21px;
  --w-front: clamp(96px, 21cqi, 240px);
  /* The room above the band, less a margin: previews never grow past it. */
  --w-room: calc(var(--witness-height, 420px) - var(--w-band) - 20px);
  /* The public Video.js caption properties, so media elements that keep their <video> in a shadow root follow too. */
  --media-caption-track-y: 0px;
  --media-caption-track-duration: var(--witness-calm);
}

/* ------------------------------------------------------------------ 2. Root and media */

:where(video-player):has(> witness-skin),
:where(media-i18n):has(witness-skin) {
  display: contents;
}

witness-skin {
  position: relative;
  display: block;
  container: media-root / inline-size;
  aspect-ratio: 16 / 9;
  overflow: clip;
  isolation: isolate;
  border-radius: var(--witness-radius);
  background: #000;
  color: var(--witness-ink);
  font: 400 13px / 1.2 var(--witness-font);
  font-synthesis: none;
  text-align: start;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

/* The root draws its own ring, inside the frame; a page-wide :focus-visible rule must not add a second one. */
witness-skin:focus-visible {
  outline: none;
}

witness-skin:fullscreen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
}

witness-skin,
witness-skin *,
witness-skin *::before,
witness-skin *::after {
  box-sizing: border-box;
}

/* Components hide unavailable parts with `hidden`; an author `display` must not bring them back. */
witness-skin [hidden][hidden] {
  display: none !important;
}

witness-skin :is(media-controls, media-tooltip-group, media-error-dialog) {
  display: contents;
}

/* Whatever the author put inside is the media; everything the skin stamps in is marked as its own. */
witness-skin > :not([data-witness-part]) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--media-object-fit, contain);
  object-position: var(--media-object-position, center);
  /* Captions drawn inside a media element's own shadow tree take their face from the element: the system's. */
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/*
 * An image handed to the skin the way the packaged skins take one, <img slot="poster"> or <img slot="thumbnail">,
 * is not media. The skin moves it into the part it is for; until then, and if one arrives later, it stays out of
 * the picture.
 */
witness-skin > :is([slot="poster"], [slot="thumbnail"]) {
  display: none;
}

/* Captions step up out of the band's way while it is showing. */
witness-skin video::-webkit-media-text-track-container {
  translate: 0 var(--media-caption-track-y, 0px);
  transition: translate var(--media-caption-track-duration, 0s) ease-out;
}

witness-skin[data-controls-visible] > * {
  --media-caption-track-y: calc(var(--w-band) * -1);
}

witness-skin ::cue {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: rgb(10 10 11 / 0.82);
  color: #fff;
}

/* The cursor leaves with the controls, but only once the skin is running and the film is playing. */
witness-skin[data-theme]:not([data-controls-visible]):has(.w-play:not([data-paused])) {
  cursor: none;
}

witness-skin .w-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity var(--witness-calm) ease-out;
}

witness-skin .w-poster:not([data-visible]) {
  opacity: 0;
}

/* The author's own poster image, once it has been moved in. A <picture> around it takes no box of its own. */
witness-skin .w-poster > picture {
  display: contents;
}

witness-skin .w-poster > img,
witness-skin .w-poster > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--media-object-fit, contain);
  object-position: var(--media-object-position, center);
}

witness-skin .w-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

/* One focus ring, everywhere. */
witness-skin :focus-visible {
  outline: 2px solid var(--witness-focus);
  outline-offset: 2px;
}

witness-skin:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 60;
  border-radius: inherit;
  outline: 2px solid var(--witness-focus);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 5px rgb(0 0 0 / 0.6);
  pointer-events: none;
}

/* ------------------------------------------------------------------ 3. Controls */

witness-skin .w-controls {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  /* Leaving is unhurried; coming back is immediate. */
  transition: opacity var(--witness-slow) ease-out;
}

witness-skin .w-controls[data-visible],
witness-skin .w-controls:has(:focus-visible) {
  transition-duration: var(--witness-quick);
}

/* Keyboard focus inside the controls keeps them on screen: nothing focusable is ever hidden. */
witness-skin .w-controls:not([data-visible]):not(:has(:focus-visible)) {
  opacity: 0;
}

witness-skin .w-band {
  position: relative;
  direction: ltr;
  background: var(--witness-body);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  pointer-events: auto;
  transition: translate var(--witness-slow) ease-out;
}

witness-skin .w-controls:not([data-visible]):not(:has(:focus-visible)) .w-band {
  translate: 0 8px;
  pointer-events: none;
}

/* While the controls are away nothing in them takes the pointer: the first tap or click belongs to the picture. */
witness-skin .w-controls:not([data-visible]):not(:has(:focus-visible)) :is(.w-front-play, .w-top) {
  pointer-events: none;
}

witness-skin .w-controls[data-visible] .w-band,
witness-skin .w-controls:has(:focus-visible) .w-band {
  transition-duration: var(--witness-quick);
}

witness-skin .w-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  height: var(--w-row);
  padding-inline: var(--w-gutter);
  border-top: 1px solid var(--witness-line);
}

/* The witness mark, standing on the seam between the fixed body and the ring. */
witness-skin .w-row::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  translate: -50% 0;
  border: 6px solid transparent;
  border-top: 0;
  border-bottom: 8px solid var(--witness-mark);
}

witness-skin .w-group {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

witness-skin .w-group-end {
  justify-content: flex-end;
}

/* ------------------------------------------------------------------ 4. Ring */

witness-skin .w-ring {
  position: relative;
  display: block;
  height: var(--w-ring);
  /* The barrel curves away at both ends. */
  background: linear-gradient(
    90deg,
    rgb(0 0 0 / 0.6) 0%,
    rgb(0 0 0 / 0.2) 16%,
    rgb(255 255 255 / 0.05) 50%,
    rgb(0 0 0 / 0.2) 84%,
    rgb(0 0 0 / 0.6) 100%
  );
  cursor: grab;
  touch-action: pan-y;
}

witness-skin .w-ring[data-dragging] {
  cursor: grabbing;
}

witness-skin .w-ring[data-disabled] {
  cursor: default;
}

witness-skin .w-ring > canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------------ 5. Buttons and icons */

witness-skin .w-button {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: var(--w-button);
  height: var(--w-button);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color var(--witness-quick) ease-out,
    scale var(--witness-quick) ease-out;
}

/* Touch gets a larger target than the mark it shows. */
@media (pointer: coarse) {
  witness-skin .w-button::after {
    content: "";
    position: absolute;
    inset: -4px -2px;
  }
}

@media (hover: hover) {
  witness-skin .w-button:hover {
    background-color: var(--witness-wash);
  }
}

witness-skin .w-button:active {
  scale: 0.92;
}

witness-skin .w-button[aria-expanded="true"] {
  background-color: var(--witness-wash);
}

witness-skin .w-button[aria-disabled="true"] {
  color: var(--witness-ink-dim);
  cursor: not-allowed;
}

witness-skin .w-icon {
  display: block;
  grid-area: 1 / 1;
  width: var(--w-icon);
  height: var(--w-icon);
  overflow: visible;
}

/* State icons share one seat and cross-fade in place. */
witness-skin .w-button > .w-icon,
witness-skin .w-front-mark > .w-icon {
  opacity: 0;
  scale: 0.6;
  transition:
    opacity var(--witness-quick) ease-out,
    scale var(--witness-quick) ease-out;
}

witness-skin :is(.w-play, .w-front-play)[data-ended] [data-icon="replay"],
witness-skin :is(.w-play, .w-front-play):not([data-ended])[data-paused] [data-icon="play"],
witness-skin :is(.w-play, .w-front-play):not([data-ended]):not([data-paused]) [data-icon="pause"],
witness-skin .w-mute[data-volume-level="off"] [data-icon="volume-off"],
witness-skin .w-mute[data-volume-level="low"] [data-icon="volume-low"],
witness-skin .w-mute:is([data-volume-level="medium"], [data-volume-level="high"]) [data-icon="volume-high"],
witness-skin .w-over > .w-icon,
witness-skin .w-captions[data-active] [data-icon="captions-on"],
witness-skin .w-captions:not([data-active]) [data-icon="captions-off"],
witness-skin .w-pip[data-pip] [data-icon="pip-exit"],
witness-skin .w-pip:not([data-pip]) [data-icon="pip-enter"],
witness-skin .w-fullscreen[data-fullscreen] [data-icon="fullscreen-exit"],
witness-skin .w-fullscreen:not([data-fullscreen]) [data-icon="fullscreen-enter"],
witness-skin .w-settings > .w-icon {
  opacity: 1;
  scale: 1;
}

/*
 * Sending the picture elsewhere (AirPlay, Cast) sits in the top corner, on its own veil, and only exists while there
 * is somewhere to send it.
 */
witness-skin .w-top {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  direction: ltr;
  pointer-events: auto;
}

witness-skin .w-over {
  background: var(--witness-veil);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 0 0 1px var(--witness-veil-edge);
}

witness-skin .w-over:not([data-availability="available"]) {
  display: none;
}

/* These stand on the picture, not on the band: pointing at one darkens it instead of washing it out. */
@media (hover: hover) {
  witness-skin .w-over:hover {
    background-color: var(--witness-solid);
  }
}

/* Connected is a change of shape as well as tone: the button turns solid. */
witness-skin .w-airplay[data-airplay-state="connected"],
witness-skin .w-cast[data-cast-state="connected"] {
  background: var(--witness-ink);
  color: var(--witness-solid);
}

/* The front element: before the first frame and after the last, the play control is a lens seen head-on. */
witness-skin .w-front {
  position: absolute;
  inset: 0 0 var(--w-band);
  display: grid;
  place-items: center;
  pointer-events: none;
}

witness-skin .w-front-play {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--w-front);
  height: var(--w-front);
  border-radius: 50%;
  background: var(--witness-veil);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow:
    0 0 0 1px var(--witness-veil-edge),
    0 18px 50px rgb(0 0 0 / 0.45);
  color: var(--witness-ink);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition:
    opacity var(--witness-calm) ease-out,
    scale var(--witness-slow) var(--witness-ease),
    visibility 0s;
}

witness-skin .w-front-play:active {
  scale: 0.97;
}

/* Controls that stand on the picture give their focus ring a dark ground of its own. */
witness-skin .w-front-play:focus-visible,
witness-skin .w-over:focus-visible,
witness-skin .w-return-button:focus-visible {
  box-shadow:
    0 0 0 1px var(--witness-veil-edge),
    0 0 0 8px rgb(10 10 11 / 0.72);
}

/* Once the film is running the front element steps aside. */
witness-skin .w-front-play[data-started]:not([data-ended]) {
  visibility: hidden;
  opacity: 0;
  scale: 0.9;
  pointer-events: none;
  transition:
    opacity var(--witness-calm) ease-out,
    scale var(--witness-calm) ease-out,
    visibility 0s linear var(--witness-calm);
}

/*
 * On touch it stays with the controls as the play / pause target, at a size that leaves the picture alone: 64 px,
 * without its inscription, and out of the way entirely while the ring is being turned.
 */
@media (pointer: coarse) {
  witness-skin .w-front-play[data-started]:not([data-ended]) {
    visibility: visible;
    width: 64px;
    height: 64px;
    opacity: 1;
    scale: 1;
    pointer-events: auto;
    transition:
      opacity var(--witness-calm) ease-out,
      scale var(--witness-slow) var(--witness-ease),
      visibility 0s;
  }

  witness-skin .w-front-play[data-started]:not([data-ended]) .w-inscription {
    display: none;
  }

  witness-skin .w-front-play[data-started]:not([data-ended]) .w-front-mark {
    width: 24px;
    height: 24px;
  }

  witness-skin .w-controls:has(.w-ring[data-dragging]) .w-front-play[data-started]:not([data-ended]) {
    opacity: 0;
    pointer-events: none;
  }
}

/* While the ring is hunting, the front element is invisible rather than gone, so it never takes focus with it. */
witness-skin .w-hunt[data-visible] ~ media-controls .w-front-play {
  opacity: 0;
  pointer-events: none;
}

witness-skin .w-front-mark {
  display: grid;
  place-items: center;
  width: 30%;
  height: 30%;
}

witness-skin .w-front-mark > .w-icon {
  width: 100%;
  height: 100%;
}

witness-skin .w-inscription {
  position: absolute;
  inset: 0;
  display: block;
  transition: rotate 900ms var(--witness-ease);
}

witness-skin .w-inscription > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

@media (hover: hover) {
  witness-skin .w-front-play:hover .w-inscription {
    rotate: 24deg;
  }
}

/* ------------------------------------------------------------------ 6. Readout and volume */

witness-skin .w-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
  align-items: baseline;
  min-width: 9.2em;
  padding-top: 5px;
  font-size: var(--w-readout);
  line-height: 1;
}

witness-skin .w-time {
  position: relative;
  display: inline-flex;
  border-radius: 3px;
}

/* Elapsed sits left of the mark, in the past; remaining sits right of it, in the second colour. */
witness-skin .w-time-elapsed {
  justify-self: end;
}

witness-skin .w-time-remaining {
  justify-self: start;
  color: var(--witness-second);
  font-size: 0.72em;
}

witness-skin .w-time-remaining[data-type="duration"] {
  color: var(--witness-ink-dim);
}

/* The real <media-time> keeps its role, label and toggle; it is laid over the digits it describes. */
witness-skin .w-time > media-time {
  position: absolute;
  inset: -8px -6px;
  overflow: hidden;
  opacity: 0;
  outline: none;
}

witness-skin .w-time > media-time[role="button"] {
  cursor: pointer;
}

/* Only a time that can be pressed takes the pointer; the other never shades a neighbouring button. */
witness-skin .w-time > media-time:not([role="button"]) {
  pointer-events: none;
}

/* Before the film's length is known the readout is at rest, and its toggle does nothing. */
witness-skin .w-time:has(> media-time:is([data-unavailable], [data-disabled])) {
  color: var(--witness-ink-dim);
}

witness-skin .w-time > media-time:is([data-unavailable], [data-disabled]) {
  cursor: default;
}

witness-skin .w-time:has(> media-time:focus-visible) {
  outline: 2px solid var(--witness-focus);
  outline-offset: 5px;
}

/* Routed Gothic's 1 is a single stroke; each figure gets a fixed seat so the readout never shifts. */
witness-skin .w-digits {
  display: inline-flex;
  white-space: pre;
}

witness-skin .w-digits > span {
  display: inline-block;
  text-align: center;
}

witness-skin .w-digits > [data-kind="digit"] {
  width: 0.67em;
}

witness-skin .w-digits > [data-kind="mark"] {
  width: 0.3em;
}

witness-skin .w-digits > [data-kind="sign"] {
  width: 0.56em;
}

witness-skin .w-volume {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  width: 68px;
  height: var(--w-button);
  margin-inline: 4px 10px;
  cursor: pointer;
}

/* A short engraved scale under the rail. */
witness-skin .w-volume::before {
  content: "";
  position: absolute;
  inset: calc(50% + 4px) 0 auto;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--witness-rail) 0 1px, transparent 1px calc((100% - 1px) / 4));
}

witness-skin .w-volume-track {
  position: relative;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: var(--witness-rail);
}

witness-skin .w-volume-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--media-slider-fill, 0%);
  border-radius: inherit;
  background: var(--witness-ink);
}

witness-skin .w-volume-thumb {
  position: absolute;
  left: var(--media-slider-fill, 0%);
  width: 3px;
  height: 13px;
  translate: -50% 0;
  border-radius: 1.5px;
  background: var(--witness-ink);
  transition: scale var(--witness-quick) ease-out;
}

witness-skin .w-volume:is([data-pointing], [data-dragging]) .w-volume-thumb,
witness-skin .w-volume-thumb:focus-visible {
  scale: 1.35 1.15;
}

witness-skin .w-volume-thumb:focus-visible {
  outline-offset: 4px;
}

/* ------------------------------------------------------------------ 7. Overview slider */

/*
 * The whole film as one rail along the top edge of the body. This is the seek control for keyboards and assistive
 * technology, and the way to jump far; the ring below it is for getting the moment exactly right.
 */
witness-skin .w-overview {
  /* How far the rail's hit area reaches up over the picture. The rail itself lies on the band's top edge. */
  --w-rail: 16px;
  position: absolute;
  inset: calc(var(--w-rail) * -1) 0 auto;
  z-index: 5;
  display: block;
  /* It takes only the ring's top 8 px, so the ring keeps a full target of its own. */
  height: calc(var(--w-rail) + 8px);
  cursor: pointer;
}

@media (pointer: coarse) {
  witness-skin .w-overview {
    --w-rail: 22px;
  }
}

witness-skin .w-overview[data-disabled] {
  cursor: default;
}

witness-skin .w-overview-track {
  position: absolute;
  inset: var(--w-rail) 0 auto;
  display: block;
  height: 2px;
  background: var(--witness-rail);
  transition:
    height var(--witness-quick) ease-out,
    translate var(--witness-quick) ease-out;
}

witness-skin .w-overview:is([data-pointing], [data-dragging]) .w-overview-track,
witness-skin .w-overview:has(:focus-visible) .w-overview-track {
  height: 4px;
}

witness-skin .w-overview-buffer,
witness-skin .w-overview-record {
  position: absolute;
  inset: 0;
  display: block;
}

witness-skin .w-overview-buffer {
  right: auto;
  width: var(--media-slider-buffer, 0%);
  background: var(--witness-rail);
}

/*
 * Not a fill up to the playhead: the stretches that have actually played. Skip ahead and the rail stays bare behind
 * you; go back and what you already watched is still inked in front of you.
 */
witness-skin .w-overview-record {
  background: var(--witness-record, none);
}

/* The second mark: where you were before you jumped. */
witness-skin .w-overview-return {
  position: absolute;
  top: calc(var(--w-rail) - 4px);
  left: var(--witness-return, 0%);
  display: none;
  width: 3px;
  height: 10px;
  translate: -50% 0;
  border-radius: 1.5px;
  background: var(--witness-second);
  box-shadow: 0 0 0 1px var(--witness-solid);
  pointer-events: none;
}

witness-skin .w-band[data-return] .w-overview-return {
  display: block;
}

/* Like a depth-of-field scale: the stretch of the film the ring is showing right now. */
witness-skin .w-overview-window {
  position: absolute;
  top: calc(var(--w-rail) + 3px);
  left: var(--witness-window-start, 0%);
  right: calc(100% - var(--witness-window-end, 0%));
  height: 3px;
  border: 1px solid var(--witness-ink-dim);
  border-top: 0;
  pointer-events: none;
}

witness-skin .w-overview-thumb {
  position: absolute;
  top: calc(var(--w-rail) - 5px);
  left: var(--media-slider-fill, 0%);
  width: 3px;
  height: 12px;
  translate: -50% 0;
  border-radius: 1.5px;
  background: var(--witness-mark);
  box-shadow: 0 0 0 1px var(--witness-solid);
  transition: scale var(--witness-quick) ease-out;
}

witness-skin .w-overview[data-dragging] .w-overview-thumb {
  left: var(--media-slider-pointer, 0%);
}

witness-skin .w-overview:is([data-pointing], [data-dragging]) .w-overview-thumb,
witness-skin .w-overview-thumb:focus-visible {
  scale: 1.35 1.2;
}

/* The thumb stands half over the picture, so its focus ring brings its own dark ground. */
witness-skin .w-overview-thumb:focus-visible {
  outline-offset: 4px;
  box-shadow:
    0 0 0 4px var(--witness-solid),
    0 0 0 8px rgb(10 10 11 / 0.6);
}

/* The way back to the second mark. */
witness-skin .w-return {
  position: absolute;
  /* Clear of the rail's hit area, which reaches 16 px above the band. */
  bottom: calc(100% + 20px);
  left: 14px;
  z-index: 4;
  display: block;
  transition:
    opacity var(--witness-calm) ease-out,
    translate var(--witness-calm) var(--witness-ease);
}

@starting-style {
  witness-skin .w-return {
    opacity: 0;
    translate: 0 5px;
  }
}

witness-skin .w-return-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 0;
  padding: 2px 11px 0 9px;
  border: 0;
  border-radius: 18px;
  background: var(--witness-veil);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 0 0 1px var(--witness-veil-edge);
  color: var(--witness-ink);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: scale var(--witness-quick) ease-out;
}

witness-skin .w-return-button:active {
  scale: 0.96;
}

witness-skin .w-return-button .w-icon {
  margin-top: -2px;
}

witness-skin .w-return-time {
  color: var(--witness-second);
}

witness-skin .w-return-key {
  margin-inline-start: 2px;
  padding: 3px 5px 1px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--witness-line);
  color: var(--witness-ink-dim);
  font: inherit;
  font-size: 10px;
}

@media (pointer: coarse) {
  /* The rail reaches 22 px above the band on touch. */
  witness-skin .w-return {
    bottom: calc(100% + 26px);
  }

  witness-skin .w-return-button {
    height: 44px;
    padding-inline: 12px 15px;
  }

  witness-skin .w-return-key {
    display: none;
  }
}

/*
 * Previews. Video.js measures and places <media-slider-preview> itself, so that element carries no padding or
 * border; the plate inside it does. The ring's preview uses the same plate.
 */
witness-skin .w-preview,
witness-skin .w-ring-preview {
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--witness-quick) ease-out;
}

witness-skin .w-preview {
  bottom: calc(100% - var(--w-rail) + 10px);
}

/* Shown for the pointer, and for the keyboard: arrow keys move the same preview. */
witness-skin .w-overview:is([data-pointing], [data-dragging]) .w-preview,
witness-skin .w-overview:has(:focus-visible) .w-preview,
witness-skin .w-ring-preview[data-open] {
  opacity: 1;
}

witness-skin .w-ring-preview {
  position: absolute;
  bottom: calc(100% + 10px);
  left: var(--witness-ring-pointer, 50%);
  translate: -50% 0;
}

witness-skin .w-plate {
  display: grid;
  justify-items: center;
  padding: 3px;
  border-radius: 7px;
  background: var(--witness-plate);
  box-shadow: var(--witness-shadow);
}

/* The frame never outgrows the room above the band, so the plate is never cut by the player's edge. */
witness-skin .w-preview-frame {
  display: block;
  max-width: min(172px, (var(--w-room) - 46px) * 16 / 9);
  max-height: min(116px, var(--w-room) - 46px);
  border-radius: 4px;
}

witness-skin .w-preview-frame[data-hidden] {
  display: none;
}

witness-skin .w-preview-chapter {
  display: block;
  max-width: 172px;
  padding: 6px 9px 0;
  overflow: hidden;
  color: var(--witness-ink-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

witness-skin .w-preview-chapter:empty {
  display: none;
}

witness-skin .w-preview-time {
  display: block;
  padding: 5px 9px 3px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ 8. Popups and menu */

/*
 * Undo the browser's own popover chrome; Video.js places these in the top layer and positions them.
 *
 * In a right-to-left language the controls keep their places (the band is marked dir="ltr", which also keeps popup
 * alignment physical), while everything inside a popup reads and moves right to left.
 */
witness-skin .w-popup {
  /* Only matters where the Popover API is missing and popups stay in the player's own layer. */
  z-index: 20;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: none;
  color: var(--witness-ink);
  font: inherit;
}

/*
 * The popup hosts themselves stay left-to-right, because Video.js measures and places them; what is inside them
 * turns. (:is() forgives a selector the browser does not know, so the [dir] form applies where :dir() is missing.)
 */
:is([dir="rtl"] witness-skin, witness-skin:dir(rtl)) .w-menu-page {
  direction: rtl;
}

:is([dir="rtl"] witness-skin, witness-skin:dir(rtl)) .w-tooltip[data-open] {
  flex-direction: row-reverse;
}

@supports not selector(:popover-open) {
  witness-skin .w-popup:not([data-open], [data-ending-style]) {
    display: none !important;
  }
}

witness-skin .w-tooltip {
  --media-tooltip-side-offset: 9px;
  --media-tooltip-boundary-offset: 6px;
  padding: 6px 9px 4px;
  border-radius: 5px;
  background: var(--witness-plate);
  box-shadow: var(--witness-shadow);
  font-size: 11px;
  letter-spacing: 0.09em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  transition:
    opacity var(--witness-quick) ease-out,
    transform var(--witness-quick) ease-out;
}

witness-skin .w-tooltip[data-open] {
  display: flex;
  align-items: center;
  gap: 9px;
}

witness-skin .w-tooltip[data-starting-style] {
  opacity: 0;
  transform: translateY(3px);
}

witness-skin .w-tooltip[data-side="bottom"][data-starting-style] {
  transform: translateY(-3px);
}

witness-skin .w-tooltip[data-ending-style] {
  opacity: 0;
}

witness-skin .w-tooltip media-tooltip-shortcut {
  color: var(--witness-second);
}

witness-skin .w-menu {
  --media-popover-side-offset: 10px;
  --media-popover-boundary-offset: 8px;
  width: var(--media-menu-width);
  min-width: 204px;
  max-width: var(--media-menu-available-width, none);
  height: var(--media-menu-height);
  max-height: min(var(--media-menu-available-height, 348px), 348px);
  overflow: hidden;
  /* Outer radius = item radius + padding. */
  border-radius: 10px;
  background: var(--witness-plate);
  box-shadow: var(--witness-shadow);
  transform-origin: bottom right;
  /* Opens from its trigger; leaves faster than it arrives. */
  transition:
    opacity var(--witness-calm) var(--witness-ease),
    transform var(--witness-calm) var(--witness-ease),
    width var(--witness-calm) var(--witness-ease),
    height var(--witness-calm) var(--witness-ease);
}

witness-skin .w-menu[data-side="bottom"] {
  transform-origin: top right;
}

witness-skin .w-menu[data-starting-style] {
  opacity: 0;
  transform: scale(0.94) translateY(6px);
}

witness-skin .w-menu[data-ending-style] {
  opacity: 0;
  transform: scale(0.98);
  transition-duration: var(--witness-quick);
}

witness-skin .w-menu-page {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  padding: 5px;
  overflow: auto;
  overscroll-behavior: contain;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: var(--witness-rail) transparent;
  transition:
    translate var(--witness-calm) var(--witness-ease),
    opacity var(--witness-calm) ease-out;
}

witness-skin .w-menu-page:not([data-submenu])[data-child-open] {
  translate: -18% 0;
  opacity: 0;
}

witness-skin .w-menu-page[data-submenu] {
  z-index: 1;
}

witness-skin .w-menu-page[data-submenu]:is([data-starting-style], [data-ending-style]) {
  translate: 18% 0;
  opacity: 0;
  pointer-events: none;
}

:is([dir="rtl"] witness-skin, witness-skin:dir(rtl)) .w-menu .w-menu-page:not([data-submenu])[data-child-open] {
  translate: 18% 0;
}

:is([dir="rtl"] witness-skin, witness-skin:dir(rtl)) .w-menu .w-menu-page[data-submenu]:is([data-starting-style], [data-ending-style]) {
  translate: -18% 0;
}

witness-skin .w-menu-group {
  display: flex;
  flex-direction: column;
}

witness-skin .w-menu-item {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 2px 10px 0;
  border-radius: 5px;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
}

witness-skin .w-menu-item .w-icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: -2px;
}

witness-skin .w-menu-item[data-highlighted] {
  background: var(--witness-wash);
}

witness-skin .w-menu-item:focus-visible {
  outline: 2px solid var(--witness-focus);
  outline-offset: -2px;
}

witness-skin .w-menu-item:is([data-availability="unavailable"], [data-availability="unsupported"]) {
  display: none;
}

witness-skin .w-menu-item[aria-disabled="true"] {
  color: var(--witness-ink-dim);
  cursor: not-allowed;
}

witness-skin .w-menu-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-inline-start: auto;
  padding-inline-start: 18px;
  color: var(--witness-second);
}

witness-skin .w-menu-hint > [data-part] {
  overflow: hidden;
  max-width: 8em;
  text-overflow: ellipsis;
}

witness-skin .w-menu-hint .w-icon {
  color: var(--witness-ink-dim);
}

witness-skin .w-menu-back {
  margin-bottom: 4px;
  border-radius: 5px 5px 0 0;
  box-shadow: 0 1px 0 var(--witness-line);
  color: var(--witness-ink-dim);
}

witness-skin .w-menu-back .w-icon {
  rotate: 180deg;
}

:is([dir="rtl"] witness-skin, witness-skin:dir(rtl)) .w-menu .w-menu-hint .w-icon {
  rotate: 180deg;
}

:is([dir="rtl"] witness-skin, witness-skin:dir(rtl)) .w-menu .w-menu-back .w-icon {
  rotate: none;
}

witness-skin .w-menu-option {
  justify-content: space-between;
}

witness-skin .w-menu-check {
  display: block;
  flex: none;
  margin-inline-start: auto;
  opacity: 0;
}

witness-skin .w-menu-option[aria-checked="true"] .w-menu-check {
  opacity: 1;
}

witness-skin .w-menu-tier,
witness-skin .w-menu-badge {
  color: var(--witness-ink-dim);
  font-size: 10px;
}

witness-skin .w-menu-tier {
  padding-inline-start: 3px;
}

witness-skin .w-menu-badge {
  padding: 3px 5px 1px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--witness-line);
}

/* ------------------------------------------------------------------ 9. Feedback */

witness-skin .w-hunt {
  position: absolute;
  inset: 0 0 var(--w-band);
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--witness-calm) ease-out;
}

witness-skin .w-hunt[data-visible] {
  opacity: 1;
}

witness-skin .w-hunt-ring {
  display: block;
  width: 64px;
  height: 64px;
  padding: 8px;
  border-radius: 50%;
  background: var(--witness-veil);
  box-shadow: 0 0 0 1px var(--witness-veil-edge);
}

/* It turns one tick at a time, like a ring finding its detent. */
witness-skin .w-hunt[data-visible] .w-hunt-ring {
  animation: witness-hunt 1.44s steps(24) infinite;
}

@keyframes witness-hunt {
  to {
    rotate: 1turn;
  }
}

/* What a key press or a double tap just did, shown where the eye already is. */
witness-skin .w-indicators {
  position: absolute;
  inset: 0 0 var(--w-band);
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px;
  /* Left is back and right is forward in every language, as with the gestures that put these here. */
  direction: ltr;
  pointer-events: none;
}

witness-skin .w-indicator {
  display: flex;
  grid-area: 1 / 2;
  align-items: center;
  align-self: start;
  justify-self: center;
  gap: 8px;
  min-height: 36px;
  padding: 2px 13px 0;
  border-radius: 18px;
  background: var(--witness-veil);
  box-shadow: 0 0 0 1px var(--witness-veil-edge);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition:
    opacity var(--witness-calm) ease-out,
    transform var(--witness-calm) var(--witness-ease);
}

witness-skin .w-indicator[data-starting-style] {
  opacity: 0;
  transform: translateY(-4px);
}

/* It arrives with a small move and leaves with none, and sooner. */
witness-skin .w-indicator[data-ending-style] {
  opacity: 0;
  transition-duration: var(--witness-quick);
}

witness-skin .w-indicator .w-icon {
  display: none;
  margin-top: -2px;
}

witness-skin .w-indicator-fill {
  display: flex;
  align-items: center;
  gap: 8px;
}

witness-skin .w-indicator-volume[data-level="high"] [data-icon="volume-high"],
witness-skin .w-indicator-volume[data-level="low"] [data-icon="volume-low"],
witness-skin .w-indicator-volume[data-level="off"] [data-icon="volume-off"],
witness-skin .w-indicator-status[data-status="captions-on"] [data-icon="captions-on"],
witness-skin .w-indicator-status[data-status="captions-off"] [data-icon="captions-off"],
witness-skin .w-indicator-status[data-status="fullscreen"] [data-icon="fullscreen-enter"],
witness-skin .w-indicator-status[data-status="exit-fullscreen"] [data-icon="fullscreen-exit"],
witness-skin .w-indicator-status[data-status="pip"] [data-icon="pip-enter"],
witness-skin .w-indicator-status[data-status="exit-pip"] [data-icon="pip-exit"],
witness-skin .w-indicator-seek[data-direction] [data-icon="seek"] {
  display: block;
}

witness-skin .w-indicator-seek {
  align-self: center;
}

witness-skin .w-indicator-seek[data-direction="backward"] {
  grid-column: 1;
  flex-direction: row-reverse;
}

witness-skin .w-indicator-seek[data-direction="backward"] .w-icon {
  rotate: 180deg;
}

witness-skin .w-indicator-seek[data-direction="forward"] {
  grid-column: 3;
}

/* ------------------------------------------------------------------ 10. Error dialog */

witness-skin .w-dialog-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgb(0 0 0 / 0.74);
  transition: opacity var(--witness-calm) ease-out;
}

witness-skin .w-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(100% - 32px, 348px);
  max-height: calc(100% - 32px);
  padding: 20px;
  overflow: auto;
  border-radius: 10px;
  background: var(--witness-plate);
  box-shadow: var(--witness-shadow);
  transform: translate(-50%, -50%);
  transition:
    opacity var(--witness-calm) ease-out,
    transform var(--witness-calm) var(--witness-ease);
}

witness-skin .w-dialog-backdrop:not([data-open]),
witness-skin .w-dialog:not([data-open]) {
  display: none;
}

witness-skin .w-dialog-backdrop:is([data-starting-style], [data-ending-style]) {
  opacity: 0;
}

witness-skin .w-dialog[data-starting-style] {
  opacity: 0;
  transform: translate(-50%, calc(-50% + 6px));
}

witness-skin .w-dialog[data-ending-style] {
  opacity: 0;
  transition-duration: var(--witness-quick);
}

witness-skin .w-dialog-backdrop[data-scope="document"],
witness-skin .w-dialog[data-scope="document"] {
  position: fixed;
}

witness-skin .w-dialog-title {
  display: block;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

witness-skin .w-dialog-text {
  display: block;
  color: var(--witness-ink-dim);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

witness-skin .w-dialog-close {
  display: grid;
  place-items: center;
  justify-self: end;
  min-width: 76px;
  height: 36px;
  margin-top: 6px;
  padding: 2px 16px 0;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--witness-ink-dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (hover: hover) {
  witness-skin .w-dialog-close:hover {
    background: var(--witness-wash);
  }
}

/* ------------------------------------------------------------------ 11. Sizes */

/*
 * The player is rarely the width of the viewport, so everything here answers to the container.
 *
 * The row is symmetric about the witness mark, so each step is set by the wider of its two sides:
 * width needed = 2 x widest side + readout + 2 x gutter. Every step below leaves that sum inside the player. The
 * sums are for a time of m:ss or mm:ss; a film with hours has more figures, so on the two smaller scales its time is
 * set a size smaller and still fits the same readout.
 *
 *   >= 560   play, mute, volume | readout | captions, settings, picture-in-picture, fullscreen     541
 *   >= 480   play, mute         | readout | captions, settings, fullscreen                         457
 *   >= 408   the same, on the smaller scale                                                        402
 *   >= 308   play, mute         | readout | settings, fullscreen (captions move into the menu)     307
 *   >= 240   elapsed time only, centred over the mark                                              224
 */
@container media-root (width < 560px) {
  witness-skin .w-volume,
  witness-skin .w-pip {
    display: none;
  }
}

@container media-root (width < 480px) {
  witness-skin > * {
    --w-ring: 34px;
    --w-row: 46px;
    --w-gutter: 3px;
    --w-readout: 18px;
    --w-front: clamp(56px, 18cqi, 84px);
  }

  witness-skin .w-inscription text,
  witness-skin .w-preview-chapter {
    display: none;
  }

  witness-skin .w-readout {
    min-width: 8.2em;
  }

  /* h:mm:ss, then hh:mm:ss: more figures in the same readout. */
  witness-skin .w-time-elapsed[data-places="5"] {
    font-size: 0.89em;
  }

  witness-skin .w-time-remaining[data-places="5"] {
    font-size: 0.64em;
  }

  witness-skin .w-time-elapsed[data-places="6"] {
    font-size: 0.78em;
  }

  witness-skin .w-time-remaining[data-places="6"] {
    font-size: 0.56em;
  }

  /* Captions, the play target and the way back cannot all share the foot of a small picture: the way back moves up. */
  witness-skin .w-return {
    top: calc(var(--w-band) - var(--witness-height, 180px) + 10px);
    bottom: auto;
    left: 10px;
  }

  /* The row is 46 px here: the ring sits one pixel closer so it is never cut by the player's edge. */
  witness-skin .w-row .w-button:focus-visible {
    outline-offset: 1px;
  }
}

@container media-root (width < 408px) {
  witness-skin .w-captions {
    display: none;
  }

  witness-skin .w-readout {
    min-width: 7.6em;
  }

  witness-skin .w-time-elapsed[data-places="5"] {
    font-size: 0.83em;
  }

  witness-skin .w-time-remaining[data-places="5"] {
    font-size: 0.6em;
  }

  witness-skin .w-time-elapsed[data-places="6"] {
    font-size: 0.72em;
  }

  witness-skin .w-time-remaining[data-places="6"] {
    font-size: 0.52em;
  }
}

@container media-root (width < 308px) {
  witness-skin .w-time-remaining,
  witness-skin .w-mark {
    display: none;
  }

  /* Elapsed time alone, centred over the mark. */
  witness-skin .w-readout {
    display: flex;
    justify-content: center;
    min-width: 0;
  }
}

@container media-root (width < 240px) {
  witness-skin .w-readout {
    display: none;
  }

  witness-skin .w-row {
    grid-template-columns: minmax(0, 1fr) 0 minmax(0, 1fr);
  }
}

@container media-root (width >= 1100px) {
  witness-skin > * {
    --w-ring: 52px;
    --w-row: 54px;
    --w-button: 44px;
    --w-icon: 22px;
    --w-gutter: 12px;
    --w-readout: 24px;
  }
}

@container media-root (width >= 1700px) {
  witness-skin > * {
    --w-ring: 62px;
    --w-row: 64px;
    --w-button: 52px;
    --w-icon: 26px;
    --w-gutter: 16px;
    --w-readout: 29px;
  }
}

/* ------------------------------------------------------------------ 12. Preferences */

@media (prefers-reduced-motion: reduce) {
  witness-skin {
    --witness-quick: 0ms;
    --witness-calm: 0ms;
    --witness-slow: 0ms;
  }

  witness-skin .w-inscription {
    transition: none;
  }

  /* The scale holds still and the mark travels, so the ring draws the mark's pointer itself. */
  witness-skin .w-band[data-still] .w-row::before {
    display: none;
  }

  witness-skin .w-front-play:hover .w-inscription {
    rotate: none;
  }

  witness-skin .w-hunt[data-visible] .w-hunt-ring {
    animation: none;
  }

  /* Nothing scales, slides or turns; things simply appear. */
  witness-skin .w-menu[data-starting-style],
  witness-skin .w-menu[data-ending-style],
  witness-skin .w-tooltip[data-starting-style],
  witness-skin .w-indicator[data-starting-style] {
    transform: none;
  }

  witness-skin .w-dialog[data-starting-style] {
    transform: translate(-50%, -50%);
  }

  witness-skin .w-menu-page {
    translate: none !important;
  }
}

/* Without backdrop blur the body leans closer to solid. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  witness-skin {
    --witness-body: rgb(10 10 11 / 0.94);
  }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  witness-skin {
    --witness-body: #0a0a0b;
    --witness-veil: #0a0a0b;
    --witness-veil-edge: rgb(244 241 234 / 0.5);
    --witness-ink-dim: rgb(244 241 234 / 0.82);
    --witness-line: rgb(244 241 234 / 0.4);
    --witness-rail: rgb(244 241 234 / 0.55);
    --witness-wash: rgb(244 241 234 / 0.22);
  }

  witness-skin .w-band,
  witness-skin .w-front-play,
  witness-skin .w-over,
  witness-skin .w-return-button {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* More contrast: unpainted marks come up to meet the painted ones; the rail still tells watched from not. */
@media (prefers-contrast: more) {
  witness-skin {
    --witness-bare: 0.8;
  }
}

@media (forced-colors: active) {
  witness-skin {
    --witness-body: Canvas;
    --witness-solid: Canvas;
    --witness-plate: Canvas;
    --witness-ink: CanvasText;
    --witness-ink-dim: CanvasText;
    --witness-second: CanvasText;
    --witness-mark: Highlight;
    --witness-line: CanvasText;
    --witness-rail: GrayText;
    --witness-wash: transparent;
    --witness-veil: Canvas;
    --witness-veil-edge: CanvasText;
    --witness-focus: Highlight;
    --witness-record-ink: Highlight;
    --witness-bare: 1;
  }

  /* An outline, not a border: Video.js measures these boxes, and a border would change their size. */
  witness-skin .w-band,
  witness-skin .w-menu,
  witness-skin .w-tooltip,
  witness-skin .w-dialog,
  witness-skin .w-indicator,
  witness-skin .w-plate,
  witness-skin .w-front-play,
  witness-skin .w-over,
  witness-skin .w-return-button,
  witness-skin .w-hunt-ring {
    outline: 1px solid CanvasText;
    outline-offset: -1px;
  }

  witness-skin .w-dialog-close {
    border: 1px solid ButtonText;
  }

  witness-skin .w-ring {
    background: Canvas;
  }

  witness-skin .w-overview-buffer,
  witness-skin .w-overview-record,
  witness-skin .w-overview-thumb,
  witness-skin .w-overview-return,
  witness-skin .w-volume-fill,
  witness-skin .w-volume-thumb,
  witness-skin .w-row::before {
    forced-color-adjust: none;
  }

  /* Rail, buffered, watched: three system colours, so none of them is lost. */
  witness-skin .w-overview-buffer {
    background: CanvasText;
  }

  witness-skin .w-volume-fill {
    background: Highlight;
  }

  witness-skin .w-button[aria-expanded="true"],
  witness-skin .w-menu-item[data-highlighted],
  witness-skin .w-menu-item[data-highlighted] * {
    forced-color-adjust: none;
    background-color: Highlight;
    color: HighlightText;
  }
}
