/*
 * Approved B result layout, scoped to the existing short-film workspace.
 * Business controls and API-driven state remain owned by merchant.html.
 */

#shortfilmView {
  --txb-bg: #050507;
  --txb-surface: #0c0d10;
  --txb-raised: #111319;
  --txb-ink: #edf1f5;
  --txb-muted: #9aa3ae;
  --txb-faint: #69717b;
  --txb-silver: #e8edf3;
  --txb-ice: #aac7ed;
  --txb-orange: #ff6b35;
  --txb-line: rgba(255, 255, 255, 0.09);
  --txb-line-strong: rgba(255, 255, 255, 0.18);
  --txb-ease: cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: 150px !important;
}

#shortfilmView .txb-shortfilm-workspace {
  display: block !important;
  width: 100%;
  min-width: 0;
}

#shortfilmView .txb-results-shell {
  overflow: hidden;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--txb-line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.014), transparent 35%),
    rgba(10, 11, 14, 0.92);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.28);
}

#shortfilmView .txb-shell-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--txb-line);
}

#shortfilmView .txb-shell-head h2 {
  margin: 0;
  color: #e4e9ee;
  font-size: 20px;
  font-weight: 380;
  letter-spacing: -0.025em;
}

#shortfilmView .txb-shell-head p {
  margin: 4px 0 0;
  color: #89929d;
  font-size: 10px;
}

#shortfilmView .txb-shell-note {
  color: #858e99;
  font-size: 10px;
  white-space: nowrap;
}

#shortfilmView .txb-results-list {
  display: grid;
  gap: 12px;
  padding: 0;
}

#shortfilmView .shortfilmGroup {
  position: relative;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  border-top: 1px solid var(--txb-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#shortfilmView .shortfilmGroup:first-child {
  border-top: 0 !important;
}

#shortfilmView .shortfilmGroupHead {
  display: flex !important;
  min-height: 56px;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 10px 18px !important;
  border: 0 !important;
  background: transparent !important;
}

#shortfilmView .shortfilmGroupHead > div:first-child {
  min-width: 0;
}

#shortfilmView .shortfilmGroupHead h2 {
  overflow: hidden;
  margin: 0 !important;
  color: #e4e9ee !important;
  font-size: 20px !important;
  font-weight: 380 !important;
  letter-spacing: -0.02em !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shortfilmView .shortfilmGroupHead p {
  overflow: hidden;
  max-width: min(62vw, 760px);
  margin: 4px 0 0 !important;
  color: #89929d !important;
  font-size: 10px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shortfilmView .shortfilmGroupMeta {
  display: flex !important;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
}

#shortfilmView .shortfilmGroupMeta > span {
  display: none !important;
}

#shortfilmView .txb-group-toolbar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

#shortfilmView .txb-view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--txb-line);
  border-radius: 9px;
  background: #08090b;
}

#shortfilmView .txb-view-switch button {
  min-width: 49px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #838b95;
  font-size: 10px;
}

#shortfilmView .txb-view-switch button:hover {
  color: var(--txb-ink);
}

#shortfilmView .txb-view-switch button[aria-pressed="true"] {
  background: var(--txb-silver);
  color: #08090c;
  font-weight: 650;
}

#shortfilmView .txb-view-counter {
  min-width: 42px;
  color: #aeb6c0;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

#shortfilmView .sfDownloadAll {
  min-height: 36px !important;
  padding: 0 11px !important;
  border: 1px solid var(--txb-line) !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #8c949e !important;
  font-size: 10px !important;
}

#shortfilmView .sfDownloadAll:hover {
  border-color: var(--txb-line-strong) !important;
  color: var(--txb-ink) !important;
}

#shortfilmView .txb-result-stage {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px 8px;
}

#shortfilmView .shortfilmGroup[data-b-view="all"] .txb-result-stage {
  grid-template-columns: minmax(0, 1fr);
}

#shortfilmView .txb-mobile-focus-controls {
  display: none;
}

#shortfilmView .txb-result-stage::before,
#shortfilmView .txb-result-stage::after {
  position: absolute;
  z-index: 0;
  top: 4%;
  bottom: 8%;
  width: clamp(120px, 18vw, 280px);
  background-position: center;
  background-size: cover;
  content: "";
  filter: blur(42px) saturate(0.72);
  opacity: 0;
  pointer-events: none;
}

#shortfilmView .txb-result-stage.has-prev::before {
  left: -26px;
  background-image:
    linear-gradient(90deg, rgba(5, 5, 7, 0.92), rgba(5, 5, 7, 0.32), transparent),
    var(--txb-prev-image, none);
  opacity: 0.2;
  -webkit-mask-image: linear-gradient(to right, #000 12%, rgba(0, 0, 0, 0.5) 58%, transparent 100%);
  mask-image: linear-gradient(to right, #000 12%, rgba(0, 0, 0, 0.5) 58%, transparent 100%);
}

#shortfilmView .txb-result-stage.has-next::after {
  right: -26px;
  background-image:
    linear-gradient(270deg, rgba(5, 5, 7, 0.92), rgba(5, 5, 7, 0.32), transparent),
    var(--txb-next-image, none);
  opacity: 0.2;
  -webkit-mask-image: linear-gradient(to left, #000 12%, rgba(0, 0, 0, 0.5) 58%, transparent 100%);
  mask-image: linear-gradient(to left, #000 12%, rgba(0, 0, 0, 0.5) 58%, transparent 100%);
}

#shortfilmView .txb-result-rail {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
}

#shortfilmView .shortfilmGrid {
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  gap: 11px !important;
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .txb-result-rail {
  width: min(100%, var(--txb-focus-window, 760px));
  margin-inline: auto;
  --txb-edge-safe: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, transparent var(--txb-edge-safe), #000 var(--txb-edge-fade, 80px), #000 calc(100% - var(--txb-edge-fade, 80px)), transparent calc(100% - var(--txb-edge-safe)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, transparent var(--txb-edge-safe), #000 var(--txb-edge-fade, 80px), #000 calc(100% - var(--txb-edge-fade, 80px)), transparent calc(100% - var(--txb-edge-safe)), transparent 100%);
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .txb-result-rail {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .txb-result-rail::-webkit-scrollbar {
  display: none;
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .shortfilmGrid {
  display: flex !important;
  width: max-content !important;
  min-width: 100% !important;
  grid-template-columns: none !important;
  grid-auto-flow: initial !important;
  align-items: flex-start;
  overflow: visible !important;
  overflow-y: hidden !important;
  padding: 8px calc((100% - var(--txb-focus-card, 300px)) / 2) 8px !important;
}

#shortfilmView .shortfilmGroup[data-layout="portrait"] {
  --txb-focus-card: 300px;
}

#shortfilmView .shortfilmGroup[data-layout="landscape"] {
  --txb-focus-card: 680px;
  --txb-focus-window: 100%;
  --txb-edge-safe: 72px;
  --txb-edge-fade: 140px;
}

#shortfilmView .shortfilmGroup[data-layout="mixed"] {
  --txb-focus-card: 300px;
  --txb-focus-window: 760px;
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .sfThumb {
  flex: 0 0 var(--txb-focus-card, 300px) !important;
  width: var(--txb-focus-card, 300px) !important;
  min-width: var(--txb-focus-card, 300px) !important;
  max-width: var(--txb-focus-card, 300px) !important;
  margin: 0 !important;
  scroll-snap-align: center;
  opacity: 0.7;
  transition: opacity 180ms var(--txb-ease), transform 180ms var(--txb-ease), filter 180ms var(--txb-ease);
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .sfThumb.selected {
  opacity: 1;
  transform: translateY(-1px);
}

#shortfilmView .shortfilmResult .sfResultMedia {
  position: relative;
  aspect-ratio: var(--txb-media-ratio, 9 / 16);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #030304;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

#shortfilmView .shortfilmResult .sfResultPoster,
#shortfilmView .shortfilmResult .playerPanel,
#shortfilmView .shortfilmResult video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .sfThumb:not(.selected) .sfResultMedia {
  border-color: transparent;
  box-shadow: none;
  filter: blur(1.15px) saturate(0.68) brightness(0.7);
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .sfThumb:not(.selected):hover .sfResultMedia {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  filter: blur(0.55px) saturate(0.84) brightness(0.86);
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .sfThumb:not(.selected) .sfResultFooter {
  opacity: 0.52;
}

#shortfilmView .shortfilmGroup[data-b-view="focus"] .sfThumb.selected .sfResultMedia {
  border-color: rgba(232, 237, 243, 0.44);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.42);
}

#shortfilmView .txb-card-index,
#shortfilmView .txb-card-state {
  position: absolute;
  z-index: 2;
  top: 8px;
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(5, 6, 8, 0.84);
  color: #eef2f5;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

#shortfilmView .txb-card-index {
  left: 8px;
  font-variant-numeric: tabular-nums;
}

#shortfilmView .txb-card-state {
  right: 8px;
  color: #c8d0d9;
}

#shortfilmView .sfThumb .coverPlay {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(8, 9, 12, 0.46);
  color: #fff;
  font-size: 14px;
  transform: translate(-50%, -50%);
}

#shortfilmView .sfThumb:not(.selected) .coverPlay {
  opacity: 0.42;
}

#shortfilmView .sfResultFooter {
  min-height: 0 !important;
  padding: 7px 1px 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#shortfilmView .sfResultStatus {
  overflow: hidden;
  color: #e6ebf0 !important;
  font-size: 12px !important;
  font-weight: 520 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shortfilmView .sfResultMeta {
  margin-top: 3px !important;
  color: #89929c !important;
  font-size: 9px !important;
}

#shortfilmView .shortfilmGroup[data-b-view="all"] .shortfilmGrid {
  display: grid !important;
  width: 100% !important;
  overflow: visible !important;
  grid-template-columns: repeat(var(--txb-grid-columns, 3), minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
}

#shortfilmView .shortfilmGroup[data-b-view="all"][data-layout="portrait"] .shortfilmGrid {
  grid-template-columns: repeat(var(--txb-count, 1), minmax(0, 1fr)) !important;
}

#shortfilmView .shortfilmGroup[data-b-view="all"][data-layout="landscape"][data-count="4"] .shortfilmGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

#shortfilmView .shortfilmGroup[data-b-view="all"][data-layout="landscape"][data-count="5"] .shortfilmGrid,
#shortfilmView .shortfilmGroup[data-b-view="all"][data-layout="landscape"][data-count="6"] .shortfilmGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#shortfilmView .shortfilmGroup[data-b-view="all"][data-layout="landscape"][data-count="5"] .sfThumb:nth-child(4) {
  grid-column: 2;
}

#shortfilmView .shortfilmGroup[data-b-view="all"] .sfThumb {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  opacity: 1;
}

#shortfilmView .sfBatchStage {
  display: flex !important;
  min-height: 46px !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 !important;
  padding: 6px 18px 12px !important;
  border: 0 !important;
  background: transparent !important;
}

#shortfilmView .sfBatchStage .sfStageMedia,
#shortfilmView .sfBatchStage .sfStageInfo {
  display: none !important;
}

#shortfilmView .sfBatchStage .sfStageBar {
  width: 100%;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#shortfilmView .sfBatchStage .sfStageActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

#shortfilmView .txb-action-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: #818a94;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shortfilmView .txb-stage-progress {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--txb-line);
  border-radius: 999px;
  color: #9aa3ae;
  font-size: 9px;
}

#shortfilmView .sfResultError {
  overflow: hidden;
  color: #ffb8be !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shortfilmView .sfBatchStage .sfCardButton {
  min-height: 34px !important;
  padding: 0 11px !important;
  border: 1px solid var(--txb-line) !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #a3acb6 !important;
  font-size: 10px !important;
}

#shortfilmView .sfBatchStage .sfCardButton.primary {
  border-color: var(--txb-silver) !important;
  background: var(--txb-silver) !important;
  color: #08090c !important;
}

#shortfilmView .txb-focus-arrow {
  position: relative !important;
  z-index: 4;
  display: grid !important;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px;
  min-height: 46px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #eef3f7;
  backdrop-filter: none;
}

#shortfilmView .txb-focus-arrow::before {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: inherit;
  background: rgba(12, 14, 18, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px) saturate(1.04);
  content: "";
}

#shortfilmView .txb-focus-arrow svg {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.15;
}

#shortfilmView .txb-focus-arrow:hover:not(:disabled) {
  transform: scale(1.03);
}

#shortfilmView .txb-focus-arrow:hover:not(:disabled)::before {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(22, 26, 33, 0.48);
}

#shortfilmView .txb-focus-arrow:active:not(:disabled) {
  transform: scale(0.96);
}

#shortfilmView .txb-focus-arrow:disabled {
  opacity: 0.28;
}

#shortfilmView .shortfilmGroup[data-b-view="all"] .txb-focus-arrow {
  display: none !important;
}

#shortfilmView .shortfilmGroup[data-count="1"] .txb-focus-arrow {
  display: none !important;
}

#shortfilmView .txb-empty {
  min-height: 420px;
}

/* Fixed composer */

#shortfilmForm.txb-composer {
  position: fixed !important;
  z-index: 86 !important;
  bottom: 12px !important;
  left: calc(50% + var(--tx-sidebar-width, 218px) / 2) !important;
  display: grid !important;
  width: min(1100px, calc(100vw - var(--tx-sidebar-width, 218px) - 64px)) !important;
  height: 78px;
  min-height: 78px !important;
  max-height: 78px;
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 9px 10px !important;
  overflow: visible !important;
  border: 1px solid rgba(255, 255, 255, 0.135) !important;
  border-radius: 16px !important;
  background: #0c0d11 !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55) !important;
  transform: translateX(-50%) !important;
  transition: height 180ms var(--txb-ease), max-height 180ms var(--txb-ease);
}

#shortfilmForm.txb-composer::before {
  position: absolute;
  top: -1px;
  right: 22%;
  left: 22%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.78), transparent);
  content: "";
  pointer-events: none;
}

#shortfilmForm.txb-composer > .tx22-composer-head {
  display: none !important;
}

#shortfilmForm.txb-composer > .sfUpload {
  display: none !important;
}

#shortfilmForm.txb-composer .txb-add-reference {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--txb-line);
  border-radius: 50%;
  background: transparent;
  color: #aab1ba;
}

#shortfilmForm.txb-composer .txb-add-reference:hover {
  border-color: var(--txb-line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--txb-ink);
}

#shortfilmForm.txb-composer .txb-add-reference svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

#shortfilmForm.txb-composer .txb-compose-field {
  display: grid;
  min-width: 0;
  gap: 4px;
}

#shortfilmForm.txb-composer .sfPromptWrap {
  display: block !important;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#shortfilmForm.txb-composer .sfPromptWrap > label,
#shortfilmForm.txb-composer .sfPromptMeta {
  display: none !important;
}

#shortfilmForm.txb-composer #shortfilmPrompt {
  display: block !important;
  width: 100% !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 4px 2px !important;
  resize: none;
  overflow: hidden;
  border: 0 !important;
  background: transparent !important;
  color: #e9edf2 !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  outline: 0 !important;
}

#shortfilmForm.txb-composer .txb-compose-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px 6px;
  overflow: hidden;
}

#shortfilmForm.txb-composer .txb-compose-meta span {
  color: #7d8590;
  font-size: 10px;
  white-space: nowrap;
}

#shortfilmForm.txb-composer .txb-compose-meta span + span::before {
  margin-right: 6px;
  color: #424852;
  content: "·";
}

#shortfilmForm.txb-composer .txb-settings-toggle {
  min-height: 24px;
  margin-left: auto;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #69717b;
  font-size: 9px;
}

#shortfilmForm.txb-composer .txb-generate {
  display: grid !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  place-items: center;
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--txb-silver) !important;
  color: #08090c !important;
  font-size: 0 !important;
  font-weight: 650;
}

#shortfilmForm.txb-composer .txb-generate::after {
  color: var(--txb-orange);
  font-size: 20px;
  line-height: 1;
  content: "↗";
}

#shortfilmForm.txb-composer.is-expanded {
  height: 132px;
  max-height: 132px;
  align-items: end !important;
}

#shortfilmForm.txb-composer.is-expanded #shortfilmPrompt {
  height: 78px !important;
  min-height: 78px !important;
  max-height: 78px !important;
  overflow-y: auto;
}

#shortfilmForm.txb-composer .txb-composer-settings {
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  left: 0;
  display: grid;
  max-height: min(55vh, 430px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--txb-line-strong);
  border-radius: 14px;
  background: #0d0e12;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

#shortfilmForm.txb-composer .txb-composer-settings[hidden] {
  display: none !important;
}

#shortfilmForm.txb-composer .sfModeBar,
#shortfilmForm.txb-composer .tx22-fieldset,
#shortfilmForm.txb-composer .sfToolRow,
#shortfilmForm.txb-composer .sfOptimize,
#shortfilmForm.txb-composer .tx22-multi-upload,
#shortfilmForm.txb-composer .sfSafety {
  min-width: 0;
  margin: 0 !important;
}

#shortfilmForm.txb-composer .sfModeBar {
  display: flex !important;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--txb-line) !important;
  border-radius: 9px !important;
  background: #08090b !important;
}

#shortfilmForm.txb-composer .sfModeBar button {
  flex: 1;
  min-height: 36px;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #838b95 !important;
  font-size: 10px !important;
}

#shortfilmForm.txb-composer .sfModeBar button[aria-pressed="true"] {
  background: var(--txb-silver) !important;
  color: #08090c !important;
}

#shortfilmForm.txb-composer .tx22-fieldset {
  padding: 0 !important;
  border: 0 !important;
}

#shortfilmForm.txb-composer .tx22-fieldset legend {
  margin-bottom: 6px;
  color: #89929d;
  font-size: 10px;
}

#shortfilmForm.txb-composer .sfSettingGroup {
  display: flex !important;
  gap: 4px !important;
}

#shortfilmForm.txb-composer .sfSettingGroup button {
  min-width: 38px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--txb-line) !important;
  border-radius: 7px !important;
  background: #090a0d !important;
  color: #8f98a3 !important;
  font-size: 10px !important;
}

#shortfilmForm.txb-composer .sfSettingGroup button[aria-pressed="true"] {
  border-color: var(--txb-line-strong) !important;
  background: var(--txb-silver) !important;
  color: #08090c !important;
}

#shortfilmForm.txb-composer .sfSettingGroup.sfCount {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#shortfilmForm.txb-composer .sfOptimize,
#shortfilmForm.txb-composer .tx22-multi-upload {
  min-height: 36px;
  border: 1px solid var(--txb-line) !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #9aa3ae !important;
  font-size: 10px !important;
}

#shortfilmForm.txb-composer .sfToolRow {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

#shortfilmForm.txb-composer .sfToolRow .sfChannel,
#shortfilmForm.txb-composer .sfToolRow .sfDuration,
#shortfilmForm.txb-composer .sfToolRow .sfCostBadge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--txb-line);
  border-radius: 7px;
  color: #89929d;
  font-size: 9px;
}

#shortfilmForm.txb-composer .sfToolRow .sfChannel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shortfilmForm.txb-composer .sfSafety {
  align-self: center;
  color: #69717b !important;
  font-size: 9px !important;
  line-height: 1.55;
}

#shortfilmForm.txb-composer #shortfilmReferenceGrid {
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  left: 0;
  grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
  max-height: 170px;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--txb-line-strong);
  border-radius: 12px;
  background: #0d0e12;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

#shortfilmForm.txb-composer #shortfilmReferenceGrid:not([hidden]) {
  display: grid;
}

#shortfilmForm.txb-composer .reference-slot {
  min-height: 92px;
}

#shortfilmForm.txb-composer .reference-slot img {
  max-height: 58px;
}

#shortfilmView .txb-mobile-nav {
  display: none;
}

@media (max-width: 1280px) and (min-width: 861px) {
  #shortfilmView {
    --txb-edge-fade: 80px;
  }
}

@media (min-width: 861px) and (max-height: 820px) {
  #shortfilmView .shortfilmGroup[data-layout="portrait"] {
    --txb-focus-card: 210px;
    --txb-focus-window: 590px;
  }

  #shortfilmView .shortfilmGroup[data-layout="landscape"] {
    --txb-focus-card: 640px;
  }
}

@media (max-width: 860px) {
  #shortfilmView {
    --txb-edge-fade: clamp(42px, 12vw, 68px);
    padding-bottom: calc(78px + 58px + 24px + env(safe-area-inset-bottom)) !important;
  }

  #shortfilmView .shortfilmHero {
    padding-bottom: 14px !important;
  }

  #shortfilmView .txb-shell-head {
    min-height: 54px;
    padding-inline: 11px;
  }

  #shortfilmView .txb-shell-head h2 {
    font-size: 18px;
  }

  #shortfilmView .txb-shell-head p,
  #shortfilmView .txb-shell-note {
    display: none;
  }

  #shortfilmView .shortfilmGroupHead {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px !important;
    padding: 10px 11px !important;
  }

  #shortfilmView .shortfilmGroupMeta {
    display: flex !important;
    justify-content: flex-start !important;
  }

  #shortfilmView .txb-group-toolbar {
    width: 100%;
    justify-content: space-between;
  }

  #shortfilmView .txb-view-switch {
    padding: 2px;
  }

  #shortfilmView .txb-view-switch button {
    min-width: 49px;
    min-height: 44px;
    padding: 0 7px;
    font-size: 10px;
  }

  #shortfilmView .txb-result-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 8px 4px 4px;
  }

  #shortfilmView .shortfilmGroup[data-b-view="all"] .txb-result-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  #shortfilmView .shortfilmGroup[data-b-view="focus"] .txb-focus-arrow {
    display: none !important;
  }

  #shortfilmView .shortfilmGroup[data-b-view="focus"] .txb-mobile-focus-controls {
    display: grid;
    min-height: 50px;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 1px 10px;
    border-bottom: 1px solid var(--txb-line);
  }

  #shortfilmView .shortfilmGroup[data-count="1"] .txb-mobile-focus-controls,
  #shortfilmView .shortfilmGroup[data-b-view="all"] .txb-mobile-focus-controls {
    display: none !important;
  }

  #shortfilmView .txb-mobile-focus-arrow {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #eef3f7;
  }

  #shortfilmView .txb-mobile-focus-arrow::before {
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: inherit;
    background: rgba(12, 14, 18, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px) saturate(1.04);
    content: "";
    pointer-events: none;
  }

  #shortfilmView .txb-mobile-focus-arrow:hover:not(:disabled)::before {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(22, 26, 33, 0.48);
  }

  #shortfilmView .txb-mobile-focus-arrow:active:not(:disabled) {
    transform: scale(0.96);
  }

  #shortfilmView .txb-mobile-focus-arrow:disabled {
    opacity: 0.28;
  }

  #shortfilmView .txb-mobile-focus-arrow svg {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.15;
  }

  #shortfilmView .txb-mobile-focus-counter {
    color: #939ca7;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    text-align: center;
  }

  #shortfilmView .shortfilmGroup[data-b-view="focus"] .txb-group-toolbar .txb-view-counter {
    display: none;
  }

  #shortfilmView .shortfilmGroup[data-layout="portrait"] {
    --txb-focus-card: clamp(184px, calc(100vw - 170px), 220px);
    --txb-focus-window: 100%;
    --txb-edge-safe: 0px;
    --txb-edge-fade: clamp(42px, 12vw, 68px);
  }

  #shortfilmView .shortfilmGroup[data-layout="landscape"] {
    --txb-focus-card: min(268px, calc(100vw - 104px));
    --txb-focus-window: 100%;
    --txb-edge-safe: 0px;
    --txb-edge-fade: clamp(42px, 12vw, 68px);
  }

  #shortfilmView .shortfilmGroup[data-layout="mixed"] {
    --txb-focus-card: clamp(184px, calc(100vw - 170px), 220px);
    --txb-focus-window: 100%;
    --txb-edge-safe: 0px;
    --txb-edge-fade: clamp(42px, 12vw, 68px);
  }

  #shortfilmView .shortfilmGroup[data-b-view="focus"] .shortfilmGrid {
    padding-inline: calc((100% - var(--txb-focus-card)) / 2) !important;
  }

  #shortfilmView .shortfilmGroup[data-b-view="all"] .shortfilmGrid {
    display: flex !important;
    width: max-content !important;
    min-width: 100% !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    padding: 2px 11px 8px !important;
    scroll-snap-type: x proximity;
  }

  #shortfilmView .shortfilmGroup[data-b-view="all"] .sfThumb {
    flex: 0 0 154px !important;
    width: 154px !important;
    min-width: 154px !important;
    max-width: 154px !important;
    scroll-snap-align: start;
  }

  #shortfilmView .shortfilmGroup[data-b-view="all"][data-layout="landscape"] .sfThumb {
    flex-basis: 220px !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
  }

  #shortfilmView .sfResultStatus {
    font-size: 11px !important;
  }

  #shortfilmView .sfBatchStage {
    padding: 4px 11px 10px !important;
  }

  #shortfilmView .sfBatchStage .sfStageActions {
    justify-content: flex-start;
  }

  #shortfilmForm.txb-composer {
    right: 8px !important;
    bottom: calc(58px + 8px + env(safe-area-inset-bottom)) !important;
    left: 8px !important;
    width: auto !important;
    height: 78px;
    min-height: 78px !important;
    max-height: 78px;
    transform: none !important;
  }

  #shortfilmForm.txb-composer .txb-composer-settings {
    grid-template-columns: 1fr;
    max-height: min(63vh, 470px);
  }

  #shortfilmForm.txb-composer #shortfilmReferenceGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  #shortfilmView .txb-mobile-nav {
    position: fixed;
    z-index: 90;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: calc(58px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--txb-line);
    background: rgba(6, 7, 9, 0.985);
  }

  #shortfilmView .txb-mobile-nav button {
    display: grid;
    min-height: 48px;
    place-items: center;
    gap: 3px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #727a84;
    font-size: 10px;
  }

  #shortfilmView .txb-mobile-nav button[aria-current="page"] {
    background: var(--txb-silver);
    color: #08090c;
    font-weight: 650;
  }

  #shortfilmView .txb-mobile-nav i {
    width: 6px;
    height: 6px;
    border: 1px solid currentColor;
    border-radius: 2px;
  }
}

@media (max-width: 360px) {
  #shortfilmForm.txb-composer {
    height: 74px;
    min-height: 74px !important;
    max-height: 74px;
    gap: 6px !important;
    padding: 7px !important;
  }

  #shortfilmForm.txb-composer .txb-compose-meta span:nth-child(3),
  #shortfilmForm.txb-composer .txb-compose-meta span:nth-child(5) {
    display: none;
  }

  #shortfilmView .shortfilmGroup[data-layout="portrait"],
  #shortfilmView .shortfilmGroup[data-layout="mixed"] {
    --txb-focus-card: 184px;
  }

  #shortfilmView .shortfilmGroup[data-layout="landscape"] {
    --txb-focus-card: min(216px, calc(100vw - 104px));
  }

  #shortfilmView .shortfilmGroup[data-b-view="all"] .sfThumb {
    flex-basis: 142px !important;
    width: 142px !important;
    min-width: 142px !important;
    max-width: 142px !important;
  }

  #shortfilmView .shortfilmGroup[data-b-view="all"][data-layout="landscape"] .sfThumb {
    flex-basis: 220px !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #shortfilmView *,
  #shortfilmView *::before,
  #shortfilmView *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/*
 * r19.8 short-film desktop overflow fix.
 * The entrance animation leaves a transform on #shortfilmView. That transform
 * makes the descendant position:fixed composer use #shortfilmView as its
 * containing block. The composer is already inside that workspace coordinate
 * system, so adding the sidebar offset again overflows the document.
 */
@media (min-width: 861px) {
  html body #shortfilmView #shortfilmForm.txb-composer {
    left: 50% !important;
  }
}
