:root {
  --sles-warm-accent: #78685a;
  --sles-warm-ink: #54473b;
  --sles-warm-surface: #f1ede8;
  --sles-warm-rule: #ddd7d0;
}

.sles-gallery__picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.sles-gallery__tab,
.sles-player__play,
.sles-player__jump,
.sles-player__select { font: inherit; }

.sles-gallery__tab {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 540;
  line-height: 1.4;
}
.sles-gallery__tab:hover { color: var(--ink); border-color: #b6aa9e; }
.sles-gallery__tab[aria-selected="true"] { color: var(--ink); border-color: #b6aa9e; background: var(--sles-warm-surface); font-weight: 650; }

.sles-gallery__picker.sles-gallery__picker--thumbnails {
  flex-wrap: nowrap;
  align-items: start;
  gap: 11px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  margin: 0 -4px 18px;
  scroll-padding-inline: 4px;
  scrollbar-width: thin;
}
.sles-gallery__picker--thumbnails .sles-gallery__tab {
  display: grid;
  flex-basis: 118px;
  gap: 6px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0 0 2px;
  background: none;
  text-align: left;
}
.sles-gallery__thumbnail {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 832 / 480;
  border-radius: 5px;
  object-fit: cover;
  background: var(--soft);
}
.sles-gallery__picker--thumbnails .sles-gallery__tab:hover .sles-gallery__thumbnail { outline: 1px solid var(--sles-warm-accent); outline-offset: 2px; }
.sles-gallery__picker--thumbnails .sles-gallery__tab[aria-selected="true"] .sles-gallery__thumbnail { outline: 2px solid var(--sles-warm-accent); outline-offset: 2px; }
.sles-gallery__picker--thumbnails .sles-gallery__tab:focus-visible { outline: none; }
.sles-gallery__picker--thumbnails .sles-gallery__tab:focus-visible .sles-gallery__thumbnail { outline: 2px solid var(--sles-warm-ink); outline-offset: 2px; }
.sles-gallery__picker--thumbnails .sles-gallery__tab:focus-visible .sles-gallery__thumbnail-label { text-decoration: underline; text-underline-offset: 2px; }
.sles-gallery__thumbnail-label { font-size: 12px; line-height: 1.28; overflow-wrap: anywhere; }

.sles-gallery__picker.sles-gallery__picker--numbered { gap: 7px; margin-bottom: 10px; }
.sles-gallery__picker--numbered .sles-gallery__tab {
  position: relative;
  flex-basis: 73px;
  aspect-ratio: 832 / 480;
  border-radius: 5px;
  padding: 0;
}
.sles-gallery__thumbnail-number {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding-inline: 3px;
  border-radius: 4px;
  color: #fff;
  background: rgb(36 28 22 / 80%);
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.sles-gallery__grouped-picker { display: grid; gap: 4px; width: fit-content; max-width: 100%; margin: 0 auto 10px; }
.sles-gallery__case-row {
  display: grid;
  grid-template-columns: 119px minmax(0, 1fr);
  align-items: center;
  column-gap: 7px;
  min-width: 0;
}
.sles-gallery__case-label {
  color: var(--sles-warm-ink);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.2;
  white-space: nowrap;
}
.sles-gallery__case-row .sles-gallery__picker.sles-gallery__case-rail {
  display: flex;
  margin: 0;
  min-width: 0;
  overflow-x: auto;
  padding: 4px;
}
.sles-gallery__case-rail .sles-gallery__tab { flex-basis: 64px; }
[data-sles-gallery="controlled"] .sles-gallery__picker.sles-gallery__picker--numbered {
  display: flex;
  flex-wrap: nowrap;
  justify-content: safe center;
  overflow-x: auto;
}
[data-sles-gallery="controlled"] .sles-gallery__tab { flex-basis: 64px; }
.qualitative-block .sles-gallery__picker.sles-gallery__picker--numbered {
  display: flex;
  justify-content: safe center;
  max-width: 720px;
  margin-inline: auto;
}

.sles-gallery__summary { margin-bottom: 13px; }
.sles-gallery__summary .sles-gallery__protocol { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0 0 4px; }
.sles-gallery__summary .sles-gallery__title { margin: 0 0 4px; font-size: 19px; font-weight: 640; line-height: 1.25; letter-spacing: -.022em; }
.sles-gallery__summary .sles-gallery__description,
.sles-gallery__note { color: var(--muted); font-size: 14px; line-height: 1.52; max-width: 70ch; }
.sles-gallery__note { margin: 8px auto 0; font-size: 12px; text-align: center; }
[data-sles-gallery] .sles-gallery__summary { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 8px; text-align: center; }
[data-sles-gallery] .sles-gallery__title { font-size: 16px; margin: 0; }
[data-sles-gallery] .sles-gallery__protocol { margin: 0; }
[data-sles-gallery] .sles-gallery__description { flex-basis: 100%; }
[data-sles-gallery="external"] .sles-gallery__summary,
[data-sles-gallery="controlled"] .sles-gallery__summary { margin-bottom: 4px; }
[data-sles-gallery="external"] .sles-gallery__title,
[data-sles-gallery="controlled"] .sles-gallery__title { font-size: 13px; font-weight: 620; }

.sles-player { min-width: 0; }
.sles-player__stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
.sles-player__stage[data-count="1"] { grid-template-columns: minmax(0, 460px); justify-content: center; }
.sles-player__stage[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sles-player--external .sles-player__stage {
  isolation: isolate;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 6px;
}
.sles-player--external .sles-player__stage::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / 3;
  border-radius: 7px;
  background: var(--sles-warm-surface);
}
.sles-player--external .sles-player__pane { position: relative; z-index: 1; padding: 6px; }
.sles-player--external .sles-player__pane[data-role="gt"] { grid-column: 1; grid-row: 1; }
.sles-player--external .sles-player__pane[data-role="full"] { grid-column: 1; grid-row: 2; }
.sles-player--external .sles-player__pane--method { grid-column: var(--method-column); grid-row: var(--method-row); }
.sles-player--controlled .sles-player__stage { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sles-player--interaction .sles-player__stage,
.sles-player--background .sles-player__stage,
.sles-player--multi .sles-player__stage { max-width: 720px; margin-inline: auto; }
@media (min-width: 681px) {
  :is(.sles-player--interaction, .sles-player--background, .sles-player--multi) .sles-player__stage:is([data-count="5"], [data-count="6"]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.sles-player__pane { display: flex; flex-direction: column; align-self: start; min-width: 0; margin: 0; }
.sles-player__pane[hidden], .sles-player__issue[hidden], .sles-player__status[hidden] { display: none; }
.sles-player__label { order: 1; margin-top: 4px; color: #504a44; font-size: 12px; font-weight: 520; line-height: 1.32; text-align: center; }
.sles-player__pane[data-role="full"] .sles-player__label { color: var(--ink); font-weight: 680; }
.sles-player__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 832 / 480;
  border-radius: 5px;
  background: var(--media);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 5%);
}
.sles-player__video { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sles-player__issue {
  display: grid;
  place-content: center;
  position: absolute;
  inset: 0;
  margin: 0;
  background: var(--media);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.sles-player__pane--missing .sles-player__media { background: #f4f2ef; box-shadow: none; }
.sles-player__missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.sles-player__missing--quiet { color: #8d8075; font-size: 16px; line-height: 1; }

.sles-player__controls {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  grid-template-areas: "play seek time";
  align-items: start;
  gap: 4px 11px;
  margin: 0 0 8px;
}
.sles-player__controls--jump {
  grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
  grid-template-areas: "play seek time jump";
}
:is(.sles-player--interaction, .sles-player--background, .sles-player--multi) .sles-player__controls {
  max-width: 720px;
  margin-inline: auto;
}
.sles-player__play, .sles-player__jump {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 0;
  padding: 0 2px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  line-height: 1.28;
  cursor: pointer;
}
.sles-player__play { grid-area: play; width: 30px; border-radius: 4px; color: var(--sles-warm-ink); }
.sles-player__play::before {
  content: "";
  width: 11px;
  height: 12px;
  background: currentColor;
  clip-path: polygon(12% 0, 100% 50%, 12% 100%);
}
.sles-player__play[data-playing="true"]::before {
  clip-path: none;
  background: linear-gradient(to right, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
}
.sles-player__play:hover { background: var(--sles-warm-surface); }
.sles-player__jump { grid-area: jump; color: var(--sles-warm-ink); }
.sles-player__jump:hover { text-decoration: underline; text-underline-offset: 3px; }
.sles-player__play:disabled { opacity: 0.55; cursor: default; }
.sles-player__time { grid-area: time; padding-top: 5px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.sles-player__timeline { grid-area: seek; position: relative; padding-top: 4px; }
.sles-player__segments {
  pointer-events: none;
  position: absolute;
  top: 13px;
  left: 6px;
  right: 6px;
  height: 2px;
  border-radius: 12px;
  background: linear-gradient(90deg,
    #cfc7be 0 var(--sles-observed-percent, 0%),
    var(--sles-warm-rule) var(--sles-observed-percent, 0%) 100%);
}
.sles-player__elapsed { display: block; height: 100%; border-radius: inherit; background: var(--sles-warm-accent); }
.sles-player__observed-marker, .sles-player__return-marker {
  position: absolute;
  top: -3px;
  display: block;
  height: 9px;
  width: 1px;
  background: var(--sles-warm-accent);
  transform: translateX(-50%);
}
.sles-player__return-marker {
  top: -2px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--sles-warm-accent);
  border-radius: 50%;
  background: #fff;
}
.sles-player__range {
  appearance: none;
  display: block;
  position: relative;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: pan-y;
}
.sles-player__range::-webkit-slider-runnable-track { background: transparent; height: 13px; }
.sles-player__range::-moz-range-track { background: transparent; height: 13px; }
.sles-player__range::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border: 1px solid var(--sles-warm-accent);
  border-radius: 50%;
  background: #fff;
}
.sles-player__range::-moz-range-thumb {
  box-sizing: border-box;
  width: 13px;
  height: 13px;
  border: 1px solid var(--sles-warm-accent);
  border-radius: 50%;
  background: #fff;
}
.sles-player__phases { margin: 3px 6px 2px; }
.sles-player__phase-strip { display: flex; height: 6px; border-radius: 2px; overflow: hidden; }
.sles-player__phase-block { flex-basis: 0; background: var(--sles-phase-color); }
.sles-player__phase-legend { display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 2px; margin-top: 4px; }
.sles-player__phase-name { display: inline-flex; align-items: center; gap: 4px; color: var(--sles-warm-ink); font-size: 10px; line-height: 1.2; white-space: nowrap; }
.sles-player__phase-name::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--sles-phase-color); }
.sles-player__phases [data-phase="input"] { --sles-phase-color: #ded8d1; }
.sles-player__phases [data-phase="pre-exit"],
.sles-player__phases [data-phase="generated"] { --sles-phase-color: #c5b7a7; }
.sles-player__phases [data-phase="absent"] { --sles-phase-color: #a18d78; }
.sles-player__phases [data-phase="re-entry"] { --sles-phase-color: #6a5644; }
.sles-player__phase-name.sles-player__gt-return-key::before { border-radius: 50%; }
.sles-player__gt-lanes { display: grid; gap: 2px; margin-top: 7px; }
.sles-player__gt-lane { display: grid; }
.sles-player__gt-name { color: var(--sles-warm-ink); font-size: 10px; line-height: 1.15; }
.sles-player__gt-track { position: relative; min-height: 18px; }
.sles-player__gt-track::before,
.sles-player__gt-absent { position: absolute; top: 7px; height: 4px; border-radius: 2px; }
.sles-player__gt-track::before { content: ""; inset-inline: 0; background: var(--sles-warm-rule); }
.sles-player__gt-absent { background: #a18d78; }
.sles-player__gt-return {
  position: absolute; top: 0; display: grid; place-items: center;
  width: 24px; height: 18px; transform: translateX(-50%);
  padding: 0; border: 0; background: transparent; color: #6a5644; cursor: pointer;
}
.sles-player__gt-return::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sles-player__gt-return:hover::before, .sles-player__gt-return:focus-visible::before { box-shadow: 0 0 0 2px #ded8d1; }
.sles-player__phases:empty { display: none; }
.sles-player__mobile { display: none; }
.sles-player__status { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

@media (min-width: 1000px) {
  .sles-gallery__picker.sles-gallery__picker--thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    overflow: visible;
  }
  .sles-gallery__picker.sles-gallery__picker--numbered { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
}
@media (max-width: 680px) {
  .sles-gallery__picker {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 0 14px;
    padding: 4px 3px 6px;
    scrollbar-width: thin;
  }
  .sles-gallery__picker--thumbnails .sles-gallery__tab { flex-basis: 99px; }
  .sles-gallery__picker--numbered .sles-gallery__tab { flex-basis: 68px; }
  .sles-gallery__case-row { grid-template-columns: 92px minmax(0, 1fr); column-gap: 3px; }
  .sles-gallery__case-label { font-size: 11px; }
  .sles-gallery__case-rail .sles-gallery__tab { flex-basis: 60px; }
  [data-sles-gallery="controlled"] .sles-gallery__tab { flex-basis: 60px; }
  .sles-player__stage { gap: 10px 7px; }
  .sles-player__stage[data-count="3"],
  .sles-player--controlled .sles-player__stage,
  .sles-player--external .sles-player__stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sles-player--external .sles-player__stage::before { grid-column: 1 / 3; grid-row: 1; }
  .sles-player--external .sles-player__pane[data-role="full"] { grid-column: 2; grid-row: 1; }
  .sles-player--external .sles-player__pane--method { grid-column: auto; grid-row: auto; }
  .sles-player__label { font-size: 11px; }
  .sles-player__controls { gap: 2px 7px; }
  .sles-player__phase-legend { column-gap: 8px; }
  .sles-player__phase-name { font-size: 10px; }
  .sles-player__time { justify-self: start; }
  .sles-player__jump { justify-self: end; text-align: right; }
  .sles-player--mobile-choice .sles-player__mobile { display: flex; justify-content: center; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
  .sles-player__select { min-width: 0; padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); }
}
@media (max-width: 290px) {
  .sles-player--external .sles-player__stage { grid-template-columns: minmax(0, 1fr); }
  .sles-player--external .sles-player__stage::before { grid-column: 1; grid-row: 1 / 3; }
  .sles-player--external .sles-player__pane[data-role="full"] { grid-column: 1; grid-row: 2; }
}
