/* BANDIBOOK: shared central content width, after existing menu styles. */
html body #page,
html body #page.my-space,
html body #page.my-feed,
html body:has(.rc) #page {
  box-sizing: border-box;
  width: 100%;
  max-width: 1440px !important;
  margin-inline: auto;
  padding-inline: 32px;
}
html body #page .rc,
html body #page .my-space,
html body #page .following-posts {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
}
@media (max-width: 1150px) {
  html body #page,
  html body #page.my-space,
  html body #page.my-feed,
  html body:has(.rc) #page { padding-inline: 24px; }
}
@media (max-width: 760px) {
  html body #page,
  html body #page.my-space,
  html body #page.my-feed,
  html body:has(.rc) #page { padding-inline: 14px; }
}

/* Keep the full school channel list reachable at normal browser zoom. */
html body #sidebar { height: 100dvh; max-height: 100dvh; }
html body #sidebar .side-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #b7a2d4 #f5f1fa;
  -ms-overflow-style: auto;
}
html body #sidebar .side-scroll::-webkit-scrollbar {
  display: block;
  width: 7px;
}
html body #sidebar .side-scroll::-webkit-scrollbar-track { background: #f5f1fa; }
html body #sidebar .side-scroll::-webkit-scrollbar-thumb {
  background: #b7a2d4;
  border-radius: 8px;
}
html body #sidebar .brand,
html body #sidebar .account { flex-shrink: 0; }
html body.has-composer #page {
  padding-bottom: calc(var(--composer-height, 200px) + 64px + env(safe-area-inset-bottom));
}
html body.app-shell.has-composer #page {
  padding-bottom: calc(var(--composer-height, 200px) + var(--app-tabs-height, 0px) + 64px + env(safe-area-inset-bottom));
}

/* Popular posts: compact purple ranking cards. */
html body .community-popular {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible;
}
html body .community-popular .panel-head {
  padding: 4px 2px 16px;
  border: 0;
  align-items: center;
  gap: 10px;
}
html body .community-popular .panel-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #352445;
  font-size: 19px;
  letter-spacing: -.6px;
}
html body .community-popular .panel-head h2 span {
  padding: 5px 9px;
  border-radius: 8px;
  background: #eee5fb;
  color: #7952b6 !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
}
html body .community-popular .panel-head small { color: #978aa3; font-size: 11px; }
html body .community-popular .popular-list {
  padding: 0;
  gap: 10px;
  background: transparent;
}
html body .community-popular .popular-post {
  min-height: 88px;
  padding: 16px;
  gap: 14px;
  background: #fff;
  border: 1px solid #eae3f1;
  border-radius: 17px;
  box-shadow: 0 3px 12px #5c397505;
  transition: background .15s, border-color .15s;
}
html body .community-popular .popular-post:hover {
  background: #faf6ff;
  border-color: #cbb2e7;
}
html body .community-popular .popular-post:focus-visible {
  outline: 2px solid #9568c9;
  outline-offset: 3px;
}
html body .community-popular .rank {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 42px;
  border-radius: 13px;
  color: #8763b3 !important;
  background: #f2ebfb;
  font-size: 20px;
  font-weight: 800;
}
html body .community-popular .popular-post:first-child .rank {
  color: #fff !important;
  background: linear-gradient(145deg, #9e78d2, #7547af);
}
html body .community-popular .popular-post b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #93869f;
  font-size: 11px;
}
html body .community-popular .popular-post p {
  margin: 6px 0 0;
  color: #372641;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}
html body .community-popular .popular-post small {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 20px;
  background: #f6effc;
  color: #9165bb;
  font-size: 11px;
}
@media (max-width: 760px) {
  html body .community-popular .panel-head { align-items: flex-start; }
  html body .community-popular .popular-post { min-height: 78px; padding: 13px; gap: 11px; }
  html body .community-popular .popular-post p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html body .community-popular .popular-post { transition: none; }
}
