/* YG3 — Favourites (Mobile) list (console-aligned) */
@media (max-width: 1023px) {

  /* List container */
  #yg3-pane-sf .yg3-cards {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Row: allow wrappers (NO direct child >) */
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg365-fav-card {
    display: grid !important;
    grid-template-columns: 120px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas:
      "thumb title"
      "thumb actions" !important;
    gap: 8px 12px !important;
    padding: 10px 0 !important;
    margin: 8px 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: transparent !important;
    align-items: start !important;
  }

  /* Thumb (square) */
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card .yg3-card__media,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg365-fav-card .thumb {
    grid-area: thumb !important;
    width: 120px !important;
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    aspect-ratio: 1/1 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    position: relative !important;
    align-self: start !important;
    background: transparent !important;
  }
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card .yg3-card__media img,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card .yg3-card__media .yg3-card__cover,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg365-fav-card .thumb img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
 /* use 'cover' if you want cropped fill */
    object-position: center center !important;
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
  }

  /* Title area (cover common wrappers) */
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__body,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__content,
  .yg3-hub #yg3-pane-sf .yg3-cards .content {
    grid-area: title !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important; /* kills the 10px/12px/12px/12px you saw */
  }
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__title,
  .yg3-hub #yg3-pane-sf .yg3-cards .title {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    margin: 2px 0 4px 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__pill,
  .yg3-hub #yg3-pane-sf .yg3-cards .meta {
    display: inline-block !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    color: #6b7280 !important;
  }

  /* Actions row */
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions,
  .yg3-hub #yg3-pane-sf .yg3-cards .actions {
    grid-area: actions !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 2px 0 0 0 !important;
    flex-wrap: wrap !important;
  }

  /* If heart is overlayed directly under card, seat it in actions */
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card > .yg3-sf-heart,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card > .yg3-fav,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card > button.yg3-fav {
    position: static !important;
    grid-area: actions !important;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
  }

  /* Icon buttons (incl. heart) */
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions .yg3-btn,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions button,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions a,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions [data-icon],
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions .yg3-sf-heart,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions .yg3-fav,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions button.yg3-fav {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    border: 1px solid #e5e7eb !important;
    background-color: #fff !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 20px 20px !important;
    text-indent: -9999px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
  }
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions .yg3-sf-heart svg,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions .yg3-fav svg,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions button.yg3-fav svg {
    width: 20px !important; height: 20px !important; display: block !important;
  }

  /* Icon images */
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions [data-icon="view"],
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions .yg3-open-modal[data-action="view"],
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions .yg3-open-modal[data-action="open"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") !important;
  }
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions [data-icon="watch"],
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions .yg3-open-modal[data-action="watch"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='%23111827'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") !important;
  }
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions [data-icon="download"],
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions a[data-do="download"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") !important;
  }
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions [data-icon="print"],
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions a[data-do="print"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 6 2 18 2 18 9'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='6' y='14' width='12' height='8'/%3E%3C/svg%3E") !important;
  }
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions [data-icon="lesson"],
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions [data-icon="link"],
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions .yg3-lesson-link,
  .yg3-hub #yg3-pane-sf .yg3-cards .yg3-card__actions [data-action="lesson"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.5 13.5l3-3'/%3E%3Cpath d='M7.5 16.5a4.5 4.5 0 0 1 0-6.36l2.14-2.14a4.5 4.5 0 0 1 6.36 0'/%3E%3Cpath d='M16.5 7.5a4.5 4.5 0 0 1 0 6.36l-2.14 2.14a4.5 4.5 0 0 1-6.36 0'/%3E%3C/svg%3E") !important;
  }

  /* Show-more: CSS side only; JS toggles data-m-hide */
  .yg3-hub #yg3-pane-sf .yg3-cards [data-m-hide="1"] { display: none !important; }
  .yg3-hub #yg3-pane-sf .yg3-fav-more {
    display: inline-block !important;
    margin: 10px 0 6px 0 !important;
    padding: 10px 14px !important;
    border-radius: 9999px !important;
    border: 1px solid #d1d5db !important;
    background: #fff !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }
}

/* ==== Favourites mobile polish & centering (final) ==== */
@media (max-width: 1023px) {
  .yg3-hub #yg3-pane-sf .yg3-cards > .yg3-card,
  .yg3-hub #yg3-pane-sf .yg3-cards > .yg365-fav-card,
  .yg3-hub #yg3-pane-sf .yg3-fav--list > .yg3-card,
  .yg3-hub #yg3-pane-sf .yg3-fav--list > .yg365-fav-card {
    align-items: center !important;        /* center rows */
    margin: 6px 0 !important;
    padding: 8px 0 !important;
  }

  .yg3-hub #yg3-pane-sf .yg3-card__media,
  .yg3-hub #yg3-pane-sf .thumb {
    align-self: center !important;         /* center the thumb */
    width: 120px !important;
    height: 120px !important;
  }

  .yg3-hub #yg3-pane-sf .yg3-card__body,
  .yg3-hub #yg3-pane-sf .yg3-card__content,
  .yg3-hub #yg3-pane-sf .content {
    padding: 0 !important;
    margin: 0 !important;
  }

  .yg3-hub #yg3-pane-sf .yg3-card__actions,
  .yg3-hub #yg3-pane-sf .actions {
    gap: 10px !important;
    padding-top: 4px !important;
  }

  .yg3-hub #yg3-pane-sf .yg3-cards > .yg3-card:last-child,
  .yg3-hub #yg3-pane-sf .yg3-cards > .yg365-fav-card:last-child,
  .yg3-hub #yg3-pane-sf .yg3-fav--list > .yg3-card:last-child,
  .yg3-hub #yg3-pane-sf .yg3-fav--list > .yg365-fav-card:last-child {
    border-bottom: none !important;
  }

  /* Neutral show more/less button */
  .yg3-hub #yg3-pane-sf .yg3-fav-more {
    display: inline-block !important;
    margin: 10px 0 6px 0 !important;
    padding: 10px 14px !important;
    border-radius: 9999px !important;
    border: 1px solid #d1d5db !important;
    background: #fff !important;
    color: #111827 !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }

  /* Ensure hidden items truly collapse space */
  #yg3-pane-sf [data-m-hide="1"] { display: none !important; }
}

/* === FAVOURITES (mobile) — lock in the console-tested layout === */
@media (max-width: 1023px) {
  /* Neutralize leftover slider styling on the list container */
  #yg3-pane-sf .yg3-cards.yg3-fav--list {
    display: block !important;
    overflow: visible !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Each favourite: 120px thumb column + content */
  #yg3-pane-sf .yg3-cards > .yg3-card,
  #yg3-pane-sf .yg3-cards > .yg365-fav-card {
    display: grid !important;
    grid-template-columns: 120px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas: "thumb title" "thumb actions" !important;
    align-items: start !important;
    gap: 12px 14px !important;

    /* Tighter vertical rhythm (matches console) */
    padding: 10px 0 !important;
    margin: 6px 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: transparent !important;
  }

  /* Remove divider on last row to avoid big blank space */
  #yg3-pane-sf .yg3-cards > .yg3-card:last-child,
  #yg3-pane-sf .yg3-cards > .yg365-fav-card:last-child {
    border-bottom: none !important;
  }

  /* 120×120 square thumbnail, full-bleed cover */
  #yg3-pane-sf .yg3-card__media,
  #yg3-pane-sf .yg365-fav-card .thumb {
    grid-area: thumb !important;
    position: relative !important;
    width: 120px !important;
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    align-self: start !important;
    background: transparent !important;
    aspect-ratio: 1 / 1 !important;
  }
  #yg3-pane-sf .yg3-card__media img,
  #yg3-pane-sf .yg3-card__media .yg3-card__cover,
  #yg3-pane-sf .yg365-fav-card .thumb img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;  /* match the console “full-bleed” */
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
  }

  /* Title/meta area */
  #yg3-pane-sf .yg3-card__body,
  #yg3-pane-sf .yg365-fav-card .content {
    grid-area: title !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #yg3-pane-sf .yg3-card__title,
  #yg3-pane-sf .yg365-fav-card .title {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    margin: 2px 0 4px 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  #yg3-pane-sf .yg3-card__pill,
  #yg3-pane-sf .yg365-fav-card .meta {
    font-size: 12px !important;
    line-height: 1.2 !important;
    color: #6b7280 !important;
  }

  /* Actions row */
  #yg3-pane-sf .yg3-card__actions,
  #yg3-pane-sf .yg365-fav-card .actions {
    grid-area: actions !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding-top: 6px !important;
    flex-wrap: wrap !important;
  }

  /* Hide items the JS flags with data-m-hide (first 6 visible) */
  #yg3-pane-sf .yg3-cards > *[data-m-hide="1"] {
    display: none !important;
  }

  /* Show more/less button (neutral style, non-theme) */
  #yg3-pane-sf .yg3-fav-more {
    display: inline-block !important;
    margin: 10px 0 6px 0 !important;
    padding: 10px 14px !important;
    border-radius: 9999px !important;
    border: 1px solid #d1d5db !important;
    background: #fff !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }
}

/* Favourites: hard-hide rows marked data-m-hide (beats any theme/slider) */
@media (max-width:1023px){
  #yg3-pane-sf .yg3-cards > *[data-m-hide="1"],
  #yg3-pane-sf .yg365-fav-grid > *[data-m-hide="1"],
  #yg3-pane-sf .card-grid > *[data-m-hide="1"]{
    display:none !important;
  }

  /* Show more / Show less button styling (neutral, not theme colors) */
  #yg3-pane-sf .yg3-fav-more{
    display:inline-block !important;
    margin:10px 0 0 0 !important;
    padding:10px 14px !important;
    border-radius:9999px !important;
    border:1px solid #d1d5db !important;
    background:#fff !important;
    font-size:14px !important;
    line-height:1 !important;
  }

  /* Tighten bottom spacing of the pane/list to remove the big gap */
  #yg3-pane-sf{ margin-bottom:0 !important; padding-bottom:0 !important; }
  #yg3-pane-sf .yg3-cards,
  #yg3-pane-sf .yg365-fav-grid,
  #yg3-pane-sf .card-grid{
    margin:0 !important; padding:0 !important;
  }
  #yg3-pane-sf .yg3-cards > .yg3-card:last-child,
  #yg3-pane-sf .yg365-fav-grid > *:last-child,
  #yg3-pane-sf .card-grid > *:last-child{
    border-bottom:none !important;
    margin-bottom:0 !important;
  }
}
