/* YT Sheet Grid - standalone, theme-proof-ish styles */

/* Reset inside the plugin only (avoid fighting the whole theme) */
.ytsg-shell-cover, .ytsg-shell-cover * { box-sizing: border-box; }
.ytsg-shell-cover { width: 100%; min-width: 280px; }
.ytsg-shell-cover ul, .ytsg-shell-cover li { margin: 0; padding: 0; }

/* Strict list marker reset — prevents theme ul/li styles leaking into grid */
.ytsg-wrap ul, .ytsg-wrap ol, .ytsg-wrap li,
.ytsg-core ul, .ytsg-core li,
.yrc-grid ul, .yrc-grid li,
.yrc-items ul, .yrc-items li { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.ytsg-wrap li::before, .ytsg-wrap li::after, .ytsg-wrap li::marker,
.ytsg-core li::before, .ytsg-core li::after, .ytsg-core li::marker,
.yrc-grid li::before, .yrc-grid li::after, .yrc-grid li::marker,
.yrc-items li::before, .yrc-items li::after, .yrc-items li::marker { content: none !important; display: none !important; }

.ytsg-content { overflow: hidden; clear: both; }

/* Grid */
.ytsg-core{
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
}

.ytsg-shell .ytsg-core > .ytsg-item{
  flex: 0 0 auto !important;
  width: calc(100% / var(--ytsg-cols, 4)) !important;
  max-width: calc(100% / var(--ytsg-cols, 4)) !important;
  padding: 0 calc(var(--ytsg-gap-desktop, 12px) / 2) !important;
  margin: 0 0 var(--ytsg-gap-desktop, 12px) 0 !important;
}

@media (max-width: 768px) {
  .ytsg-shell .ytsg-core > .ytsg-item {
    width: calc(100% / var(--ytsg-cols-tablet, 3)) !important;
    max-width: calc(100% / var(--ytsg-cols-tablet, 3)) !important;
    padding: 0 calc(var(--ytsg-gap-tablet, 10px) / 2) !important;
    margin: 0 0 var(--ytsg-gap-tablet, 10px) 0 !important;
  }
}

@media (max-width: 480px) {
  .ytsg-shell .ytsg-core > .ytsg-item {
    width: calc(100% / var(--ytsg-cols-mobile, 2)) !important;
    max-width: calc(100% / var(--ytsg-cols-mobile, 2)) !important;
    padding: 0 calc(var(--ytsg-gap-mobile, 8px) / 2) !important;
    margin: 0 0 var(--ytsg-gap-mobile, 8px) 0 !important;
  }
}

.ytsg-thumb{ position: relative; display:block; }
.ytsg-thumb a{ display:block; }
.ytsg-thumb img{ width: 100%; height: auto; display: block; border-radius: 8px; }

.ytsg-item-meta{ padding-top: 8px; width: 100%; }

/* Core fix: keep title and date properly separated (some themes force flex layouts or strip gaps) */
.ytsg-name-date{
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: baseline !important;
  column-gap: var(--ytsg-title-date-gap, 6px) !important;
  row-gap: 2px !important;
}

.ytsg-item-title{ font-size: 16px; line-height: 1.25; overflow: hidden; min-width: 0; }
.ytsg-item-title a{ text-decoration: none; }
.ytsg-video-date{ font-size: 12px; opacity: .75; margin-top: 0 !important; display: inline-block; }

.ytsg-item-genres{ font-size: 13px; opacity: .8; margin-top: 4px; line-height: 1.2; }




/* Inline player */
.ytsg-player-shell{ position: relative; }
.ytsg-player-shell:not(.ytsg-is-sticky){ top: -5px !important; }
.ytsg-player-shell .ytsg-close{
  position: absolute;
  right: 10px;
  top: 10px;
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.55);
  color: #fff;
  z-index: 5;
}
.ytsg-ratio{ position: relative; width: 100%; height: 0; padding-top: 56.25%; }
.ytsg-ratio iframe{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Title shown under the player */
.ytsg-player-title{
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ytsg-player-title-row--main{
  display: flex;
  align-items: center;
  gap: 10px;
}

.ytsg-player-title-row--meta{
  font-size: 13px;
  font-weight: 400;
  color: inherit;
  opacity: 0.7;
  padding-left: 42px;
}

.ytsg-player-title-row--chips{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 42px;
}

.ytsg-player-chip{
  font-size: 12px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(128,128,128,0.13);
  color: inherit;
  opacity: 0.8;
}

.ytsg-provider-icon{
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px !important;
  height: 32px !important;
  line-height: 1;
  overflow: visible;
}

.ytsg-provider-icon svg{
  display: block !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
  border-radius: 6px;
  overflow: visible;
}

.ytsg-player-title a{
  color: inherit;
  text-decoration: none;
}
.ytsg-player-title a:hover{
  text-decoration: underline;
}


/* Row-injected player (appears right above the clicked flex row) */
.ytsg-core > li.ytsg-player-li{
  flex: 0 0 100% !important;
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 10px 14px 10px !important;
  margin: 0 !important;
}
.ytsg-style-row .ytsg-player-shell:not(.ytsg-is-sticky){ top: 0 !important; }


/* Playlist (YouTube-like) style strip */
.ytsg-style-playlist .ytsg-player-shell{ display:block; }
.ytsg-strip{ margin: 0 0 10px 0; }
.ytsg-strip-core{ list-style:none !important; padding:0 !important; margin:0 !important; display:flex !important; gap:10px; flex-wrap:wrap; }
.ytsg-strip-item{ flex: 1 1 180px; max-width: 240px; }
.ytsg-strip-item img{ width:100%; height:auto; display:block; border-radius:8px; }

/* Pagination / Load more controls – FINAL (stable on zoom) */
.ytsg-controls{
  width: 100%;
  box-sizing: border-box;
  margin: 18px 0 10px;
  padding: 0 12px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ytsg-count{
  font-size: 14px;
  opacity: .7;
  white-space: nowrap;
}

/* Load more button – dark CTA */
.ytsg-loadmore{
  background:#111;
  color:#fff;
  border:1px solid #111;
  padding:12px 20px;
  border-radius: 16px;
  font-weight:600;
  letter-spacing:.2px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

.ytsg-loadmore:hover{
  background:#000;
  border-color:#000;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}

.ytsg-loadmore:active{
  transform: translateY(1px);
}

.ytsg-loadmore:disabled{
  opacity:.6;
  cursor:default;
  transform:none;
  box-shadow:none;
}

.ytsg-loadmore-status{
  font-size: 13px;
  opacity: .8;
  white-space: nowrap;
}

.ytsg-loadmore-status:empty{ display:none; }

.ytsg-loadmore-status.is-done{
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.04);
  opacity: .75;
}

/* Pagination look */
.ytsg-pagination{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:center;
  width: 100%;
}

.ytsg-page{
  display:inline-block;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
  text-decoration:none;
}

.ytsg-page.is-current{
  background: rgba(0,0,0,.06);
}

/* Small screens: stack */
@media (max-width: 520px){
  .ytsg-controls{
    flex-direction: column;
    gap: 10px;
  }
}


/* Sticky player (configurable) */
.ytsg-player-shell.ytsg-is-sticky{
  position: fixed !important;
  z-index: 99999;
  width: var(--ytsg-sticky-w, 400px);
  max-width: calc(100vw - (var(--ytsg-sticky-m, 16px) * 2));
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  background: #000;
  /* Default position (JS can override to tl/tr/bl/br) */
  right: var(--ytsg-sticky-m, 16px);
  bottom: var(--ytsg-sticky-m, 16px);
}

.ytsg-player-shell.ytsg-is-sticky .ytsg-ratio{
  padding-top: var(--ytsg-sticky-ratio, 56.25%);
}

.ytsg-player-shell.ytsg-is-sticky .ytsg-player-title{
  display: none !important;
}

/* Placeholder keeps layout stable when player becomes fixed */
.ytsg-sticky-placeholder{
  width: 100%;
}

@media (max-width: 720px){
  .ytsg-player-shell.ytsg-is-sticky{
    position: static !important;
    width: auto !important;
    max-width: none !important;
    right: auto !important;
    bottom: auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
}

/* Mobile helper: floating "back to player" button */
.ytsg-jump-top{
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 0;
  background: #0d6e8a;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 99998;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.ytsg-jump-top .ytsg-jump-ico{
  display: inline-block;
  transform: translateY(-1px);
}

.ytsg-jump-top.is-visible{
  opacity: .95;
  transform: translateY(0);
  pointer-events: auto;
}

@media (min-width: 768px){
  .ytsg-jump-top{ display: none !important; }
}


/* Search + Sort filter bar */
.ytsg-filterbar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:10px 0;
}

/* Theme-proof layout for filter bar (some themes override form styles heavily) */
.ytsg-shell-cover .ytsg-filterbar{
  display:flex !important;
  align-items:center !important;
  /* Keep gaps configurable (Elementor Style tab can override these) */
  column-gap:16px;
  row-gap:10px;
  flex-wrap:wrap !important;
}
.ytsg-shell-cover .ytsg-search-wrap{ flex: 1 1 260px; min-width:220px; }
.ytsg-shell-cover .ytsg-search-wrap input.ytsg-search{ width:100%; }
.ytsg-shell-cover .ytsg-sort-wrap{ flex: 0 0 auto; }
.ytsg-shell-cover .ytsg-filtercount{ margin-left:auto !important; }

/* No extra margins by default (Elementor can control gaps). */

.ytsg-filterbar input.ytsg-search{
  padding:8px 10px;
  border:1px solid rgba(128,128,128,.3);
  border-radius:6px;
  min-width:220px;
  color:inherit;
  background:rgba(128,128,128,.07);
}
.ytsg-filterbar select.ytsg-sort{
  padding:7px 10px;
  border:1px solid rgba(128,128,128,.3);
  border-radius:6px;
  color:inherit;
  background:rgba(128,128,128,.07);
}
.ytsg-filterbar .ytsg-filtercount{
  margin-left:auto;
  font-size:13px;
  opacity:0.8;
}

/* Genres tabs (chips) */
.ytsg-genretabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:6px 0 12px;
}
.ytsg-genrechip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid rgba(128,128,128,.35);
  background:rgba(128,128,128,.08);
  cursor:pointer;
  font-size:13px;
  line-height:1;
  user-select:none;
  color:inherit;
}
.ytsg-genrechip:hover{ opacity:.8; }
.ytsg-genrechip.is-active{
  background: #1d52d6;
  border-color: #1d52d6;
  color: #fff !important;
}

/* Split layout: left filters panel + right grid */
.ytsg-layout{
  display:grid;
  grid-template-columns: var(--ytsg-sidebar-w, 320px) minmax(0, 1fr);
  gap: var(--ytsg-layout-gap, 24px);
  align-items:start;
}
.ytsg-sidebar{ min-width: 0; }
.ytsg-gridcol{ min-width: 0; }

/* Left panel: filter sections (MVP: Genres) */
.ytsg-sidebar-inner{ display:flex; flex-direction:column; gap:14px; }
.ytsg-panel-section{
  border:1px solid rgba(128,128,128,.2);
  border-radius:14px;
  padding:12px;
  background: rgba(128,128,128,.04);
}
.ytsg-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.ytsg-panel-title{ font-size:14px; font-weight:600; }
.ytsg-panel-optsearch{
  width:100%;
  margin: 0 0 10px 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(128,128,128,.3);
  background: rgba(128,128,128,.08);
  color: inherit;
  font-size: 13px;
}
.ytsg-panel-select{
  width:100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(128,128,128,.3);
  background: rgba(128,128,128,.08);
  color: inherit;
  font-size: 13px;
}
.ytsg-panel-clear{
  appearance:none;
  border:1px solid rgba(128,128,128,.35);
  background: rgba(128,128,128,.1);
  color: inherit;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  cursor:pointer;
}
.ytsg-panel-clear:hover{ background: rgba(128,128,128,.2); }
.ytsg-panel-list{ display:flex; flex-direction:column; gap:7px; max-height: 65vh; overflow:auto; padding-right:2px; }
.ytsg-check{ display:flex; align-items:flex-start; gap:8px; cursor:pointer; font-size:13px; line-height:1.25; }
.ytsg-check input{ margin-top:2px; }
.ytsg-check-label{ display:inline-flex; align-items:center; gap:6px; }
.ytsg-pf-icon{ display:inline-flex; align-items:center; flex-shrink:0; }
.ytsg-panel-note{ font-size:13px; opacity:.7; }

/* Mobile: filters button (shown via per-instance breakpoint style) */
.ytsg-filters-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:8px 12px;
  border-radius:10px;
  border:1px solid rgba(128,128,128,.25);
  background: rgba(128,128,128,.06);
  cursor:pointer;
  font-size:13px;
  line-height:1;
}
.ytsg-filters-toggle:hover{ background: rgba(0,0,0,.04); }

/* Drawer + overlay */
.ytsg-overlay{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.45);
  z-index: 99990;
}
.ytsg-drawer{
  position:fixed;
  top:0;
  left:0;
  height:100vh;
  width: var(--ytsg-drawer-w, var(--ytsg-sidebar-w, 320px));
  max-width: 92vw;
  background: var(--ytsg-drawer-bg, #fff);
  z-index: 99991;
  transform: translateX(-105%);
  transition: transform .22s ease;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  display:flex;
  flex-direction:column;
}
.ytsg-drawer-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 14px;
  border-bottom:1px solid rgba(0,0,0,.10);
}
.ytsg-drawer-title{
  font-size:14px;
  font-weight:600;
}
.ytsg-drawer-close{
  appearance:none;
  border:0;
  background:transparent;
  font-size:26px;
  line-height:1;
  padding:2px 8px;
  cursor:pointer;
  border-radius:10px;
}
.ytsg-drawer-close:hover{ background: rgba(0,0,0,.06); }
.ytsg-drawer-body{
  padding: 12px 14px;
  overflow:auto;
  flex: 1 1 auto;
}

.ytsg-shell.ytsg-drawer-open .ytsg-overlay{ display:block; }
.ytsg-shell.ytsg-drawer-open .ytsg-drawer{ transform: translateX(0); }

body.ytsg-lock{ overflow:hidden !important; }

/* Optional fields */
.ytsg-item-year,
.ytsg-item-extra{
  font-size:12px;
  opacity:0.9;
  margin-top:2px;
}
.ytsg-extra-label{
  font-weight:600;
}

/* Date layout: inline (default) or below title */
.ytsg-shell[data-ytsg-date-layout="below"] .ytsg-name-date{
  flex-direction:column !important;
  align-items:flex-start !important;
  column-gap:0 !important;
}
.ytsg-shell[data-ytsg-date-layout="below"] .ytsg-video-date{
  display:block !important;
  margin-top:2px;
}

/* Thumbs: optional uniform aspect ratio + object-fit */
.ytsg-shell[data-ytsg-thumb="1"] .ytsg-thumb{
  aspect-ratio: var(--ytsg-thumb-ratio, 16/9) !important;
  overflow:hidden;
  background: var(--ytsg-thumb-bg, transparent);
}
.ytsg-shell[data-ytsg-thumb="1"] .ytsg-thumb a{
  display:block;
  height:100%;
}
.ytsg-shell[data-ytsg-thumb="1"] .ytsg-thumb img{
  width:100%;
  height:100% !important;
  object-fit: var(--ytsg-thumb-fit, cover);
}

/* Lightbox (modal) */
.ytsg-lightbox{
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: none;
}
.ytsg-lightbox-backdrop{
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--ytsg-lb-backdrop, rgba(0,0,0,0.65));
}
.ytsg-lightbox-dialog{
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.ytsg-lightbox-card{
  width: min(92vw, var(--ytsg-lb-maxw, 980px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--ytsg-lb-card-bg, #fff);
  color: var(--ytsg-lb-card-fg, #111);
  border-radius: var(--ytsg-lb-radius, 14px);
  box-shadow: 0 12px 48px rgba(0,0,0,0.35);
  position: relative;
}
.ytsg-lightbox-media{
  padding: 14px 14px 0 14px;
}
.ytsg-lightbox-ratio{
  /* Use the same radius variable as the card so iframe corners match when radius=0 */
  border-radius: max(0px, calc(var(--ytsg-lb-radius, 14px) - 2px));
  overflow: hidden;
  background: var(--ytsg-lb-media-bg, #000);
}
.ytsg-lightbox-content{
  /* Enough padding-right to prevent long titles overlapping the X button (36px + 12px right + 8px gap) */
  padding: 14px 60px 18px 18px;
}
.ytsg-lightbox .ytsg-player-title{
  margin: 10px 0 12px 0;
  font-size: 22px;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 700;
  color: var(--ytsg-lb-card-fg, #111);
  padding: 0;
}
.ytsg-lightbox .ytsg-player-title-row--main{
  display: flex;
  align-items: center;
  gap: 12px;
}
.ytsg-lightbox .ytsg-player-title-row--meta{
  font-size: 14px;
  font-weight: 400;
  opacity: 0.65;
  padding-left: 48px;
}
.ytsg-lightbox .ytsg-player-title-row--chips{
  padding-left: 48px;
}
.ytsg-lightbox .ytsg-player-chip{
  font-size: 13px;
}
.ytsg-lightbox .ytsg-player-title a{
  color: inherit;
  text-decoration: none;
}
.ytsg-lightbox .ytsg-player-title a:hover{
  text-decoration: underline;
  opacity: 0.9;
}
.ytsg-lb-meta{
  font-size: 14px;
  /* Inherits card fg so it's readable on both light and dark backgrounds */
  color: var(--ytsg-lb-meta-color, var(--ytsg-lb-card-fg, #555));
  margin-bottom: 10px;
}
.ytsg-lb-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ytsg-lb-tag{
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  /* Neutral semi-transparent bg works on both light and dark cards */
  background: rgba(128,128,128,0.18);
  /* Inherit card fg color so chips are always readable */
  color: var(--ytsg-lb-card-fg, #333);
}
.ytsg-lb-x{
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  /* Reset browser button defaults that themes can override */
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  /* Subtle border ensures X is always visible regardless of card bg */
  box-shadow: 0 0 0 1px rgba(128,128,128,0.30);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Default neutral bg — visible on both white and black cards */
  background: var(--ytsg-lb-x-bg, rgba(128,128,128,0.15));
  /* X icon color chains: explicit var → card fg → safe dark fallback */
  color: var(--ytsg-lb-x-color, var(--ytsg-lb-card-fg, #111));
  border-radius: 10px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  font-family: inherit;
}
.ytsg-lb-x:hover{
  /* Hover can be customized separately; falls back to base X bg, then to neutral */
  background: var(--ytsg-lb-x-bg-hover, var(--ytsg-lb-x-bg, rgba(128,128,128,0.28)));
  box-shadow: 0 0 0 1px rgba(128,128,128,0.40);
}
@media (max-width: 600px){
  .ytsg-lightbox-dialog{ padding: 10px; align-items: flex-start; padding-top: 48px; }
  .ytsg-lightbox-card{ width: 100%; border-radius: 12px; }
  .ytsg-lightbox-media{ padding: 12px 12px 0 12px; }
  .ytsg-lightbox-content{ padding: 12px 56px 14px 14px; }
  .ytsg-lightbox .ytsg-player-title{ font-size: 18px; }
}

/* Post link / Read on site */
.ytsg-post-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: inherit;
  opacity: .7;
  text-decoration: none;
  padding: 4px 0 2px;
}
.ytsg-post-link:hover { opacity: 1; text-decoration: underline; }
.ytsg-post-link--thumb {
  display: block;
  margin-top: 4px;
}
.ytsg-post-link--player {
  margin-top: 8px;
}
.ytsg-post-link::before { content: '↗ '; font-size: 11px; }

/* Player rows — text field (plot, description, etc.) */
.ytsg-player-title-row--text {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  opacity: .85;
  white-space: normal;
}
.ytsg-lightbox .ytsg-player-title-row--text {
  font-size: 13px;
  line-height: 1.5;
  max-height: 8em;
  overflow-y: auto;
}

/* YouTube status badge */
.ytsg-thumb { position: relative; }
.ytsg-yt-badge {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 3px 10px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 4;
}
.ytsg-yt-badge--age {
  background: rgba(180,0,0,.82);
}
.ytsg-yt-badge--external {
  background: rgba(20,20,20,.80);
  letter-spacing: .01em;
}

/* ── Country availability filter UI ─────────────────────────────────────── */
.ytsg-cf-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 10px;
  flex-wrap: wrap;
}
.ytsg-cf-label {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  opacity: .8;
  white-space: nowrap;
}
/* Dropdown */
.ytsg-cf-select {
  font-size: 13px;
  height: 30px;
  min-width: 160px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  padding: 0 8px;
  background: transparent;
  color: inherit;
  opacity: .85;
  cursor: pointer;
}
.ytsg-cf-select:focus {
  outline: none;
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(24,95,165,.25);
}
/* Chips wrapper */
.ytsg-cf-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
/* Individual chip */
.ytsg-cf-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  border: 1.5px solid currentColor;
  border-radius: 20px;
  background: transparent;
  color: inherit;
  opacity: .65;
  cursor: pointer;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
  user-select: none;
}
.ytsg-cf-chip:hover {
  opacity: 1;
  background: rgba(128,128,128,.12);
}
.ytsg-cf-chip.active {
  background: #185FA5;
  border-color: #185FA5;
  color: #fff;
  opacity: 1;
  font-weight: 600;
}
.ytsg-cf-chip.active:hover {
  background: #0c447c;
  border-color: #0c447c;
}
/* Panel section for country widget */
.ytsg-cf-panel-section .ytsg-cf-chips {
  padding: 6px 0 2px;
  gap: 4px;
}
.ytsg-cf-panel-section .ytsg-cf-select {
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}
.ytsg-cf-hint {
  display: block;
  font-size: 11px;
  opacity: .55;
  margin-top: 5px;
  font-style: italic;
}

/* ── YouTube Channel Playlists Tab ─────────────────────────── */
.ytsg-ch-tabs{position:relative}
.ytsg-ch-tabbar{display:flex;gap:0;border-bottom:2px solid #e2e2dc;margin-bottom:16px;flex-wrap:wrap;margin-top:4px}
.ytsg-ch-tab{background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-2px;padding:10px 20px;font-size:14px;font-weight:500;color:#888;cursor:pointer;transition:color .15s,border-color .15s;outline:none}
.ytsg-ch-tab:hover{color:#185FA5}
.ytsg-ch-tab.ytsg-ch-tab-active{color:#185FA5;border-bottom-color:#185FA5}
.ytsg-ch-tab-panel{display:none}
.ytsg-ch-tab-panel.ytsg-ch-tab-active{display:block}
.ytsg-ch-pl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px;padding:4px 0 20px}
.ytsg-ch-pl-card{background:#fff;border:0.5px solid #e2e2dc;border-radius:8px;overflow:hidden;cursor:pointer;transition:box-shadow .15s,transform .1s}
.ytsg-ch-pl-card:hover{box-shadow:0 2px 12px rgba(0,0,0,.1);transform:translateY(-1px)}
.ytsg-ch-pl-thumb{position:relative;aspect-ratio:16/9;overflow:hidden;background:#f1efe8}
.ytsg-ch-pl-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.ytsg-ch-pl-count{position:absolute;bottom:6px;right:6px;background:rgba(0,0,0,.7);color:#fff;font-size:11px;padding:2px 7px;border-radius:3px;white-space:nowrap}
.ytsg-ch-pl-info{padding:10px 12px}
.ytsg-ch-pl-title{font-size:13px;font-weight:600;color:#111;line-height:1.35;margin-bottom:4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ytsg-ch-pl-desc{font-size:11px;color:#888;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ytsg-ch-back{display:inline-flex;align-items:center;gap:6px;margin-bottom:12px;background:none;border:0.5px solid #d0d0cc;border-radius:5px;padding:5px 12px;font-size:13px;color:#555;cursor:pointer}
.ytsg-ch-back:hover{background:#f4f4f0}
.ytsg-ch-pl-loading{padding:24px;text-align:center;color:#888;font-size:13px}


/* ── YouTube Channel playlist results container ─────────── */
.ytsg-ch-playlist-results{padding:4px 0 20px}
.ytsg-ch-pl-current-title{font-weight:600;font-size:16px;margin:10px 0 16px}
.ytsg-ch-pl-vidlink{text-decoration:none;color:inherit}
.ytsg-ch-pl-vidlink:hover .ytsg-ch-pl-title{text-decoration:underline}

/* ── YouTube Channel Header ──────────────────────────────── */
.ytsg-ch-header{display:flex;align-items:center;gap:3%;padding:1em 0 0.5em}
.ytsg-ch-header-avatar{width:4em;height:4em;border-radius:50%;overflow:hidden;flex-shrink:0;background:var(--color-background-info)}
.ytsg-ch-header-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.ytsg-ch-header-initials{display:flex;align-items:center;justify-content:center;width:4em;height:4em;font-size:1.1em;font-weight:500;color:var(--color-text-info)}
.ytsg-ch-header-info{flex:1;min-width:0}
.ytsg-ch-header-row{display:flex;align-items:baseline;gap:0.6em;flex-wrap:wrap;margin-bottom:0.2em}
.ytsg-ch-header-name{font-size:1em;font-weight:500;color:var(--color-text-primary);text-decoration:none}
a.ytsg-ch-header-name:hover{text-decoration:underline}
.ytsg-ch-header-stats{font-size:0.8em;color:var(--color-text-secondary)}
.ytsg-ch-header-desc{margin:0;font-size:0.8em;color:var(--color-text-secondary);line-height:1.4;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
