/* ==========================================================================
   Beltchecker — forum (topic lists, threads, composer) and reaction pills
   Markup: forum_topics.php, forum_read.php, index_card_*forum*.php,
   likeButtons()/likeSummary() in functions_likes.php.
   Tokens from styles/modern.css.
   ========================================================================== */

/* ---------- Shared: toolbar + buttons ---------- */

.bc-forum-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 14px;
}
.bc-forum-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--bc-line-strong, rgba(15, 15, 25, 0.12));
  border-radius: 999px;
  background: var(--bc-surface, #fff);
  color: var(--bc-ink, #0b0b10);
  font: 600 13.5px/1 var(--bc-font, inherit);
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.2s var(--bc-ease, ease), box-shadow 0.2s var(--bc-ease, ease), background-color 0.2s var(--bc-ease, ease);
}
.bc-forum-btn:hover { transform: translateY(-1px); box-shadow: var(--bc-shadow-2); }
.bc-forum-btn:focus-visible { outline: none; box-shadow: var(--bc-ring); }
.bc-forum-btn--primary {
  border-color: transparent;
  background: var(--bc-ink, #0b0b10);
  color: var(--bc-on-ink);
}
.bc-forum-btn--primary:hover { background: #1c1c26; }

/* ---------- Forum shell + header (forum.php) ---------- */

.bc-forum-shell { width: 100%; max-width: 1180px; margin: 0 auto; min-width: 0; }
.bc-forum-shell--thread { max-width: 1080px; }

.bc-fhead {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 14px;
  padding: 0;
  min-width: 0;
}

/* Forum tabs: pills, active = ink; scroll sideways with a fade edge when they don't fit */
.bc-ftabs {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.bc-ftabs::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 28px;
  background: linear-gradient(90deg, rgba(244, 244, 246, 0), var(--bc-bg, #f4f4f6));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s var(--bc-ease, ease);
}
.bc-ftabs::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  z-index: 1;
  width: 24px;
  background: linear-gradient(270deg, rgba(244, 244, 246, 0), var(--bc-bg, #f4f4f6));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s var(--bc-ease, ease);
}
.bc-ftabs.is-overflowing::after { opacity: 1; }
.bc-ftabs.is-scrolled-end::after { opacity: 0; }
.bc-ftabs.is-scrolled-start::before { opacity: 1; }
.bc-ftabs-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 3px 2px;
  scroll-padding: 0 24px;
}
.bc-ftabs-scroll::-webkit-scrollbar { display: none; }
.bc-ftab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--bc-surface, #fff);
  box-shadow: inset 0 0 0 1px var(--bc-line-strong, rgba(15, 15, 25, 0.12));
  color: var(--bc-ink-2, #3a3a44) !important;
  font: 600 13.5px/1 var(--bc-font, inherit);
  letter-spacing: -0.005em;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 0.2s var(--bc-ease, ease), color 0.2s var(--bc-ease, ease), box-shadow 0.2s var(--bc-ease, ease);
}
.bc-ftab:hover { background: var(--bc-surface-3, #eeeef2); color: var(--bc-ink, #0b0b10) !important; }
.bc-ftab:focus-visible { outline: none; box-shadow: var(--bc-ring); }
.bc-ftab.is-active {
  background: var(--bc-ink, #0b0b10);
  box-shadow: none;
  color: var(--bc-on-ink) !important;
}
.bc-ftab i { font-size: 13px; }

/* Thread pages: back to the forum */
.bc-fhead-back {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bc-ink-2, #3a3a44) !important;
  font: 600 14px/1.2 var(--bc-font, inherit);
  text-decoration: none !important;
}
.bc-fhead-back i {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 999px;
  background: var(--bc-surface, #fff);
  box-shadow: inset 0 0 0 1px var(--bc-line-strong, rgba(15, 15, 25, 0.12));
  font-size: 12px;
  transition: transform 0.2s var(--bc-ease, ease);
}
.bc-fhead-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-fhead-back:hover i { transform: translateX(-2px); }

.bc-fhead-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bc-fhead-new { height: 38px; text-decoration: none !important; color: #fff !important; white-space: nowrap; }

/* Search: rounded field with an icon, widens on focus */
.bc-fsearch { display: flex; align-items: center; margin: 0; }
.bc-fsearch-toggle { display: none; }
.bc-fsearch-field {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}
.bc-fsearch-field > i {
  position: absolute;
  left: 13px;
  color: var(--bc-faint, #9a9aa5);
  font-size: 13px;
  pointer-events: none;
}
.bc-fsearch-field input {
  width: 168px;
  height: 38px;
  margin: 0;
  padding: 0 14px 0 35px;
  border: 0;
  border-radius: 999px;
  background: var(--bc-surface, #fff);
  box-shadow: inset 0 0 0 1px var(--bc-line-strong, rgba(15, 15, 25, 0.12));
  color: var(--bc-ink, #0b0b10);
  font: 500 13.5px/1 var(--bc-font, inherit);
  transition: width 0.3s var(--bc-ease, ease), box-shadow 0.2s var(--bc-ease, ease);
  -webkit-appearance: none;
  appearance: none;
}
.bc-fsearch-field input::-webkit-search-decoration { -webkit-appearance: none; }
.bc-fsearch-field input::placeholder { color: var(--bc-faint, #9a9aa5); }
.bc-fsearch-field input:focus { outline: none; width: 250px; box-shadow: inset 0 0 0 1px var(--bc-ink, #0b0b10), var(--bc-ring); }
.bc-fsearch.has-value .bc-fsearch-field input { width: 230px; }

/* Rules chip */
.bc-fchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--bc-surface-3, #eeeef2);
  color: var(--bc-ink-2, #3a3a44);
  font: 600 13px/1 var(--bc-font, inherit);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s var(--bc-ease, ease);
}
.bc-fchip:hover, .bc-fchip[aria-expanded="true"] { background: #e3e3e9; color: var(--bc-ink, #0b0b10); }
.bc-fchip:focus-visible { outline: none; box-shadow: var(--bc-ring); }

/* Rules popover (desktop) */
.bc-frules {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  padding: 18px 20px 16px;
  border-radius: var(--bc-r, 14px);
  background: var(--bc-surface, #fff);
  box-shadow: var(--bc-shadow-3), 0 0 0 1px var(--bc-line, rgba(15, 15, 25, 0.07));
  color: var(--bc-ink-2, #3a3a44);
  font-size: 14px;
  line-height: 1.55;
  transform-origin: top right;
  animation: bcFrulesIn 0.22s var(--bc-ease, ease);
}
.bc-frules[hidden], .bc-frules-backdrop[hidden] { display: none !important; }
.bc-frules-title { margin: 0 32px 10px 0; color: var(--bc-ink, #0b0b10); font: 700 16px/1.3 var(--bc-font, inherit); letter-spacing: -0.01em; }
.bc-frules p { margin: 0; }
.bc-frules-list { margin: 0; padding: 0; list-style: none; }
.bc-frules-list li { position: relative; padding: 5px 0 5px 22px; }
.bc-frules-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--bc-accent, #5b4bd1);
  opacity: 0.55;
}
.bc-frules-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bc-muted, #6b6b76);
  cursor: pointer;
}
.bc-frules-close:hover { background: var(--bc-surface-3, #eeeef2); color: var(--bc-ink, #0b0b10); }
.bc-frules-grip, .bc-frules-backdrop { display: none; }
@keyframes bcFrulesIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }

/* First-visit hint */
.bc-fhint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 16px 14px;
  padding: 9px 8px 9px 14px;
  border-radius: 999px;
  background: rgba(91, 75, 209, 0.07);
  color: var(--bc-ink-2, #3a3a44);
  font-size: 13px;
  line-height: 1.35;
}
.bc-fhint[hidden] { display: none; }
.bc-fhint > i { color: var(--bc-accent, #5b4bd1); }
.bc-fhint > span { flex: 1 1 auto; min-width: 0; }
.bc-fhint-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--bc-accent, #5b4bd1);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.bc-fhint-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bc-muted, #6b6b76);
  cursor: pointer;
}
.bc-fhint-close:hover { background: rgba(91, 75, 209, 0.1); }

/* Tablet: tabs get their own row above the actions */
@media (max-width: 1080px) {
  .bc-forum-shell--list .bc-fhead { flex-wrap: wrap; }
  .bc-forum-shell--list .bc-ftabs { flex-basis: 100%; }
  .bc-forum-shell--list .bc-fhead-actions { flex: 1 1 auto; }
  .bc-forum-shell--list .bc-fhead-new { margin-left: auto; }
}

/* Phone: search collapses to an icon button; rules open as a bottom sheet */
@media (max-width: 767px) {
  .bc-fhead { gap: 10px; margin-bottom: 12px; padding: 0; }
  .bc-ftabs { margin: 0 -16px; }
  .bc-ftabs-scroll { padding: 3px 16px; }
  .bc-ftabs::after { right: 0; width: 36px; }
  .bc-ftab { height: 34px; padding: 0 13px; font-size: 13px; }
  .bc-fhead-actions { gap: 6px; min-width: 0; }
  .bc-forum-shell--thread .bc-fhead-actions { flex: 0 1 auto; }

  .bc-fsearch { min-width: 0; }
  .bc-fsearch-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 0;
    border-radius: 999px;
    background: var(--bc-surface, #fff);
    box-shadow: inset 0 0 0 1px var(--bc-line-strong, rgba(15, 15, 25, 0.12));
    color: var(--bc-ink-2, #3a3a44);
    font-size: 14px;
    cursor: pointer;
  }
  .bc-fsearch-field { display: none; }
  .bc-fsearch.is-open { flex: 1 1 auto; }
  .bc-fsearch.is-open .bc-fsearch-toggle { display: none; }
  .bc-fsearch.is-open .bc-fsearch-field { display: flex; flex: 1 1 auto; min-width: 0; }
  .bc-fsearch.is-open .bc-fsearch-field input,
  .bc-fsearch.is-open .bc-fsearch-field input:focus { width: 100%; min-width: 0; font-size: 16px; }
  /* While searching, the field takes the row */
  .bc-fhead-actions.is-searching .bc-fchip span,
  .bc-fhead-actions.is-searching .bc-fhead-new span { display: none; }
  .bc-fhead-actions.is-searching .bc-fchip,
  .bc-fhead-actions.is-searching .bc-fhead-new { width: 38px; padding: 0; justify-content: center; }
  .bc-forum-shell--list .bc-fhead-actions.is-searching .bc-fhead-new { margin-left: 0; }

  .bc-fchip { padding: 0 13px; }
  .bc-fhead-new { padding: 0 15px; }

  .bc-frules {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 12px 22px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    font-size: 15px;
    animation: bcFrulesUp 0.3s var(--bc-ease, ease);
  }
  .bc-frules-grip { display: block; width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 999px; background: var(--bc-line-strong, rgba(15, 15, 25, 0.12)); }
  .bc-frules-close { top: 14px; right: 14px; }
  .bc-frules-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1099;
    background: rgba(11, 11, 16, 0.38);
    animation: bcFadeIn 0.2s ease;
  }
  .bc-fhint { border-radius: 14px; margin-top: -2px; }
}
@keyframes bcFrulesUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes bcFadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .bc-frules, .bc-frules-backdrop { animation: none; }
  .bc-fsearch-field input, .bc-ftab { transition: none; }
}

/* ---------- Belt chip (mini stitched belt + belt name) ---------- */

.bc-beltchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--bc-muted, #6b6b76);
  white-space: nowrap;
}
.bc-beltchip-belt { flex: 0 0 auto; display: block; line-height: 0; }
.bc-beltchip-belt > div {
  width: 40px !important;
  height: 9px !important;
  padding: 0 6px 0 0 !important;
  margin: 0 !important;
  border-radius: 2px !important;
  box-shadow: inset 0 0 0 1px rgba(15, 15, 25, 0.14) !important;
  overflow: hidden;
  font-size: 0 !important;
}
.bc-beltchip-belt > div > div {
  width: 8px !important;
  min-width: 0 !important;
  height: 100% !important;
  padding: 0 !important;
}
.bc-beltchip-belt img { display: none !important; }
/* Thread view: slightly larger chip that keeps the stripes on the rank bar */
.bc-beltchip--stripes .bc-beltchip-belt > div { width: 52px !important; height: 10px !important; padding-right: 7px !important; }
.bc-beltchip--stripes .bc-beltchip-belt > div > div {
  width: auto !important;
  min-width: 9px !important;
  height: 100% !important;
  padding: 0 1px 0 2px !important;
  gap: 1.5px;
  justify-content: center !important;
}
.bc-beltchip--stripes .bc-beltchip-belt img {
  display: block !important;
  width: 2px !important;
  height: 100% !important;
  margin: 0 !important;
}
/* Ranks drawn as a text block instead of a belt: the belt name beside it says the same */
.bc-beltchip-belt > div:not(.bc-belt) { display: none !important; }
.bc-beltchip-belt:has(> div:not(.bc-belt)) { display: none; }
.bc-beltchip-name { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Topic list ---------- */

.bc-topics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
  min-width: 0;
}
.bc-topics-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 16px;
  border: 1px dashed var(--bc-line-strong, rgba(15, 15, 25, 0.12));
  border-radius: var(--bc-r, 14px);
  color: var(--bc-muted, #6b6b76);
}

.bc-topic {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px 14px 14px;
  background: var(--bc-surface-2, #f6f6f8);
  border: 1px solid var(--bc-line, rgba(15, 15, 25, 0.07));
  border-radius: var(--bc-r, 14px);
  transition:
    transform 0.25s var(--bc-ease, ease),
    box-shadow 0.25s var(--bc-ease, ease),
    background-color 0.25s var(--bc-ease, ease),
    border-color 0.25s var(--bc-ease, ease);
}
.bc-topic:hover {
  transform: translateY(-1px);
  background: var(--bc-surface, #fff);
  border-color: var(--bc-line-strong, rgba(15, 15, 25, 0.12));
  box-shadow: var(--bc-shadow-2);
}
.bc-topic:focus-within {
  border-color: var(--bc-accent, #5b4bd1);
  box-shadow: var(--bc-ring, 0 0 0 4px rgba(91, 75, 209, 0.16));
}
.bc-topic.is-sticky {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.02)), var(--bc-surface-2, #f6f6f8);
  border-color: rgba(245, 158, 11, 0.22);
}
.bc-topic.is-unread { background: var(--bc-surface, #fff); border-color: rgba(91, 75, 209, 0.28); }
.bc-topic.is-unread::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--bc-accent, #5b4bd1);
}

.bc-topic-avatar {
  position: relative;
  z-index: 2;            /* above the stretched title link so the avatar keeps its own click */
  flex: 0 0 auto;
  line-height: 0;
  padding-top: 1px;
}

.bc-topic-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.bc-topic-title {
  display: block;
  color: var(--bc-ink, #0b0b10) !important;
  font-weight: 650;
  font-size: 15.5px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-decoration: none !important;
  overflow-wrap: anywhere;
}
.bc-topic-title::after {   /* the whole row opens the topic */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.bc-topic-title:focus { outline: none; }
.bc-topic-flag { margin-right: 6px; font-size: 12px; position: relative; top: -1px; }
.bc-topic-flag--pin { color: var(--bc-amber, #f59e0b); }
.bc-topic-flag--lock { color: var(--bc-faint, #9a9aa5); }
.bc-topic-new {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--bc-accent, #5b4bd1);
  color: #fff;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.bc-topic-excerpt {
  margin: 0 !important;
  color: var(--bc-muted, #6b6b76);
  font-size: 13.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.bc-topic-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
  min-width: 0;
  color: var(--bc-muted, #6b6b76);
  font-size: 12px;
  line-height: 1.3;
}
.bc-topic-author { color: var(--bc-ink-2, #3a3a44); font-weight: 600; }
.bc-topic-dot { color: var(--bc-faint, #9a9aa5); }
.bc-topic-time { color: var(--bc-faint, #9a9aa5); }

.bc-topic-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
  max-width: 34%;
}
.bc-topic-stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--bc-surface, #fff);
  box-shadow: inset 0 0 0 1px var(--bc-line, rgba(15, 15, 25, 0.07));
  color: var(--bc-ink-2, #3a3a44);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bc-pill i { color: var(--bc-faint, #9a9aa5); font-size: 11.5px; }
.bc-pill--likes i { color: var(--bc-accent, #5b4bd1); }
.bc-pill--views { color: var(--bc-muted, #6b6b76); font-weight: 500; }

.bc-topic-last {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  color: var(--bc-muted, #6b6b76) !important;
  text-decoration: none !important;
  transition: background-color 0.2s var(--bc-ease, ease);
}
.bc-topic-last:hover { background: var(--bc-surface-3, #eeeef2); }
.bc-topic-last-av { flex: 0 0 auto; line-height: 0; }
.bc-topic-last-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.bc-topic-last-time { font-size: 11px; color: var(--bc-faint, #9a9aa5); }
.bc-topic-last-text {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bc-topic-lastm {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 10px 7px 7px;
  border-radius: 10px;
  background: var(--bc-surface, #fff);
  box-shadow: inset 0 0 0 1px var(--bc-line, rgba(15, 15, 25, 0.07));
  color: var(--bc-muted, #6b6b76) !important;
  font-size: 12.5px;
  line-height: 1.35;
  text-decoration: none !important;
  min-width: 0;
}
.bc-topic-lastm-av { flex: 0 0 auto; line-height: 0; }
.bc-topic-lastm-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-topic-lastm-time { color: var(--bc-faint, #9a9aa5); }

@media (max-width: 600px) {
  .bc-topic { gap: 11px; padding: 12px 12px 12px 11px; flex-wrap: wrap; }
  .bc-topic-avatar img, .bc-topic-avatar .bc-av { width: 38px !important; height: 38px !important; }
  .bc-topic-avatar .bc-av { font-size: 14px !important; }
  .bc-topic-main { flex-basis: calc(100% - 50px); }
  .bc-topic-title { font-size: 15px; }
  .bc-topic-side { max-width: none; width: 100%; padding-left: 49px; flex-direction: row; align-items: center; }
  .bc-topic-stats { justify-content: flex-start; }
  .bc-topic-lastm { margin-top: 6px; }
  .bc-topic-side { order: 3; margin-top: -2px; }
  .bc-topic-meta { gap: 3px 6px; }
}

/* ---------- Thread ---------- */

.bc-thread-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 4px 0 10px;
}
.bc-thread-toolbar .form-switch, .bc-thread-toolbar .form-check { margin: 0 !important; }

.bc-posts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 18px;
  min-width: 0;
}

.bc-post {
  position: relative;
  min-width: 0;
  padding: 16px 18px 12px;
  background: var(--bc-surface, #fff);
  border: 1px solid var(--bc-line, rgba(15, 15, 25, 0.07));
  border-radius: var(--bc-r, 14px);
  box-shadow: var(--bc-shadow-1);
  scroll-margin-top: 80px;
  transition: border-color 0.25s var(--bc-ease, ease), box-shadow 0.25s var(--bc-ease, ease);
}
.bc-post:hover { border-color: var(--bc-line-strong, rgba(15, 15, 25, 0.12)); }
.bc-post.is-opening { background: linear-gradient(180deg, rgba(91, 75, 209, 0.035), transparent 120px), var(--bc-surface, #fff); }
.bc-post:target, .bc-post:has(> a[name]:target) {
  border-color: rgba(91, 75, 209, 0.45);
  box-shadow: var(--bc-ring, 0 0 0 4px rgba(91, 75, 209, 0.16));
}
.bc-post > a[name] { display: block; position: relative; top: -80px; height: 0; visibility: hidden; }
.bc-post > a[name]:target::before { display: none !important; }

.bc-post-head { display: flex; align-items: center; gap: 12px; min-width: 0; margin-bottom: 12px; }
.bc-post-av { flex: 0 0 auto; line-height: 0; }
.bc-post-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bc-post-nameline { display: flex; align-items: center; gap: 6px; min-width: 0; line-height: 1.2; }
.bc-post-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--bc-ink, #0b0b10) !important;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none !important;
}
.bc-post-name:hover { color: var(--bc-accent, #5b4bd1) !important; }
.bc-post-verified { color: var(--bc-blue, #2563eb); font-size: 13.5px; flex: 0 0 auto; }
.bc-post-op {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(91, 75, 209, 0.1);
  color: var(--bc-accent, #5b4bd1);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.bc-post-mod { color: var(--bc-faint, #9a9aa5); font-size: 13px; flex: 0 0 auto; }

.bc-post-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 9px;
  min-width: 0;
  color: var(--bc-muted, #6b6b76);
  font-size: 12px;
  line-height: 1.3;
}
.bc-status {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.bc-status--verified { background: rgba(22, 163, 74, 0.1); color: #15803d; }
.bc-status--pending { background: rgba(245, 158, 11, 0.13); color: #a16207; }
.bc-status--disputed { background: rgba(225, 29, 72, 0.1); color: #be123c; }
.bc-post-flag { height: 12px; width: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 15, 25, 0.08); }
.bc-post-stat { color: var(--bc-faint, #9a9aa5); font-variant-numeric: tabular-nums; }
.bc-post-stat.is-disputed { color: var(--bc-red, #e11d48); font-weight: 600; }

.bc-post-time {
  flex: 0 0 auto;
  align-self: flex-start;
  color: var(--bc-faint, #9a9aa5) !important;
  font-size: 12px;
  text-decoration: none !important;
  white-space: nowrap;
}
.bc-post-time:hover { color: var(--bc-ink-2, #3a3a44) !important; }

.bc-post-quote {
  margin: 0 0 12px !important;
  padding: 9px 14px !important;
  border: 0 !important;
  border-left: 3px solid rgba(91, 75, 209, 0.45) !important;
  border-radius: 0 10px 10px 0;
  background: var(--bc-surface-2, #f6f6f8) !important;
  color: var(--bc-muted, #6b6b76);
  font-size: 13.5px !important;
  font-style: italic;
  line-height: 1.55;
  max-width: none;
  overflow-wrap: anywhere;
}

.bc-post-body {
  max-width: 78ch;
  color: var(--bc-ink-2, #3a3a44);
  font-size: 15px;
  line-height: 1.62;
  overflow-wrap: anywhere;
  word-break: normal;
}
.bc-post-body a { color: var(--bc-accent, #5b4bd1) !important; text-decoration: underline; text-decoration-color: rgba(91, 75, 209, 0.35); text-underline-offset: 2px; }
.bc-post-body a:hover { text-decoration-color: currentColor; }
.bc-post-body img, .bc-post-body iframe, .bc-post-body video { max-width: 100%; border-radius: 12px; }
.bc-post-body blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--bc-line-strong, rgba(15, 15, 25, 0.12));
  color: var(--bc-muted, #6b6b76);
}
.bc-post-body code, .bc-post-body pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--bc-surface-3, #eeeef2);
  border-radius: 6px;
}
.bc-post-body code { padding: 1px 5px; }
.bc-post-body pre { padding: 10px 12px; overflow-x: auto; }

.bc-post-preview:empty { display: none; }
.bc-post-preview { margin-top: 12px; max-width: 70ch; }

.bc-post-image { margin-top: 12px; line-height: 0; }
.bc-post-image img {
  max-width: 100%;
  max-height: 640px;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--bc-line, rgba(15, 15, 25, 0.07)), var(--bc-shadow-1);
  cursor: zoom-in;
}

.bc-post-edited { margin-top: 10px; color: var(--bc-faint, #9a9aa5); font-size: 12px; font-style: italic; }

.bc-post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap-reverse;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--bc-line, rgba(15, 15, 25, 0.07));
}
.bc-post-actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.bc-post-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bc-muted, #6b6b76) !important;
  font: 500 12.5px/1 var(--bc-font, inherit);
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.2s var(--bc-ease, ease), color 0.2s var(--bc-ease, ease);
}
.bc-post-action i { font-size: 12px; pointer-events: none; }
.bc-post-action:hover { background: var(--bc-surface-3, #eeeef2); color: var(--bc-ink, #0b0b10) !important; }
.bc-post-action--danger:hover { background: rgba(225, 29, 72, 0.08); color: var(--bc-red, #e11d48) !important; }
.bc-post-action:focus-visible { outline: none; box-shadow: var(--bc-ring); }

@media (max-width: 600px) {
  .bc-post { padding: 14px 14px 10px; border-radius: 12px; }
  .bc-post-head { gap: 10px; }
  .bc-post-av img, .bc-post-av .bc-av { width: 40px !important; height: 40px !important; }
  .bc-post-av .bc-av { font-size: 15px !important; }
  .bc-post-body { font-size: 15px; }
  .bc-post-foot { flex-wrap: nowrap; gap: 4px; }
  .bc-post-actions { flex-wrap: nowrap; flex: 0 0 auto; }
  .bc-post-action { padding: 0 9px; }
  .bc-post-action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bc-post-foot .bc-reacts { flex-wrap: nowrap; gap: 0; }
  .bc-post-foot .bc-react { padding: 0 7px; gap: 4px; }
}

/* ---------- Reply composer ---------- */

.bc-composer textarea.bc-composer-text {
  min-height: 132px;
  padding: 12px 14px !important;
  border-radius: var(--bc-r, 14px) !important;
  line-height: 1.55 !important;
  font-size: 15px !important;
  resize: vertical;
  transition: border-color 0.2s var(--bc-ease, ease), box-shadow 0.2s var(--bc-ease, ease);
}
.bc-composer textarea.bc-composer-text:focus { border-color: var(--bc-accent, #5b4bd1) !important; box-shadow: var(--bc-ring) !important; }
.bc-composer-quote {
  margin: 4px 0 12px;
  padding: 9px 14px;
  border-left: 3px solid rgba(91, 75, 209, 0.45);
  border-radius: 0 10px 10px 0;
  background: var(--bc-surface-2, #f6f6f8);
  color: var(--bc-muted, #6b6b76);
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
  cursor: text;
}
.bc-composer-quote:empty { display: none; }
.bc-composer-attach { margin: 6px 0 14px; }
.bc-composer-attach label { display: block; margin-bottom: 6px; color: var(--bc-muted, #6b6b76); font-size: 13px; font-weight: 500; }
.bc-composer .bc-composer-submit { border-radius: 999px !important; height: 44px; }

/* ---------- Reactions (likeButtons / likeSummary) ---------- */

.bc-reacts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}
.bc-reacts--static { display: flex; margin: 0 auto; justify-content: center; }
.bc-react {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bc-faint, #9a9aa5);
  font: 600 12.5px/1 var(--bc-font, inherit);
  font-variant-numeric: tabular-nums;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 0.2s var(--bc-ease, ease), color 0.2s var(--bc-ease, ease), box-shadow 0.2s var(--bc-ease, ease);
}
button.bc-react { cursor: pointer; }
.bc-react i { font-size: 14px; pointer-events: none; }
.bc-react .bc-react-count { min-width: 0.6em; text-align: left; }
.bc-react.has-count { color: var(--bc-muted, #6b6b76); }
button.bc-react:hover { background: var(--bc-surface-3, #eeeef2); color: var(--bc-ink-2, #3a3a44); }
button.bc-react:focus-visible { outline: none; box-shadow: var(--bc-ring); }
button.bc-react:active { transform: scale(0.96); }
.bc-react.is-active {
  background: rgba(91, 75, 209, 0.1);
  color: var(--bc-accent, #5b4bd1);
}
.bc-react.is-active:hover { background: rgba(91, 75, 209, 0.16); color: var(--bc-accent, #5b4bd1); }
/* The "sad" and "funny" reactions stay quiet until used */
.bc-react--face-sad-tear:not(.has-count):not(:hover),
.bc-react--thumbs-down:not(.has-count):not(:hover) { opacity: 0.75; }

/* "Who reacted" button (newsfeed): hidden until the item has a reaction */
.bc-react-likers { padding: 0 9px; }
.bc-react-likers i { font-size: 12.5px; }
.bc-react-likers.is-empty { display: none; }
.bc-reacts .bc-react-likers { margin-left: 2px; }

/* Rows that hold a reaction group outside the forum (newsfeed cards, event page) */
.bc-reacts-row {
  display: flex;
  justify-content: flex-end;
  padding: 2px 0 10px;
  clear: both;
}
.bc-reacts-row--center { justify-content: center; padding: 4px 0 2px; }
.bc-reacts-row--center .bc-reacts { margin: 0; }
/* Likers sheet (json/fetch_likers.php) */
.bc-likers .bc-react { flex: 0 0 auto; height: 28px; padding: 0 9px; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .bc-topic, .bc-post, .bc-react, .bc-forum-btn { transition: none; }
  .bc-topic:hover, .bc-forum-btn:hover { transform: none; }
}

/* ---------- Home cards: latest replies ---------- */

.bc-latestforum { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.bc-latestforum .bc-topic { padding: 10px 12px 10px 10px; gap: 11px; align-items: center; }
.bc-latestforum .bc-topic-title { font-size: 14.5px; }
.bc-latestforum .bc-topic-excerpt { -webkit-line-clamp: 1; font-size: 13px; }
.bc-latestforum .bc-topic-excerpt a { position: relative; z-index: 2; color: inherit !important; text-decoration: none !important; }

.bc-bestpost { text-align: center; }
.bc-bestpost-text {
  display: block;
  margin: 10px auto 12px;
  max-width: 46ch;
  color: var(--bc-ink-2, #3a3a44) !important;
  font-size: 14.5px;
  line-height: 1.55;
  text-decoration: none !important;
  overflow-wrap: anywhere;
}
.bc-bestpost-text::before { content: "\201C"; color: var(--bc-accent, #5b4bd1); font-weight: 700; margin-right: 1px; }
.bc-bestpost-text::after { content: "\201D"; color: var(--bc-accent, #5b4bd1); font-weight: 700; margin-left: 1px; }
.bc-bestpost-meta { margin-top: 8px; color: var(--bc-faint, #9a9aa5); font-size: 12px; }

/* ---------- Post layout: author column beside the content ----------
   Wide screens get a fixed author column so the eye reads straight down the
   content; narrow screens keep the compact author row with the time on the right. */

.bc-post-main { min-width: 0; }
.bc-post-time--foot { display: none !important; }
.bc-post-main > .bc-post-time { position: absolute; top: 16px; right: 18px; }
.bc-post-nameline { padding-right: 84px; }

@media (min-width: 760px) {
  .bc-post {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    column-gap: 22px;
    padding: 18px 20px 12px;
  }
  .bc-post > a[name] { grid-column: 1 / -1; }
  .bc-post-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 2px 0 6px;
  }
  .bc-post-av img, .bc-post-av .bc-av { width: 52px !important; height: 52px !important; }
  .bc-post-who { gap: 7px; width: 100%; }
  .bc-post-nameline { flex-wrap: wrap; row-gap: 3px; padding-right: 0; }
  .bc-post-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  .bc-post-sub { flex-direction: column; align-items: flex-start; gap: 6px; }
  .bc-post-sub .bc-post-stat { font-size: 11.5px; }
  /* Belt on its own line, wider, with the belt name underneath */
  .bc-post-sub .bc-beltchip { flex-direction: column; align-items: flex-start; gap: 5px; white-space: normal; }
  .bc-post-sub .bc-beltchip--stripes .bc-beltchip-belt > div { width: 104px !important; height: 13px !important; padding-right: 12px !important; border-radius: 3px !important; }
  .bc-post-sub .bc-beltchip--stripes .bc-beltchip-belt > div > div { min-width: 16px !important; gap: 2px; }
  .bc-post-sub .bc-beltchip--stripes .bc-beltchip-belt img { width: 2.5px !important; height: 100% !important; }
  .bc-post-sub .bc-beltchip-name { line-height: 1.3; }
  .bc-post-main {
    display: flex;
    flex-direction: column;
    padding-left: 22px;
    border-left: 1px solid var(--bc-line, rgba(15, 15, 25, 0.07));
  }
  /* The time is minor: it moves down beside the actions and leaves the content the full width */
  .bc-post-main > .bc-post-time { display: none; }
  .bc-post-time--foot { display: inline-flex !important; align-items: center; height: 30px; padding: 0 10px 0 0; margin-right: 4px; font-size: 12px; }
  /* Footer sits at the bottom when the author column is taller than the post */
  .bc-post-main > .bc-post-foot { margin-top: auto; }
  .bc-post-main > :has(+ .bc-post-foot) { margin-bottom: 12px; }
}

@media (max-width: 600px) {
  .bc-post-main > .bc-post-time { top: 14px; right: 14px; }
  .bc-post-nameline { padding-right: 74px; }
}
