.ratings-row {
  display: inline-flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  margin: 0 0 10px;
  padding: 2px 0 8px;
}

.source-rating {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 48px;
}

.source-rating b {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  transition: color .15s;
}

.source-rating > span {
  font-size: 18px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -.5px;
}

.source-rating small {
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
  margin-left: 2px;
  letter-spacing: 0;
}

.source-rating.unavailable > span {
  color: #4a4a52;
}

.source-rating:hover b {
  color: var(--accent);
}

.lb-dots {
  display: inline-flex;
  gap: 2px;
}

.lb-dots i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #dc9b57;
}

.lb-dots i:nth-child(2) {
  background: #8da67b;
}

.lb-dots i:nth-child(3) {
  background: #7f9ca8;
}

.featured .ratings-row {
  margin-bottom: 0;
  gap: 24px;
}

.featured .source-rating b {
  font-size: 8px;
}

.featured .source-rating > span {
  font-size: 16px;
}

.skip-actions {
  position: absolute;
  right: 35px;
  bottom: 150px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  z-index: 10;
}

.skip-actions .button {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(255, 45, 85, 0.45);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 9px;
  min-height: 44px;
  touch-action: manipulation;
  transition: background .18s, transform .18s, box-shadow .18s;
}

.skip-actions .button:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 25px rgba(255, 45, 85, 0.6);
  transform: translateY(-1px);
}

.skip-actions .button.ghost {
  background: rgba(24, 24, 28, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #eeeeee;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.skip-actions .button.ghost:hover {
  background: rgba(35, 35, 42, 0.95);
  border-color: rgba(255, 45, 85, 0.4);
  color: #ffffff;
}

.marker-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  line-height: 1.7;
  font-size: 12px;
  cursor: pointer;
}

.checkbox-label > input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.marker-help {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.8;
}

@media(max-width:600px) {
  .ratings-row {
    gap: 14px;
    margin-bottom: 4px;
  }
  .source-rating {
    min-width: 38px;
  }
  .source-rating b {
    font-size: 7px;
    gap: 3px;
  }
  .source-rating > span {
    font-size: 15px;
  }
  .source-rating small {
    font-size: 8px;
  }
  .lb-dots i {
    width: 4px;
    height: 4px;
  }
  .skip-actions {
    right: 15px;
    left: 15px;
    bottom: 155px;
    gap: 8px;
  }
  .skip-actions .button {
    font-size: 11px;
    padding: 10px 14px;
    min-height: 40px;
  }
  .marker-inputs {
    gap: 12px;
  }
}

.poster img {
  position: relative;
}

.modal.over-player {
  z-index: 75;
}

.subtitle-result {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.subtitle-result > div {
  flex: 1;
  min-width: 0;
}

.subtitle-result strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.subtitle-result small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

#subtitle-search-error {
  margin-top: 18px;
}

.player-options #quality-select {
  max-width: 215px;
}

@media(max-width:600px) {
  .player-options #quality-select {
    max-width: 125px;
  }
}

.episode-caption {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 5px 0 18px;
}

.season-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
}

.season-toolbar h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.season-toolbar select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 11px;
}

.episode-copy {
  min-width: 0;
}

.episode-copy strong {
  font-weight: 550;
  font-size: 13px;
}

.episode-copy small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
  margin-top: 5px;
  max-width: 520px;
  color: var(--muted);
}

.episode-button {
  min-height: 64px;
}

.episode-button.has-image {
  grid-template-columns: 96px 70px 1fr 50px 18px;
}

.episode-thumb {
  display: block;
  width: 96px;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.episode-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media(max-width:600px) {
  .episode-button.has-image {
    grid-template-columns: 54px 48px 1fr 35px 15px;
    gap: 8px;
  }
  .episode-thumb {
    width: 54px;
  }
  .episode-copy strong {
    font-size: 11px;
  }
  .episode-copy small {
    font-size: 9px;
  }
}

.library-avatar {
  display: block;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid rgba(255, 45, 85, 0.25);
}

.nav-item .library-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.tile-icon .library-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.settings-library {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.settings-library-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 13px;
}

.settings-library-heading strong {
  flex: 1;
  font-size: 14px;
  font-weight: 550;
}

.library-paths {
  padding-left: 42px;
  margin-bottom: 8px;
}

.library-path {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 35px;
}

.library-path code {
  flex: 1;
  overflow-wrap: anywhere;
  font-size: 11px;
  color: var(--muted);
}

.settings-library > .button {
  margin-left: 42px;
}

.folder-browser-heading {
  display: flex;
  gap: 12px;
  align-items: center;
}

.folder-browser-heading code {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.folder-browser-list {
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
  margin: 12px 0;
}

.folder-browser-list button {
  text-align: left;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
  font-size: 12px;
  transition: background .15s, border-color .15s;
}

.folder-browser-list button:hover,
.folder-browser-list button:focus-visible {
  background: var(--surface-hover);
  border-color: rgba(255, 45, 85, 0.3);
}

.skip-actions .button {
  min-height: 44px;
  touch-action: manipulation;
}

body.has-inline-fullscreen,
html.has-inline-fullscreen {
  overflow: hidden !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
  scrollbar-width: none !important;
}
body.has-inline-fullscreen::-webkit-scrollbar,
html.has-inline-fullscreen::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

#player.inline-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  width: 100% !important;
  height: 100dvh !important;
  height: 100vh !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 999999 !important;
  background: #000 !important;
}

#player.inline-fullscreen video {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
}

#player:fullscreen,
#player:-webkit-full-screen,
#player:-moz-full-screen,
#player:-ms-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  background: #000 !important;
}

#player:fullscreen video,
#player:-webkit-full-screen video,
#player:-moz-full-screen video,
#player:-ms-fullscreen video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.sort-select {
  max-width: 200px;
}

.cast-grid {
  row-gap: 20px;
}

.player[aria-busy='true']::after {
  content: '';
  position: absolute;
  left: calc(50% - 14px);
  top: calc(50% - 14px);
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: flex-loading .75s linear infinite;
  pointer-events: none;
  box-shadow: 0 0 14px var(--accent-glow);
}

@keyframes flex-loading {
  to {
    transform: rotate(360deg);
  }
}

/* Seek preview thumbnail UI */
.time-row {
  position: relative;
  contain: layout paint;
}

.time-row input {
  touch-action: manipulation;
}

.seek-preview {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translateX(-50%) translateY(4px) translateZ(0);
  -webkit-transform: translateX(-50%) translateY(4px) translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 65;
  opacity: 0;
  transition: opacity .18s cubic-bezier(0.16, 1, 0.3, 1), transform .18s cubic-bezier(0.16, 1, 0.3, 1);
}

.seek-preview.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) translateZ(0);
  -webkit-transform: translateX(-50%) translateY(0) translateZ(0);
}

.seek-preview-card {
  position: relative;
  background: rgba(17, 17, 21, 0.95);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 45, 85, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.seek-preview-card::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(17, 17, 21, 0.95);
}

.seek-preview-thumb {
  width: 160px;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 8px;
  background: #141418;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.seek-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.seek-preview-time {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 45, 85, 0.2);
  border: 1px solid rgba(255, 45, 85, 0.4);
  border-radius: 5px;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}

@media(max-width:600px) {
  .seek-preview {
    bottom: calc(100% + 10px);
  }
  .seek-preview-thumb {
    width: 120px;
  }
}

/* Play prompt and loader overlay */
.player-play-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 55;
  pointer-events: auto;
}

.player-center-play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(255, 45, 85, 0.55), 0 0 0 4px rgba(255, 45, 85, 0.2);
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1), background .2s, box-shadow .2s;
  cursor: pointer;
  border: none;
}

.player-center-play:hover {
  background: var(--accent-hover);
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(255, 45, 85, 0.7), 0 0 0 6px rgba(255, 45, 85, 0.3);
}

.player-center-play svg {
  width: 32px;
  height: 32px;
  margin-left: 3px;
}

.player-play-label {
  font-size: 13px;
  font-weight: 600;
  color: #f5f5f7;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  letter-spacing: .3px;
}

.player-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 55;
  padding: 24px 32px;
  background: rgba(17, 17, 21, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.player-spinner-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-spinner {
  width: 54px;
  height: 54px;
  transform: rotate(-90deg);
  transform-origin: 27px 27px;
}

.spinner-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 4;
}

.spinner-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
  transform-origin: 27px 27px;
  filter: drop-shadow(0 0 6px rgba(255, 45, 85, 0.5));
  transition: stroke-dashoffset 0.25s ease;
}

.spinner-ring.indeterminate {
  animation: spinner-dash 1.4s ease-in-out infinite, spinner-spin 2s linear infinite;
}

@keyframes spinner-dash {
  0% { stroke-dashoffset: 130; }
  50% { stroke-dashoffset: 35; }
  100% { stroke-dashoffset: 130; }
}

@keyframes spinner-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.player-loader-pct {
  position: absolute;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.player-loader-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -.2px;
}

.player-loader-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Access settings UI */
.access-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.access-intro h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -.3px;
}

.access-intro p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.access-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.access-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .18s, box-shadow .18s;
}

.access-card:hover {
  border-color: rgba(255, 45, 85, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.access-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.access-card-lead {
  display: flex;
  align-items: center;
  gap: 12px;
}

.access-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 45, 85, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 45, 85, 0.2);
}

.access-card-icon svg {
  width: 18px;
  height: 18px;
}

.access-card-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
}

.access-card-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 550;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid var(--line);
}

.access-badge.online {
  background: rgba(48, 209, 88, 0.12);
  color: #30d158;
  border-color: rgba(48, 209, 88, 0.3);
}

.access-badge.offline {
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
  border-color: rgba(255, 69, 58, 0.3);
}

.access-connection {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
}

.access-url-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 14px;
}

.access-url-text {
  font-size: 12px;
  color: var(--text);
  overflow-wrap: anywhere;
  flex: 1;
  font-family: inherit;
}

.access-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.access-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 7px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: all .15s;
}

.access-btn:hover {
  background: rgba(255, 45, 85, 0.12);
  border-color: rgba(255, 45, 85, 0.35);
  color: #ffffff;
}

.access-btn svg {
  width: 14px;
  height: 14px;
}

.access-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 45, 85, 0.06);
  border: 1px solid rgba(255, 45, 85, 0.18);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 8px;
}

.access-tip-sparkle {
  color: var(--accent);
  margin-top: 1px;
}

.access-tip-text h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.access-tip-text p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

.access-empty, .access-subnote {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0;
}

.access-offline-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
}

.access-offline-box p {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.access-offline-box small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

/* ==========================================================================
   UNIFIED 3-IN-1 SUBTITLE SYSTEM (TRACKS, ONLINE SEARCH, CUSTOMIZATION & SYNC)
   Apple Dark Mode Aesthetic · Desktop, Mobile & Smart TV Universal Compatibility
   ========================================================================== */

#subtitles-btn {
  position: relative;
}

#subtitles-btn.has-subtitle {
  color: #ffffff;
}

.subtitles-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 14px;
  height: 12px;
  padding: 0 3px;
  font-size: 8px;
  font-weight: 750;
  line-height: 12px;
  border-radius: 3px;
  background: var(--accent);
  color: #ffffff;
  letter-spacing: 0.2px;
  text-align: center;
  box-shadow: 0 0 6px rgba(255, 45, 85, 0.7);
  pointer-events: none;
}

/* Subtitle Menu Drawer / Popover - Default (Out of fullscreen / Windowed mode) */
#subtitle-menu,
#subtitle-menu.subtitle-sheet {
  position: absolute;
  top: auto;
  left: auto;
  right: clamp(16px, 2.5vw, 32px);
  bottom: clamp(76px, 10vh, 96px);
  width: min(440px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  max-height: min(560px, calc(100% - 110px));
  z-index: 100;
  background: rgba(18, 18, 24, 0.95);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.82), 0 0 1px rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #ffffff;
  pointer-events: auto;
  user-select: none;
  will-change: transform, opacity;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  animation: subMenuFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes subMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
  }
}

#subtitle-menu.subtitle-sheet[hidden] {
  display: none !important;
}

/* Header */
.sub-sheet-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.sub-sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sub-sheet-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sub-sheet-icon svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.sub-sheet-title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.2px;
  color: #ffffff;
}

.sub-active-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(48, 209, 88, 0.16);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.sub-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-sheet-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Tabs */
.sub-sheet-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sub-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 6px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--muted);
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sub-tab-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sub-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.sub-tab-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-weight: 600;
}

/* Body */
.sub-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sub-sheet-body::-webkit-scrollbar {
  width: 6px;
}

.sub-sheet-body::-webkit-scrollbar-track {
  background: transparent;
}

.sub-sheet-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.sub-sheet-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

.sub-tab-pane[hidden] {
  display: none !important;
}

/* Section A: Tracks List */
.sub-tracks-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-section-divider {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 12px 0 4px;
  padding-left: 2px;
}

.sub-section-divider:first-child {
  margin-top: 0;
}

.sub-track-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.sub-track-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.sub-track-card.selected {
  background: rgba(255, 45, 85, 0.14);
  border-color: rgba(255, 45, 85, 0.45);
}

.sub-track-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.sub-track-card.selected .sub-track-radio {
  border-color: var(--accent);
  background: var(--accent);
}

.sub-radio-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.sub-track-details {
  flex: 1;
  min-width: 0;
}

.sub-track-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-track-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-track-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.sub-track-badge.sync-perfect {
  background: rgba(48, 209, 88, 0.16);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.sub-track-badge.online {
  background: rgba(10, 132, 255, 0.16);
  color: #0a84ff;
  border: 1px solid rgba(10, 132, 255, 0.3);
}

.sub-track-badge.local {
  background: rgba(255, 159, 10, 0.16);
  color: #ff9f0a;
  border: 1px solid rgba(255, 159, 10, 0.3);
}

.sub-track-badge.active-indicator {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 6px rgba(255, 45, 85, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sub-track-badge.active-indicator svg {
  width: 11px;
  height: 11px;
}

.sub-tracks-search-more {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-tracks-search-more svg {
  width: 14px;
  height: 14px;
}

.sub-tracks-search-more:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Section B: Online Search */
.sub-search-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sub-quick-languages {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-quick-label {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.sub-quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sub-lang-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-lang-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sub-lang-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.4);
}

.sub-search-bar {
  display: flex;
  gap: 8px;
}

#sub-search-input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #ffffff;
  font-size: 12.5px;
  outline: none;
  transition: all 0.2s ease;
}

#sub-search-input:focus,
#sub-search-input:focus-visible {
  border-color: var(--accent) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  outline: 2px solid var(--accent) !important;
  outline-offset: 1px !important;
}

#sub-search-btn {
  flex-shrink: 0;
  height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-search-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.sub-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.sub-result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sub-result-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.sub-result-info {
  flex: 1;
  min-width: 0;
}

.sub-result-title {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-result-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-badge-imported {
  background: rgba(48, 209, 88, 0.15);
  color: #30d158;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
}

.sub-import-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12px;
}

/* Section C: Customization & Sync */
.sub-custom-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Live Preview Card */
.sub-preview-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 12px 14px;
  overflow: hidden;
}

.sub-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.sub-preview-title {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.sub-preview-hint {
  font-size: 10px;
  color: var(--muted);
}

.sub-preview-stage {
  position: relative;
  width: 100%;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #161622 0%, #0b0b12 100%);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
}

.sub-preview-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background: radial-gradient(circle at 50% 30%, rgba(255, 45, 85, 0.25), transparent 70%);
}

.sub-preview-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.sub-preview-cue {
  font-family: var(--sub-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif);
  font-size: var(--sub-font-size, clamp(14px, 2.2vw, 21px));
  color: var(--sub-color, #ffffff);
  background-color: var(--sub-bg-color, transparent);
  text-shadow: var(--sub-text-shadow, 0 1px 2px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 0, 0, 0.65));
  font-weight: 550;
  line-height: 1.4;
  padding: 4px 10px;
  border-radius: 4px;
  text-align: center;
  max-width: 90%;
  transition: all 0.15s ease;
  user-select: none;
}

/* Custom Groups */
.sub-custom-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sub-group-label {
  font-size: 11.5px;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sub-group-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

/* Segmented Controls */
.sub-segmented-control {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sub-segment-btn {
  padding: 7px 6px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--muted);
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-segment-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.sub-segment-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Color Buttons */
.sub-color-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sub-color-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-color-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sub-color-btn.active {
  border-color: var(--accent);
  background: rgba(255, 45, 85, 0.14);
}

.sub-color-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

/* Sync Offset Row */
.sub-offset-btn-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.sub-pill-btn {
  padding: 8px 2px;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-pill-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.sub-pill-btn.active {
  background: rgba(255, 45, 85, 0.2);
  border-color: var(--accent);
}

.sub-offset-pill-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-offset-pill {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 9px;
  border-radius: 10px;
  background: rgba(255, 45, 85, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 45, 85, 0.4);
}

.sub-reset-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
}

.sub-reset-link:hover {
  color: #ffffff;
}

/* ==========================================================================
   SMART TV & UNIVERSAL ACCESSIBILITY FOCUS RING (#ff2d55)
   ========================================================================== */
.focusable:focus,
.focusable:focus-visible,
.tv-focusable:focus,
.tv-focusable:focus-visible {
  outline: 3px solid var(--accent) !important;
  outline-offset: 2px !important;
}

.subtitle-panel:not(#subtitle-menu) {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.subtitle-panel:not(#subtitle-menu)[hidden] {
  display: none !important;
}
.subtitle-panel-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}
.subtitle-panel-card {
  position: relative;
  z-index: 1;
  background: #1a1a1f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: min(600px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
}
.subtitle-offset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.offset-btn {
  padding: 6px 12px;
}
.subtitle-offset-val {
  font-weight: bold;
  font-size: 16px;
  min-width: 50px;
}
.subtitle-lang-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
.lang-tab {
  padding: 6px 12px;
}
.subtitle-track-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: inherit;
  margin-bottom: 6px;
  cursor: pointer;
  text-align: left;
}
.subtitle-track-btn.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

/* ==========================================================================
   SUBTITLE MENU RESPONSIVE FRAMING & PROPORTIONS
   ========================================================================== */

/* 1. When IN fullscreen (standard W3C, iOS fullscreen, inline-fullscreen):
   Docked elegantly on bottom-right on Desktop / TV with optimal breathing room */
:fullscreen #subtitle-menu.subtitle-sheet,
:-webkit-full-screen #subtitle-menu.subtitle-sheet,
:-moz-full-screen #subtitle-menu.subtitle-sheet,
:-ms-fullscreen #subtitle-menu.subtitle-sheet,
#player.inline-fullscreen #subtitle-menu.subtitle-sheet,
#player.is-fullscreen #subtitle-menu.subtitle-sheet,
body.player-is-fullscreen #subtitle-menu.subtitle-sheet {
  top: auto;
  left: auto;
  right: max(32px, env(safe-area-inset-right, 32px));
  bottom: max(96px, calc(72px + env(safe-area-inset-bottom, 24px)));
  width: min(440px, calc(100% - 48px));
  max-width: calc(100% - 48px);
  max-height: min(600px, calc(100% - 120px));
}

/* 2. On Mobile (screen width < 768px or touch devices):
   Convert smoothly to a bottom sheet anchored to the lower viewport */
@media (max-width: 768px) {
  #subtitle-menu.subtitle-sheet,
  :fullscreen #subtitle-menu.subtitle-sheet,
  :-webkit-full-screen #subtitle-menu.subtitle-sheet,
  :-moz-full-screen #subtitle-menu.subtitle-sheet,
  #player.inline-fullscreen #subtitle-menu.subtitle-sheet,
  #player.is-fullscreen #subtitle-menu.subtitle-sheet,
  body.player-is-fullscreen #subtitle-menu.subtitle-sheet {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    max-height: min(80dvh, 80vh);
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.85);
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }

  #subtitle-menu.subtitle-sheet::before {
    content: '';
    display: block;
    width: 38px;
    height: 4px;
    margin: 8px auto 2px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    flex-shrink: 0;
  }

  .sub-offset-btn-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .sub-segmented-control {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 3. In landscape mobile:
   Position with safe area insets (notches, dynamic island, home indicator)
   docked cleanly on the right so the video stream remains visible on the left */
@media (max-width: 950px) and (orientation: landscape) and (max-height: 520px) {
  #subtitle-menu.subtitle-sheet,
  :fullscreen #subtitle-menu.subtitle-sheet,
  :-webkit-full-screen #subtitle-menu.subtitle-sheet,
  :-moz-full-screen #subtitle-menu.subtitle-sheet,
  #player.inline-fullscreen #subtitle-menu.subtitle-sheet,
  #player.is-fullscreen #subtitle-menu.subtitle-sheet,
  body.player-is-fullscreen #subtitle-menu.subtitle-sheet {
    position: absolute;
    top: auto;
    left: auto;
    right: max(16px, env(safe-area-inset-right, 16px));
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    inset: auto;
    top: auto;
    right: max(16px, env(safe-area-inset-right, 16px));
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    width: min(420px, calc(100vw - env(safe-area-inset-right, 16px) - env(safe-area-inset-left, 16px) - 28px));
    max-width: calc(100vw - 32px);
    max-height: min(92dvh, calc(100% - 24px));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
    padding-bottom: 0;
  }

  #subtitle-menu.subtitle-sheet::before {
    display: none;
  }

  .sub-sheet-header {
    padding: 10px 14px 8px;
    gap: 8px;
  }

  .sub-sheet-body {
    padding: 10px 14px;
  }
}

/* 4. On Smart TV:
   Ensure 10-foot viewing proportions with large clear text, high-contrast #ff2d55 focus rings,
   and proper vertical bounds so all options are reachable via D-pad arrows */
.tv-mode #subtitle-menu.subtitle-sheet,
body.tv-mode #subtitle-menu.subtitle-sheet,
#player.tv-mode #subtitle-menu.subtitle-sheet {
  right: 48px;
  bottom: 104px;
  width: min(520px, calc(100% - 64px));
  max-width: calc(100% - 64px);
  max-height: min(720px, calc(100% - 130px));
}

.tv-mode #subtitle-menu .sub-sheet-header,
body.tv-mode #subtitle-menu .sub-sheet-header {
  padding: 20px 24px 16px;
  gap: 14px;
}

.tv-mode #subtitle-menu .sub-sheet-title,
body.tv-mode #subtitle-menu .sub-sheet-title {
  font-size: 19px;
  font-weight: 700;
}

.tv-mode #subtitle-menu .sub-sheet-icon svg,
body.tv-mode #subtitle-menu .sub-sheet-icon svg {
  width: 22px;
  height: 22px;
}

.tv-mode #subtitle-menu .sub-tab-btn,
body.tv-mode #subtitle-menu .sub-tab-btn {
  font-size: 14px;
  padding: 10px 14px;
  min-height: 44px;
}

.tv-mode #subtitle-menu .sub-sheet-body,
body.tv-mode #subtitle-menu .sub-sheet-body {
  padding: 22px 24px;
}

.tv-mode #subtitle-menu .sub-track-card,
body.tv-mode #subtitle-menu .sub-track-card {
  padding: 16px 18px;
  border-radius: 14px;
  min-height: 56px;
}

.tv-mode #subtitle-menu .sub-track-name,
body.tv-mode #subtitle-menu .sub-track-name {
  font-size: 15.5px;
}

.tv-mode #subtitle-menu .sub-track-sub,
body.tv-mode #subtitle-menu .sub-track-sub {
  font-size: 13px;
}

.tv-mode #subtitle-menu .sub-segmented-control,
body.tv-mode #subtitle-menu .sub-segmented-control {
  padding: 6px;
  gap: 6px;
}

.tv-mode #subtitle-menu .sub-segment-btn,
body.tv-mode #subtitle-menu .sub-segment-btn {
  padding: 11px 12px;
  font-size: 13.5px;
  min-height: 42px;
}

.tv-mode #subtitle-menu .sub-pill-btn,
body.tv-mode #subtitle-menu .sub-pill-btn {
  padding: 10px 4px;
  font-size: 13.5px;
  min-height: 44px;
}

.tv-mode #subtitle-menu .sub-color-btn,
body.tv-mode #subtitle-menu .sub-color-btn {
  padding: 12px 16px;
  font-size: 13.5px;
  min-height: 44px;
}

.tv-mode #subtitle-menu .sub-tracks-search-more,
body.tv-mode #subtitle-menu .sub-tracks-search-more {
  padding: 15px;
  font-size: 14.5px;
  min-height: 50px;
}

.tv-mode #subtitle-menu .sub-group-label,
body.tv-mode #subtitle-menu .sub-group-label {
  font-size: 13px;
}

.tv-mode #subtitle-menu .sub-preview-stage,
body.tv-mode #subtitle-menu .sub-preview-stage {
  height: 110px;
}

/* Smart TV & Universal Accessibility High-Contrast Focus Rings (#ff2d55) */
#subtitle-menu .focusable:focus,
#subtitle-menu .focusable:focus-visible,
#subtitle-menu .tv-focusable:focus,
#subtitle-menu .tv-focusable:focus-visible,
#subtitle-menu .sub-track-card:focus,
#subtitle-menu .sub-track-card:focus-visible,
#subtitle-menu .sub-tab-btn:focus,
#subtitle-menu .sub-tab-btn:focus-visible,
#subtitle-menu .sub-segment-btn:focus,
#subtitle-menu .sub-segment-btn:focus-visible,
#subtitle-menu .sub-pill-btn:focus,
#subtitle-menu .sub-pill-btn:focus-visible,
#subtitle-menu .sub-color-btn:focus,
#subtitle-menu .sub-color-btn:focus-visible,
#subtitle-menu .sub-lang-chip:focus,
#subtitle-menu .sub-lang-chip:focus-visible,
#subtitle-menu .sub-sheet-close:focus,
#subtitle-menu .sub-sheet-close:focus-visible,
#subtitle-menu .sub-tracks-search-more:focus,
#subtitle-menu .sub-tracks-search-more:focus-visible {
  outline: 3px solid var(--accent, #ff2d55) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 14px rgba(255, 45, 85, 0.6) !important;
  z-index: 2;
  position: relative;
}

/* ==========================================================================
   Player Hardware Acceleration & Silky Smooth Controls (Plex-inspired)
   ========================================================================== */
#video {
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#subtitle-menu {
  will-change: transform, opacity;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.player-controls,
.player-header {
  will-change: transform, opacity;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  touch-action: manipulation;
}

.player-overlay.controls-hidden .player-controls {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate3d(0, 10px, 0) !important;
  -webkit-transform: translate3d(0, 10px, 0) !important;
}

.player-overlay.controls-hidden .player-header {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate3d(0, -10px, 0) !important;
  -webkit-transform: translate3d(0, -10px, 0) !important;
}

