.fhc-ytp,
.fhc-ytp * {
  box-sizing: border-box;
}

.fhc-ytp,
.fhc-ytp button,
.fhc-ytp span,
.fhc-ytp div {
  font-family: inherit;
}

.fhc-ytp {
  width: 100%;
  max-width: var(--fhc-max-width, 1000px);
  margin: 0 auto;
}

/* Unified card */
.fhc-ytp__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--fhc-playlist-width, 260px);
  gap: 0;
  width: 100%;
  align-items: start;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.10);
}

/* Video stays true 16:9. Its height controls the playlist height via JS. */
.fhc-ytp__frame {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.fhc-ytp__iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* IMPORTANT: no height:100% here. JS sets an exact pixel height. */
.fhc-ytp__panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fbfaf7;
  border-left: 1px solid #ddd6c9;
}

.fhc-ytp__header {
  flex: 0 0 auto;
  padding: 11px 12px 10px;
  background: #111;
  border-bottom: 3px solid #b99853;
}

.fhc-ytp__title {
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
}

.fhc-ytp__position {
  margin-top: 3px;
  color: #d6c39a;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 500;
}

.fhc-ytp__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 3px 0;
  scrollbar-width: thin;
  scrollbar-color: #b8aa90 transparent;
}

.fhc-ytp__list::-webkit-scrollbar {
  width: 5px;
}

.fhc-ytp__list::-webkit-scrollbar-thumb {
  background: #b8aa90;
  border-radius: 0;
}

.fhc-ytp button.fhc-ytp__card {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 15px 76px minmax(0,1fr) !important;
  gap: 7px !important;
  align-items: center !important;
  min-height: 56px !important;
  margin: 0 !important;
  padding: 5px 7px !important;
  border: 0 !important;
  border-left: 3px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #161616 !important;
  font: inherit !important;
  text-align: left !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

.fhc-ytp button.fhc-ytp__card:hover {
  background: #f1ede5 !important;
}

.fhc-ytp button.fhc-ytp__card.is-active {
  background: #ebe3d3 !important;
  border-left-color: #b99853 !important;
}

.fhc-ytp__index {
  color: #777;
  font-size: 9px;
  text-align: center;
}

.fhc-ytp__card.is-active .fhc-ytp__index {
  color: #a37f35;
  font-size: 10px;
  font-weight: 700;
}

.fhc-ytp__thumb {
  position: relative;
  display: block;
  width: 76px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0;
  background: #ddd;
}

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

.fhc-ytp__duration {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 2px 4px;
  border-radius: 0;
  background: rgba(0,0,0,.82);
  color: #fff;
  font-size: 8px;
  line-height: 1;
}

.fhc-ytp__info {
  min-width: 0;
}

.fhc-ytp__video-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #111;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
}

.fhc-ytp__channel {
  display: block;
  margin-top: 2px;
  color: #777;
  font-size: 8px;
  line-height: 1.15;
}

.fhc-ytp-error {
  padding: 12px 14px;
  border-left: 4px solid #d63638;
  background: #fff;
}

/* Side-by-side for desktop/tablet. */
@media (min-width: 600px) {
  .fhc-ytp__layout {
    grid-template-columns: minmax(0, 1fr) var(--fhc-playlist-width, 260px);
  }
}

/* Stack only on small phones. */
@media (max-width: 599px) {
  .fhc-ytp__layout {
    grid-template-columns: 1fr;
  }

  .fhc-ytp__panel {
    height: 280px !important;
    border-left: 0;
    border-top: 1px solid #ddd6c9;
  }

  .fhc-ytp__thumb {
    width: 90px;
  }

  .fhc-ytp button.fhc-ytp__card {
    grid-template-columns: 16px 90px minmax(0,1fr) !important;
  }
}

/* v1.0.9: square-corner design */
.fhc-ytp__layout,
.fhc-ytp__frame,
.fhc-ytp__panel,
.fhc-ytp__thumb,
.fhc-ytp__duration,
.fhc-ytp__list::-webkit-scrollbar-thumb {
  border-radius: 0 !important;
}

.fhc-ytp__header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.fhc-ytp__header-copy{min-width:0}

/* v1.1.1: previous / next controls beside YouTube's centered play/pause button */
.fhc-ytp__video-nav {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.fhc-ytp button.fhc-ytp__video-nav-btn {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: absolute !important;
  top: 50% !important;

  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  margin: 0 !important;
  padding: 9px !important;

  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(0,0,0,.55) !important;
  color: #fff !important;

  box-shadow: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  opacity: .92 !important;
}

.fhc-ytp__video-nav .fhc-ytp__prev {
  left: calc(50% - 88px) !important;
  transform: translate(-50%, -50%) !important;
}

.fhc-ytp__video-nav .fhc-ytp__next {
  left: calc(50% + 88px) !important;
  transform: translate(-50%, -50%) !important;
}

.fhc-ytp button.fhc-ytp__video-nav-btn svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
  pointer-events: none;
}

.fhc-ytp button.fhc-ytp__video-nav-btn:hover {
  background: rgba(0,0,0,.78) !important;
  color: #fff !important;
  opacity: 1 !important;
}

.fhc-ytp button.fhc-ytp__video-nav-btn:disabled {
  opacity: .22 !important;
  cursor: default !important;
}

@media (max-width: 599px) {
  .fhc-ytp button.fhc-ytp__video-nav-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 8px !important;
  }

  .fhc-ytp__video-nav .fhc-ytp__prev {
    left: calc(50% - 66px) !important;
  }

  .fhc-ytp__video-nav .fhc-ytp__next {
    left: calc(50% + 66px) !important;
  }

  .fhc-ytp button.fhc-ytp__video-nav-btn svg {
    width: 21px;
    height: 21px;
  }
}


/* v1.1.1 playlist text refinement */
.fhc-ytp__video-title {
  color: #111;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0;
}

.fhc-ytp__channel {
  display: block;
  margin-top: 4px;
  color: #8a8a8a;
  font-size: 8.5px;
  line-height: 1.25;
  font-weight: 400;
}

.fhc-ytp__info {
  min-width: 0;
  padding-right: 5px;
}

.fhc-ytp button.fhc-ytp__card {
  min-height: 66px !important;
  padding: 7px 8px !important;
  gap: 9px !important;
}

/*
 * Custom previous/next controls follow the same interaction pattern as
 * YouTube's overlay controls: visible while the user is interacting with
 * the player, then faded away after inactivity.
 */


/* v1.1.1: custom skip buttons follow YouTube-like control visibility */
.fhc-ytp__video-nav {
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}

.fhc-ytp__frame.fhc-controls-visible .fhc-ytp__video-nav {
  opacity: 1;
  visibility: visible;
}

/* Keyboard users should never lose focused custom controls. */
.fhc-ytp__video-nav:focus-within {
  opacity: 1;
  visibility: visible;
}


/* v1.1.1 final control-visibility safeguard */
.fhc-ytp__video-nav {
  opacity: 0 !important;
  visibility: hidden !important;
}

.fhc-ytp__frame.fhc-controls-visible .fhc-ytp__video-nav,
.fhc-ytp__video-nav:focus-within {
  opacity: 1 !important;
  visibility: visible !important;
}
