/* --------------------------------------------------------------------------
   Styling for the public community surface (/community/) plus the moderation
   queue action buttons. Kept intentionally small and dependency-free — this is
   the dev shell, not final product chrome. Scoped under comm-* / mod-* class
   prefixes so it never collides with site.css or staff.css.
   -------------------------------------------------------------------------- */

.comm-shell {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a2e;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.comm-page-head h1 { font-size: 1.8rem; margin: 0 0 0.25rem; }
.comm-sub { color: #666; margin: 0 0 1rem; }
.comm-crumb { font-size: 0.9rem; margin-bottom: 0.75rem; }
.comm-crumb a { color: #6366f1; text-decoration: none; }
.comm-empty { color: #999; font-style: italic; }
.comm-empty a { color: #4f46e5; }

/* --- Search box ---------------------------------------------------------- */
.comm-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.comm-search__input {
  flex: 1;
  max-width: 420px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #c7c7d6;
  border-radius: 8px;
  font: inherit;
  color: #1a1a2e;
}
.comm-search__input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.comm-search__btn { flex: none; }
.comm-search__clear {
  color: #666;
  font-size: 0.9rem;
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .comm-search__clear:hover { color: #4f46e5; }
}

/* --- Sort tabs ----------------------------------------------------------- */
.comm-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e6e6ef;
  margin-bottom: 1.25rem;
}
.comm-tab {
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  color: #555;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 600;
}
.comm-tab.is-active { color: #4f46e5; border-bottom-color: #6366f1; }

/* --- Card grid ----------------------------------------------------------- */
.comm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.comm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0ec;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: box-shadow 0.15s, transform 0.15s;
}
/* Whole-card link stretched over the card (Bootstrap stretched-link idiom) so
   the byline can be a real <a> to the maker's profile without nested anchors. */
/* z-index 1 puts the overlay above the positioned .comm-card__cover, which
   would otherwise intercept clicks; the byline sits one level higher still. */
.comm-card__hit { position: absolute; inset: 0; z-index: 1; }
.comm-card__author {
  position: relative;
  z-index: 2;
  color: #666;
  font-size: 0.85rem;
  text-decoration: none;
  align-self: flex-start;
}
@media (hover: hover) and (pointer: fine) {
  .comm-card__author:hover { color: #4b47e0; text-decoration: underline; }
}
@media (hover: hover) and (pointer: fine) {
  .comm-card:hover {
    box-shadow: 0 6px 18px rgba(80, 70, 160, 0.15);
    transform: translateY(-2px);
  }
}
.comm-card__cover { position: relative; aspect-ratio: 1 / 1; background: #f4f4fb; }
.comm-card__cover .cover-svg { display: block; width: 100%; height: 100%; }
.comm-card__body { padding: 0.6rem 0.8rem 0.8rem; display: flex; flex-direction: column; gap: 0.15rem; }
.comm-card__title { font-weight: 700; font-size: 0.98rem; }
.comm-card__stats { color: #888; font-size: 0.82rem; display: flex; gap: 0.8rem; margin-top: 0.2rem; }

/* Featured ribbon (shared by card + detail cover). */
.comm-ribbon {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: #f59e0b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
}

/* --- Pagination ---------------------------------------------------------- */
.comm-pager {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.75rem;
}
.comm-pager a { color: #4f46e5; text-decoration: none; font-weight: 600; }
.comm-pager__disabled { color: #bbb; }
.comm-pager__status { color: #666; font-size: 0.9rem; }

/* --- Detail page --------------------------------------------------------- */
/* Mirrors the legacy community project view (and the ported /play/ page):
   a large player card on the left and an info panel on the right. */
.comm-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 1rem;
}
.comm-detail__header .comm-crumb { margin-bottom: 0; }
.comm-detail__learn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 1px solid #3d6df2;
  border-radius: 999px;
  color: #3d6df2;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}
@media (hover: hover) and (pointer: fine) {
  .comm-detail__learn:hover { background: #eef2ff; }
}

.comm-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .comm-detail__grid { grid-template-columns: 1fr; }
}

/* Player card: the screenshot fills the card; clicking the play button swaps
   in the embedded IDE player iframe. */
.comm-detail__player {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.comm-detail__player img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.comm-detail__player iframe { width: 100%; height: 100%; border: 0; display: block; }
.comm-detail__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 96px;
  height: 96px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (hover: hover) and (pointer: fine) {
  .comm-detail__play:hover { background: rgba(0, 0, 0, 0.7); }
}
.comm-detail__play svg { width: 40px; height: 40px; margin-left: 4px; }

/* Minecraft resource preview: imported rows show the real snapshot (the
   generic .comm-detail__player img rule above); unbound/demo rows show the
   same flat-colour placeholder tile the community cards use — a giant letter
   over the card's palette colour. */
.comm-detail__mctile {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
.comm-detail__mctile-letter {
  font-size: 9rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  opacity: 0.9;
  text-transform: uppercase;
  user-select: none;
}

/* Info panel. */
.comm-detail__panel h1 { margin: 0 0 0.25rem; font-size: 1.6rem; }
.comm-detail__by { margin: 0 0 0.2rem; color: #444; }
.comm-detail__remix { margin: 0 0 0.2rem; color: #556; font-size: 0.95rem; }
.comm-detail__date { margin: 0 0 0.9rem; color: #888; font-size: 0.9rem; }

/* REMIX PROJECT — the primary CTA (legacy .button.primary.large). The
   doubled class keeps it ahead of the .comm-btn base defined below. */
.comm-btn.comm-btn--remix {
  display: inline-block;
  margin: 0.4rem 0 0.75rem;
  padding: 0.7rem 1.75rem;
  border-radius: 999px;
  background: #ff7a00;
  border-color: #ff7a00;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
@media (hover: hover) and (pointer: fine) {
  .comm-btn.comm-btn--remix:hover { background: #e66e00; color: #fff; }
}

/* Left column: player card + the action row beneath it (legacy
   modal-play-project footer: views / likes / comments / share / report). */
.comm-detail__main { min-width: 0; }

/* Meta row under the actions: Credits / Description / Remix / Tags sit on the
   same level instead of stacking, wrapping when the column gets narrow. */
.comm-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.25rem;
  align-items: flex-start;
  margin-top: 0.75rem;
}
.comm-detail__meta .comm-detail__section { flex: 1 1 11rem; min-width: 10rem; }
.comm-detail__meta .comm-detail__section h3 { margin-top: 0.25rem; }
.comm-detail__meta .comm-btn--remix { flex: 0 0 auto; margin: 1.55rem 0 0; }

/* Action row: views / like / comments / share / report (legacy .community-actions). */
.comm-detail__actions {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  justify-content: center;
  margin: 0.75rem 0 0;
  color: #556;
}
.comm-detail__actions form { margin: 0; }
.comm-detail__action {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.comm-detail__action .icon { font-size: 1.25rem; }
@media (hover: hover) and (pointer: fine) {
  .comm-detail__action:hover { color: #4f46e5; }
}
.comm-detail__action.is-liked { color: #e11d48; }
.comm-detail__action--static { cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .comm-detail__action--static:hover { color: #556; }
}

/* Description / Tags blocks in the info panel. */
.comm-detail__section h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  color: #889;
  margin: 1.1rem 0 0.25rem;
}
.comm-detail__section p { margin: 0; white-space: pre-wrap; line-height: 1.5; }



/* Share dialog (same pattern as the /play/ page's share modal). */
.comm-share-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.comm-share-modal.is-open { display: flex; }
.comm-share-modal__box {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  width: 340px;
  max-width: 90vw;
  position: relative;
}
.comm-share-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.comm-share-modal__title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 16px;
  text-align: center;
}
.comm-share-modal__copy {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e8ef;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  word-break: break-all;
  font-size: 13px;
}
.comm-share-modal__social {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 18px;
}
.comm-share-modal__social a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.comm-share-modal__copied {
  color: #2a9d3f;
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}

/* Embed-code share dialog (live modal-share-project "Embed" tab) — same */
/* chrome as the share modal, plus a code textarea + Copy button.         */
.comm-embed-modal__stack { text-align: left; margin-bottom: 14px; }
.comm-embed-modal__label {
  display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px;
}
.comm-embed-modal__code {
  width: 100%; box-sizing: border-box;
  font-family: monospace; font-size: 12px;
  padding: 8px; border: 1px solid #9c9c9c; border-radius: 5px;
  resize: none;
}
.comm-embed-modal__copy {
  display: block; width: 100%;
  background: #766889; color: #fff;
  padding: 0.6rem 1rem; border: 0; border-radius: 5px;
  font: inherit; font-weight: 700; cursor: pointer; text-align: center;
}
@media (hover: hover) and (pointer: fine) {
  .comm-embed-modal__copy:hover { background: #443c4f; }
}

/* Concepts chips + Overview stats (live modal-play-project meta rows). */
.comm-detail__concepts { display: block; }
.comm-detail__concept {
  display: inline-block; padding: 3px 10px; margin: 0 6px 6px 0;
  background: #efeafb; color: #4b3a75; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.comm-overview { margin: 0; }
.comm-overview__row {
  display: flex; justify-content: space-between;
  padding: 4px 0; border-bottom: 1px solid #eef0f4;
}
.comm-overview__row dt,
.comm-overview__row dd { margin: 0; }
.comm-overview__row dd { font-weight: 700; }

/* ------------------------------------------------------------------------ */
/* Project modal (legacy modal-play-project): the project detail opens as an  */
/* overlay on the listing pages. Markup lives in project_modal.html; the      */
/* dialog reuses the .comm-detail__* grid via _project_detail_body.html. The  */
/* share dialog (z-index 1000) stacks above this.                             */
/* ------------------------------------------------------------------------ */
body.comm-modal-open { overflow: hidden; }
.comm-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 15, 30, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  /* The fragment is injected into host pages with their own text colour
     (e.g. the student dashboard's white-on-purple .stuhome) — reset to the
     card's text colour so modal content never inherits the host's. */
  color: #1a1a2e;
}
.comm-modal__dialog {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 1150px;
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.comm-modal__dialog--loading {
  padding: 5rem 2rem;
  text-align: center;
  color: #889;
  font-size: 1.05rem;
}
.comm-modal__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem 0.55rem 1.25rem;
  border-bottom: 1px solid #eee;
  flex: 0 0 auto;
}
.comm-modal__title {
  font-weight: 700;
  font-size: 1rem;
  color: #334;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comm-modal__close {
  border: 0;
  background: none;
  font-size: 1.7rem;
  line-height: 1;
  color: #667;
  cursor: pointer;
  padding: 0.15rem 0.5rem;
}
@media (hover: hover) and (pointer: fine) {
  .comm-modal__close:hover { color: #222; }
}
.comm-modal__scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem 1.5rem 1.5rem;
}
.comm-modal .comm-detail__grid { margin-top: 0; }

/* --- Buttons (detail + moderation) --------------------------------------- */
.comm-btn, .mod-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: 1px solid #c7c7d6;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.comm-btn--play { background: #6366f1; border-color: #6366f1; color: #fff; }
.comm-btn--like.is-liked { background: #fdecef; border-color: #f43f5e; color: #be123c; }
.comm-like-count { font-weight: 700; }

/* Report/flag button — a quiet, low-emphasis action until hovered, when it
   takes on a warning (amber) tint to read as "flag this". */
.comm-btn--report { color: #b45309; border-color: #d9c8a8; }
@media (hover: hover) and (pointer: fine) {
  .comm-btn--report:hover { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
}

.mod-btn { padding: 0.35rem 0.7rem; font-size: 0.85rem; margin-right: 0.25rem; }
@media (hover: hover) and (pointer: fine) {
  .mod-btn:hover { border-color: #6366f1; }
}

/* --- Flash messages (comment rejected / report thanks / publish success) - */
.comm-messages { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.comm-message {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}
.comm-message--success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.comm-message--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.comm-message--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* --- Author state banner ------------------------------------------------- */
.comm-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
}
.comm-banner--rejected { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.comm-banner--pending { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* --- Comments ------------------------------------------------------------ */
/* Live renders the thread as sticker pills: avatar badge + pill carrying the */
/* canned comment's icon + text. No dates or flags on the row.               */
.comm-comments { margin-top: 0; }
.comm-comments h2 { font-size: 1.2rem; margin: 0 0 0.75rem; }
.comm-comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.comm-comment {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.comm-comment__avatar.comm-avatar {
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.85rem;
  text-decoration: none;
}
.comm-comment__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid #e0e0ec;
  background: #f7f7fb;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-weight: 700;
  font-size: 0.9rem;
}
.comm-comment__icon { font-size: 1rem; line-height: 1; }
.comm-comment.is-pending .comm-comment__pill { background: #fffbeb; border-color: #fde68a; }
.comm-comment__note { color: #92400e; font-size: 0.8rem; font-style: italic; }

/* Per-comment report/flag — kept only on free-text comments (canned ones are
   pre-vetted); a small inline flag that only colors up on hover. */
.comm-comment__report { margin: 0; }
.comm-comment__report-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
  color: #b8b8c6;
  font-size: 0.95rem;
  line-height: 1;
}
@media (hover: hover) and (pointer: fine) {
  .comm-comment__report-btn:hover { color: #b45309; background: #fffbeb; }
}

.comm-comment-form { display: flex; flex-direction: column; gap: 0.5rem; max-width: 520px; }
.comm-comment-form textarea {
  border: 1px solid #c7c7d6; border-radius: 8px; padding: 0.6rem; font: inherit; resize: vertical;
}
.comm-comment-form button { align-self: flex-start; }
.comm-signin-note { color: #666; }
.comm-signin-note a { color: #4f46e5; }

/* --- Canned / templated safe comments (COMM-037) ------------------------- */
/* One-tap pre-vetted comments the student can post without typing (COPPA-safe).
   They live in a popover behind a "React" button so the sticker list doesn't
   clutter the modal — same idea as live's Send Some Love popover. */
.comm-react { position: relative; display: inline-block; margin: 0.75rem 0 1rem; }
.comm-react__pop {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.5rem);
  right: 0;
  z-index: 5;
  width: 30rem;
  max-width: 80vw;
  background: #fff;
  border: 1px solid #e0e0ec;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 20, 40, 0.18);
  padding: 0.9rem 1rem;
}
.comm-react__pop.is-open { display: block; }
/* Flipped variant for when opening up would clip against the top edge of the
   scrollable container (the modal's .comm-modal__scroll). Set by the toggle
   handler in _project_detail_js.html. */
.comm-react__pop--down { bottom: auto; top: calc(100% + 0.5rem); }
.comm-canned__label { font-size: 0.85rem; color: #555; margin: 0 0 0.4rem; font-weight: 600; }
.comm-canned__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.comm-canned__list form { margin: 0; }
.comm-canned__btn {
  border: 1px solid #c7c7d6; background: #f7f7fb; border-radius: 999px;
  padding: 0.3rem 0.75rem; font: inherit; font-size: 0.85rem; color: #333;
  cursor: pointer; line-height: 1.2;
}
@media (hover: hover) and (pointer: fine) {
  .comm-canned__btn:hover { background: #eef2ff; border-color: #6366f1; color: #4f46e5; }
}
.comm-canned__icon { margin-right: 0.15rem; }

/* --- Publish page (Share to community) ----------------------------------- */
/* The publish confirm form belongs visually with the community pages: same
   comm-shell frame, same input/button treatment as the comment form. */
.comm-publish { max-width: 640px; }
.comm-publish h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
.comm-publish__intro { color: #555; line-height: 1.5; margin: 0 0 1.25rem; }

.comm-publish-form { display: flex; flex-direction: column; gap: 0.4rem; }
.comm-publish-form label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
  margin-top: 0.6rem;
}
.comm-publish-form input,
.comm-publish-form textarea {
  border: 1px solid #c7c7d6;
  border-radius: 8px;
  padding: 0.6rem;
  font: inherit;
  color: #1a1a2e;
  resize: vertical;
}
.comm-publish-form input:focus,
.comm-publish-form textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.comm-publish-form button { align-self: flex-start; margin-top: 1rem; }

/* --- Follow button, view count, who-liked, unpublish, comment delete ------ */
/* COMM-040/041/032/024/036/045 — reuse the shared .comm-btn base treatment. */

/* Follow / unfollow toggle (author line + follow lists). */
.comm-follow { display: inline-block; margin-left: 0.5rem; }
.comm-btn--follow { padding: 0.2rem 0.7rem; font-size: 0.85rem; }
.comm-btn--follow.is-following {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4338ca;
}

/* Author take-down of a live project. */
.comm-btn--unpublish { color: #b45309; border-color: #d9c8a8; }
@media (hover: hover) and (pointer: fine) {
  .comm-btn--unpublish:hover { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
}

/* "Liked by" list on the detail page. */
.comm-detail__likers { color: #555; font-size: 0.9rem; margin: 0.75rem 0 0; }
.comm-detail__likers-label { font-weight: 600; color: #333; }
.comm-liker { color: #4338ca; }

/* Delete-my-comment control (mirrors the report control's placement). */
.comm-comment__delete { margin: 0; }
.comm-comment__delete-btn {
  border: 1px solid transparent;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
}
@media (hover: hover) and (pointer: fine) {
  .comm-comment__delete-btn:hover { color: #be123c; background: #fdecef; }
}

/* Follow lists page (Following / Followers columns). */
.comm-follow-cols { display: flex; gap: 2rem; flex-wrap: wrap; }
.comm-follow-col { flex: 1 1 260px; }
.comm-follow-count { color: #6366f1; font-weight: 600; }
.comm-follow-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.comm-follow-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ececf4;
}
.comm-follow-name { font-weight: 600; color: #1a1a2e; }

/* Top Creators leaderboard (COMM-013 / COMM-034). */
.comm-page-head__links { margin: 0.25rem 0 0; }
.comm-page-head__links a { color: #6366f1; font-weight: 600; text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .comm-page-head__links a:hover { text-decoration: underline; }
}
.comm-creators { list-style: none; margin: 0; padding: 0; }
.comm-creator {
  padding: 1rem 0;
  border-bottom: 1px solid #ececf4;
}
.comm-creator__head { display: flex; align-items: center; gap: 0.75rem; }
.comm-creator__rank {
  font-weight: 700;
  font-size: 1.1rem;
  color: #6366f1;
  min-width: 2.25rem;
}
.comm-creator__name { display: block; font-weight: 700; color: #1a1a2e; }
.comm-creator__stats { color: #666; font-size: 0.85rem; }
.comm-creator__stats span { margin: 0 0.15rem; color: #bbb; }
.comm-creator__projects { margin-top: 0.75rem; }

/* --- Public profiles (COMM-053/054/003/009/056) -------------------------- */
/* Deterministic initial-avatar badge (colour set inline from the username). */
.comm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  flex: none;
  line-height: 1;
}
.comm-avatar--lg { width: 4.5rem; height: 4.5rem; font-size: 2rem; }

/* Role badge (Teacher). */
.comm-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.comm-badge--teacher { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }

/* Profile header (avatar + name + follow/edit). */
.comm-profile__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.comm-profile__name { margin: 0; font-size: 1.6rem; }
.comm-profile__handle { margin: 0.1rem 0 0.6rem; color: #888; font-size: 0.95rem; }
.comm-profile__head .comm-follow { margin-left: 0; }

/* Stats row. */
.comm-profile__stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0.9rem 0;
  margin: 0 0 1.25rem;
  border-top: 1px solid #ececf4;
  border-bottom: 1px solid #ececf4;
  color: #666;
  font-size: 0.92rem;
}
.comm-profile__stats strong { color: #1a1a2e; font-size: 1.05rem; }
.comm-profile__section { font-size: 1.2rem; margin: 0 0 0.75rem; }

/* Maker directory grid + cards. */
.comm-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
}
.comm-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 1.1rem 0.8rem;
  border: 1px solid #e0e0ec;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
@media (hover: hover) and (pointer: fine) {
  .comm-profile-card:hover {
    box-shadow: 0 6px 18px rgba(80, 70, 160, 0.15);
    transform: translateY(-2px);
  }
}
.comm-profile-card__name { font-weight: 700; color: #1a1a2e; }
.comm-profile-card__stats { color: #888; font-size: 0.82rem; }

/* Inline username link (author line, likers, comment authors, follow lists). */
.comm-userlink { color: #4338ca; text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .comm-userlink:hover { text-decoration: underline; }
}

/* --- Showcase page (WWWC-04, www/showcase.tpl.php) ----------------------- */
/* Photo-banner header over the gallery (legacy .page-header.photo-banner). */
.showcase-banner {
  background: linear-gradient(120deg, #4f46e5, #7c3aed);
  color: #fff;
  padding: 1.75rem 0;
  margin-bottom: 1.5rem;
}
.showcase-banner h1 { margin: 0; font-size: 2rem; }
.showcase-shell { padding-top: 0; }
/* Two-column split: main gallery + right owner panel (legacy .two-column). */
.showcase-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 760px) {
  .showcase-cols { grid-template-columns: 1fr; }
}
.showcase-title { font-size: 1.5rem; margin: 0 0 0.25rem; }
/* Owner identity panel (legacy .user-panel-wrap). */
.user-panel {
  border: 1px solid #e0e0ec;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.user-panel__header {
  background: #f4f4fb;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e6e6ef;
}
.user-panel__header h6 { margin: 0; color: #555; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.04em; }
.user-panel__body { padding: 1rem; text-align: center; }
.user-panel__avatar img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: #f4f4fb;
}
.user-panel__body h4 { margin: 0.5rem 0 0.25rem; color: #1a1a2e; }
.user-panel__since { color: #888; font-size: 0.85rem; margin: 0 0 0.75rem; }
.user-panel__class { border-top: 1px solid #eee; padding-top: 0.75rem; }
.user-panel__class h6 { margin: 0 0 0.25rem; color: #4338ca; }
.user-panel__class p { margin: 0; color: #666; font-size: 0.9rem; }

/* --------------------------------------------------------------------- */
/* Kids-games catalog sections (WWWC-08): a titled row of project cards.  */
/* --------------------------------------------------------------------- */
.comm-section { margin: 2rem 0; }
.comm-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 0.75rem;
}
.comm-section__head h2 { margin: 0; color: #1a1a2e; font-size: 1.25rem; }
.comm-section__more { color: #4338ca; font-weight: 600; white-space: nowrap; }

/* --------------------------------------------------------------------- */
/* Community notifications (COMM-046/047/048/049) + activity feed badge.  */
/* --------------------------------------------------------------------- */
.comm-notif-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  max-width: 640px;
}
.comm-notif-item {
  padding: 0.85rem 1rem;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: #fff;
  color: #333;
  line-height: 1.5;
}
/* An unread notification gets an accent bar + tint until the list is viewed. */
.comm-notif-item.is-unread {
  border-left: 4px solid #4338ca;
  background: #f4f4fb;
}
.comm-notif-item a { color: #4338ca; font-weight: 600; }
.comm-notif-time {
  display: block;
  color: #999;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}
/* Small unread-count pill for the "My Community" nav link. */
.comm-notif-badge {
  display: inline-block;
  min-width: 1.1rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2rem;
}

/* ======================================================================== */
/* Gallery detail (live basic-community-gallery-item.directive +           */
/* GalleryDetails.jsx + BasicCommunityHeader) — dark dashboard page on the  */
/* .stuhome gradient: minimal back/logo/avatar header over a full-bleed     */
/* rgba(0,0,0,.3) hero band, framed cover card, Owner/Tags/actions row,     */
/* member ty-project-card grid (stucom__grid) below.                        */
/* ======================================================================== */
.galdetail { padding-bottom: 4rem; }
.galdetail__band { background: rgba(0, 0, 0, 0.3); }
.galdetail__section {
  max-width: 70rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* --- Minimal community header (BasicCommunityHeader.scss) --------------- */
.galdetail__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4rem;
}
.galdetail__top-left { display: flex; align-items: center; }
.galdetail__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  width: 3.5rem;
  border-radius: 2rem;
  background: linear-gradient(122deg, #797AEB 0%, #A06EF2 100%);
}
.galdetail__back svg { height: 1.15rem; width: auto; display: block; }
.galdetail__logo { display: inline-block; margin: 0 1.5rem; }
.galdetail__logo img { height: 2rem; width: 10rem; }
.galdetail__account { position: relative; z-index: 40; }
.galdetail__userinfo {
  display: inline-block;
  text-align: left;
  border: none;
  border-radius: 1.25rem;
  padding: 0.125rem 1.25rem 0.125rem 0;
  cursor: pointer;
  background: transparent;
  position: relative;
}
.galdetail__userinfo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(122deg, #797AEB 0%, #A06EF2 100%);
  border: 0.063rem solid #AFAEAF;
  border-radius: 1.875rem;
  opacity: 0.5;
}
.galdetail__prof-pic {
  display: inline-block;
  vertical-align: top;
  width: 1.875rem;
  height: 1.875rem;
  background-color: #fff;
  border-radius: 50%;
  margin: 0.313rem 0.313rem 0.063rem;
}
.galdetail__prof-pic img { border-radius: inherit; width: 100%; height: 100%; }
/* Caret to the right of the avatar (live draws it on .prof-pic::after). */
.galdetail__userinfo::before {
  content: "";
  position: absolute;
  right: 0.55rem;
  top: 50%;
  margin-top: -0.2rem;
  border-left: 0.375rem solid transparent;
  border-right: 0.375rem solid transparent;
  border-top: 0.375rem solid #fff;
  opacity: 0.42;
}
.galdetail__login {
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 1.25rem;
  padding: 0.45rem 1.1rem;
}
.galdetail__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  min-width: 9rem;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.625rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}
.galdetail__menu::before {
  content: "";
  position: absolute;
  right: 1.1rem;
  top: -0.313rem;
  border-style: solid;
  border-width: 0 0.313rem 0.313rem;
  border-color: transparent transparent #fff;
}
.galdetail__menu a {
  color: #555;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.375rem 0.625rem;
}
@media (hover: hover) and (pointer: fine) {
  .galdetail__menu a:hover { color: #000; }
}
/* display:flex above would override the [hidden] UA rule — keep it honored. */
.galdetail__menu[hidden] { display: none; }

/* --- Hero (GalleryDetails.jsx) ------------------------------------------- */
.galdetail__hero { display: flex; margin-bottom: 2rem; }
.galdetail__cover {
  width: 224px;
  height: 163px;
  background: #4242a7;
  border-radius: 8px;
  border: 8px solid #7764c0;
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
}
.galdetail__cover-frame {
  width: 224px;
  height: 163px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 6px solid #fff;
  position: absolute;
  top: 8px;
  left: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  background: #fff;
}
.galdetail__cover-frame img { width: fit-content; height: 100%; }
.galdetail__data { margin-left: 4rem; width: 100%; }
.galdetail__title {
  color: #fff;
  text-transform: uppercase;
  margin: 0;
  word-break: break-word;
  /* Live's Title is a plain h3 — app-www.css paints it 25px bold; the meyer
     reset strips weight, so assert it explicitly. */
  font-size: 1.5rem;
  font-weight: 700;
}
.galdetail__desc { color: #fff; word-break: break-word; }
.galdetail__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.galdetail__meta-left {
  display: flex;
  flex: 50%;
  justify-content: space-between;
  align-items: flex-start;
}
.galdetail__owner {
  min-width: 20%;
  color: #fff;
  font-weight: bold;
  position: relative;
}
.galdetail__owner-img {
  display: inline-block;
  width: 3.125rem;
  height: 3.125rem;
  background-color: #fac422;
  border: 5px solid #fff;
  border-radius: 0.8rem;
  margin-top: 0.8rem;
  cursor: pointer;
  object-fit: cover;
}
/* TopMakerCard hover popup (live: absolute right -5rem, #7065a3 card). */
.galdetail__owner-pop {
  position: absolute;
  left: 0;
  padding-top: 0.5rem;
  z-index: 10;
  display: none;
}
.galdetail__owner:hover .galdetail__owner-pop,
.galdetail__owner:focus-within .galdetail__owner-pop { display: block; }
.galdetail__owner-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #7065a3;
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  min-width: 16rem;
}
.galdetail__owner-card-img {
  width: 3rem;
  height: 3rem;
  border-radius: 0.6rem;
  background-color: #fac422;
  border: 3px solid #fff;
  object-fit: cover;
}
.galdetail__owner-card-name { color: #fff; font-weight: bold; }
.galdetail__owner-card-stats {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 400;
  margin-top: 0.2rem;
}
.galdetail__owner-card-stats span { opacity: 0.6; margin: 0 0.3rem; }
.galdetail__tags {
  width: 70%;
  margin-left: 1rem;
  color: #fff;
  font-weight: bold;
}
.galdetail__tags-inner {
  display: flex;
  flex-flow: wrap;
  margin-top: 0.8rem;
  font-size: 0.875rem;
  font-weight: 400;
}
.galdetail__tags-inner a {
  color: #fff;
  text-decoration: underline;
  margin-right: 1rem;
  line-height: 1.4rem;
}

/* --- Action row: share/report circle icons + orange FOLLOW GALLERY ------- */
.galdetail__actions {
  display: flex;
  align-items: center;
}
.galdetail__icon-btn {
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  margin-right: 0.6rem;
  padding: 0;
  cursor: pointer;
}
.galdetail__icon-btn svg { width: 1.813rem; height: 1.813rem; display: block; }
.galdetail__follow {
  cursor: pointer;
  background-color: #ff8d1a;
  border: 1px solid #ff8d1a;
  color: #fff;
  border-radius: 0.313rem;
  font-weight: bold;
  padding: 0.625rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.2rem;
  margin-left: 1.4rem;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  font-family: inherit;
}
@media (hover: hover) and (pointer: fine) {
  .galdetail__follow:hover { background-color: #E67400; }
}

/* --- Member grid ---------------------------------------------------------- */
.galdetail__grid-wrap {
  /* A <main> under .stuhome becomes a column flex item — margin:auto alone
     would shrink it to fit-content, so pin the width explicitly. */
  width: 100%;
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}
.galdetail__grid-wrap .stucom__pages { margin-top: 2rem; }

@media only screen and (max-width: 1024px) {
  .galdetail__meta { flex-direction: column; align-items: stretch; }
  .galdetail__meta-left { flex: none; }
  .galdetail__owner { min-width: auto; }
  .galdetail__tags { width: auto; margin-left: 2rem; }
  .galdetail__actions { margin-top: 1.5rem; }
}
@media only screen and (max-width: 767px) {
  .galdetail__top { margin-bottom: 2.5rem; }
  .galdetail__back { width: 2rem; }
  .galdetail__logo { margin: 0 0.8rem; }
  .galdetail__logo img { width: 8rem; }
  .galdetail__hero {
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
  }
  .galdetail__data { margin-left: 0; }
  .galdetail__title { margin-top: 2.5rem; text-align: center; }
  .galdetail__desc { text-align: center; }
}
@media only screen and (max-width: 350px) {
  .galdetail__follow { font-size: 0.66rem; margin-left: 1rem; }
}

/* --- Class-share preview modal (dashboards/_showcase_preview_modal.html) ---- */
/* The showcase preview is rendered statically in the page (unlike the
   community modal which is fetched into #comm-modal-host), so it needs the
   hidden-attribute guard and a slimmer single-column dialog. */
.comm-modal[hidden] { display: none; }
.comm-modal__dialog--preview { max-width: 720px; }
.comm-detail__grid--preview { grid-template-columns: 1fr; }
.comm-detail__player [hidden] { display: none; }
/* Meta rows toggle via the hidden attr; author display rules on
   .comm-btn/.comm-detail__section would override the UA hidden style. */
.comm-detail__meta [hidden] { display: none; }
.comm-detail__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b7c0cd;
  font-size: 54px;
}
.showcase-modal__author { color: #4338ca; text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .showcase-modal__author:hover { text-decoration: underline; }
}
