/* Keep section markers inside the rail; their labels render outside its scroll area. */
#creator-sidebar {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

#creator-sidebar > * {
  flex-shrink: 0;
}

body #creator-sidebar.sidebar > .side-heading {
  display: flex;
  align-items: center;
  justify-content: var(--side-heading-align, flex-start);
  min-height: var(--side-heading-height, auto);
  margin: var(--side-heading-margin, 21px 0 9px);
}

#creator-sidebar .side-heading h2 {
  display: var(--side-heading-text, block);
}

#creator-sidebar .side-section-icon {
  display: var(--side-section-icon, none);
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 3px;
  color: #efeff1;
}

#creator-sidebar .side-section-icon > svg {
  width: 20px;
  height: 20px;
}

#creator-sidebar .side-section-icon:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 1px;
}

#creator-sidebar :is(#side-following, #side-creators, #side-categories) {
  display: block;
  margin-top: 0;
}

#creator-sidebar .side-creator {
  justify-content: var(--side-row-align, flex-start);
  min-height: var(--side-creator-height, 46px);
  padding: var(--side-creator-padding, 7px 0);
}

#creator-sidebar .side-creator > img {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

#creator-sidebar .side-category {
  justify-content: var(--side-row-align, flex-start);
  min-height: var(--side-category-height, 48px);
  padding: var(--side-category-padding, 7px 0);
}

#creator-sidebar .side-category > img {
  flex: 0 0 30px;
  width: 30px;
  height: 40px;
  object-fit: cover;
  border-radius: 0;
}

.sidebar-label {
  position: fixed;
  z-index: 170;
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 5px 8px;
  border-radius: 3px;
  background: #efeff1;
  color: #0e0e10;
  box-shadow: 0 2px 7px #0006;
  font: 600 12px/1.35 Arial, 'Segoe UI', sans-serif;
  overflow-wrap: anywhere;
  pointer-events: auto;
}

.sidebar-label[hidden] {
  display: none !important;
}

@media (min-width: 1001px) {
  body.sidebar-collapsed {
    --side-heading-align: center;
    --side-heading-height: 30px;
    --side-heading-margin: 6px 0 2px;
    --side-heading-text: none;
    --side-section-icon: grid;
    --side-row-align: center;
    --side-creator-height: 38px;
    --side-creator-padding: 4px 0;
    --side-category-height: 44px;
    --side-category-padding: 2px 0;
  }
}

@media (max-width: 1000px) {
  body:not(.sidebar-open) {
    --side-heading-align: center;
    --side-heading-height: 30px;
    --side-heading-margin: 6px 0 2px;
    --side-heading-text: none;
    --side-section-icon: grid;
    --side-row-align: center;
    --side-creator-height: 38px;
    --side-creator-padding: 4px 0;
    --side-category-height: 44px;
    --side-category-padding: 2px 0;
  }
}

/* Transparent avatar artwork shows the surrounding surface, without a dark disc. */
#creator-sidebar .side-creator > img,
.avatar,
.feature-identity > img { background: transparent; }
#creator-sidebar .side-creator > img[src*="/xfg-icon-fit-2026-"],
img.avatar[src*="/xfg-icon-fit-2026-"],
.feature-identity > img[src*="/xfg-icon-fit-2026-"] {
  object-fit: contain;
  border: 0;
  border-radius: 0;
}

/* Desktop starts with the category/channel rail. Mobile keeps its existing navigation. */
@media (min-width: 761px) {
  body #creator-sidebar.sidebar { padding-top: 40px; }
  body #creator-sidebar.sidebar > :is(.sidebar-top, .side-home, .sidebar-bottom) { display: none; }
}

/* Empty followed channels should not leave a standalone heart in the compact rail. */
body #creator-sidebar.sidebar > .side-heading.is-empty-rail-group { display: none; }

/* A compact rail must not squeeze artwork against the global img max-width. */
#creator-sidebar .side-category>img,#creator-sidebar .side-creator>img{min-width:30px;max-width:30px}
