/* Foro editorial: composición en flujo y panel auxiliar aislado. */

@font-face {
  font-family: "Reddit Sans";
  src: url("/fonts/RedditSans-VariableFont_wght.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

body.page-forum {
  background-color: var(--theme-surface-bg);
  background-image: none;
}

body.page-forum::before {
  content: none;
}

body.page-forum main {
  width: 100%;
  max-width: 1380px;
  padding-inline: clamp(18px, 3vw, 40px);
}

body.page-forum .forum-page {
  --forum-divider: color-mix(in srgb, var(--surface-text) 15%, transparent);
  --forum-divider-strong: color-mix(in srgb, var(--surface-text) 24%, transparent);
  --forum-muted: color-mix(in srgb, var(--surface-text) 66%, transparent);
  --forum-soft: color-mix(in srgb, var(--surface-text) 4%, transparent);
  --forum-soft-strong: color-mix(in srgb, var(--surface-text) 7%, transparent);
  width: 100%;
  max-width: 100%;
  margin: 0;
  gap: 0;
  overflow: clip;
  color: var(--surface-text);
}

body.page-forum .forum-page,
body.page-forum .forum-page * {
  min-width: 0;
}

body.page-forum .forum-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(78px, 9vw, 112px);
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(28px, 4.8vw, 64px) 0 clamp(24px, 3.6vw, 44px);
  border: 0;
  border-bottom: 1px solid var(--forum-divider);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.page-forum .forum-hero-copy {
  gap: 12px;
  padding: 0;
}

body.page-forum .forum-kicker,
body.page-forum.night-mode .forum-kicker {
  color: var(--forum-muted);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

body.page-forum .forum-hero h1,
body.page-forum.night-mode .forum-hero h1 {
  max-width: 16ch;
  color: var(--surface-text);
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.052em;
}

body.page-forum .forum-lead,
body.page-forum.night-mode .forum-lead {
  max-width: 64ch;
  color: var(--forum-muted);
  font-size: clamp(0.98rem, 1.3vw, 1.15rem);
  line-height: 1.65;
}

body.page-forum .forum-actions {
  margin-top: 6px;
}

body.page-forum .forum-action-btn,
body.page-forum.night-mode .forum-action-btn {
  min-height: 42px;
  border: 1px solid var(--surface-text);
  border-radius: 999px;
  background: var(--surface-text);
  color: var(--theme-surface-bg);
  box-shadow: none;
}

body.page-forum .forum-action-btn:hover,
body.page-forum .forum-action-btn:focus-visible,
body.page-forum.night-mode .forum-action-btn:hover,
body.page-forum.night-mode .forum-action-btn:focus-visible {
  border-color: var(--surface-text);
  background: var(--surface-text);
  box-shadow: none;
  transform: translateY(-1px);
}

body.page-forum .forum-action-btn.forum-action-btn-ghost,
body.page-forum.night-mode .forum-action-btn.forum-action-btn-ghost {
  border-color: var(--forum-divider-strong);
  background: transparent;
  color: var(--surface-text);
}

body.page-forum .forum-action-btn-icon {
  color: currentColor;
}

body.page-forum .forum-panel-trigger {
  min-height: 42px;
  margin: 0;
  padding: 0 15px;
  border: 1px solid var(--forum-divider-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--surface-text);
  font: inherit;
  font-size: 0.83rem;
  font-weight: 650;
}

body.page-forum .forum-panel-trigger:hover,
body.page-forum .forum-panel-trigger:focus-visible {
  background: var(--forum-soft-strong);
  outline: none;
}

body.page-forum .forum-session-note,
body.page-forum.night-mode .forum-session-note {
  position: static;
  max-width: 58ch;
  margin-top: -4px;
  color: var(--forum-muted);
  transform: none;
}

body.page-forum .forum-pendulum-decor {
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: visible;
}

body.page-forum .forum-pendulum-decor::before {
  display: none;
}

body.page-forum .forum-pendulum {
  width: 100%;
  max-width: 104px;
  filter: none;
}

body.page-forum .forum-pendulum:hover,
body.page-forum .forum-pendulum:focus-visible,
body.page-forum.night-mode .forum-pendulum:hover,
body.page-forum.night-mode .forum-pendulum:focus-visible {
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--surface-text) 18%, transparent));
}

body.page-forum .forum-discovery {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--forum-divider);
}

body.page-forum .forum-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 560px;
}

body.page-forum .forum-search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--forum-muted);
  stroke-width: 1.65;
  stroke-linecap: round;
}

body.page-forum .forum-search input {
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--forum-divider-strong);
  border-radius: 0;
  background: transparent;
  color: var(--surface-text);
  font: inherit;
}

body.page-forum .forum-search input::placeholder {
  color: var(--forum-muted);
}

body.page-forum .forum-search input:focus-visible {
  border-bottom-color: var(--surface-text);
  outline: none;
}

body.page-forum .forum-filter-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

body.page-forum .forum-filter {
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--forum-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
}

body.page-forum .forum-filter:hover,
body.page-forum .forum-filter:focus-visible {
  color: var(--surface-text);
  background: var(--forum-soft);
  outline: none;
}

body.page-forum .forum-filter.is-active {
  border-color: var(--forum-divider-strong);
  color: var(--surface-text);
  background: var(--forum-soft-strong);
}

body.page-forum .forum-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  gap: clamp(28px, 4vw, 58px);
  align-items: start;
  padding-top: clamp(28px, 4vw, 52px);
}

body.page-forum .forum-workspace.is-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

body.page-forum .forum-main-column {
  display: grid;
  gap: 28px;
}

body.page-forum .forum-question-panel,
body.page-forum .forum-thread-section,
body.page-forum .forum-thread-detail-panel,
body.page-forum.night-mode .forum-question-panel,
body.page-forum.night-mode .forum-thread-section,
body.page-forum.night-mode .forum-thread-detail-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body.page-forum .forum-question-panel {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--forum-divider);
  border-radius: 18px;
  background: var(--forum-soft);
}

body.page-forum .forum-question-form {
  gap: 12px;
}

body.page-forum .forum-question-form h2 {
  margin-bottom: 4px;
  font-size: clamp(1.28rem, 2vw, 1.7rem);
}

body.page-forum .forum-question-form input,
body.page-forum .forum-question-form textarea,
body.page-forum .forum-reply-form textarea,
body.page-forum.night-mode .forum-question-form input,
body.page-forum.night-mode .forum-question-form textarea,
body.page-forum.night-mode .forum-reply-form textarea {
  border-color: var(--forum-divider-strong);
  background: var(--theme-surface-bg);
  color: var(--surface-text);
}

body.page-forum .forum-thread-section-head {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.62fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--forum-divider);
}

body.page-forum .forum-thread-section-head h2,
body.page-forum.night-mode .forum-thread-section-head h2 {
  color: var(--surface-text);
  font-size: clamp(1.55rem, 2.8vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

body.page-forum .forum-thread-section-head p,
body.page-forum.night-mode .forum-thread-section-head p {
  color: var(--forum-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

body.page-forum .forum-thread-list {
  gap: 0;
}

body.page-forum .forum-thread-card,
body.page-forum.night-mode .forum-thread-card {
  border: 0;
  border-bottom: 1px solid var(--forum-divider);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.page-forum .forum-thread-card:first-child {
  border-top: 1px solid var(--forum-divider);
}

body.page-forum .forum-thread-card.is-clickable {
  transition: background-color 160ms ease;
}

body.page-forum .forum-thread-card.is-clickable:hover,
body.page-forum .forum-thread-card.is-clickable:focus-visible,
body.page-forum .forum-thread-card.is-clickable:focus-within,
body.page-forum.night-mode .forum-thread-card.is-clickable:hover,
body.page-forum.night-mode .forum-thread-card.is-clickable:focus-visible,
body.page-forum.night-mode .forum-thread-card.is-clickable:focus-within {
  border-color: var(--forum-divider);
  background: var(--forum-soft);
  box-shadow: none;
  transform: none;
}

body.page-forum .forum-thread-card.is-clickable:focus-visible,
body.page-forum .forum-thread-card.is-clickable:focus-within {
  outline: 2px solid var(--surface-text);
  outline-offset: -2px;
}

body.page-forum .forum-thread-article {
  gap: 8px;
  padding: 18px 4px;
}

body.page-forum .forum-thread-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

body.page-forum .forum-thread-title {
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  line-height: 1.35;
}

body.page-forum .forum-thread-anchor,
body.page-forum.night-mode .forum-thread-title {
  color: var(--surface-text);
}

body.page-forum .forum-thread-meta,
body.page-forum.night-mode .forum-thread-meta {
  color: var(--forum-muted);
  font-size: 0.74rem;
}

body.page-forum .forum-thread-status {
  padding: 2px 7px;
  border: 1px solid var(--forum-divider);
  border-radius: 999px;
  color: var(--surface-text);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.page-forum .forum-thread-excerpt,
body.page-forum.night-mode .forum-thread-excerpt {
  max-width: 78ch;
  color: var(--forum-muted);
  font-size: 0.84rem;
  -webkit-line-clamp: 2;
}

body.page-forum .forum-thread-card-image-wrap {
  width: 96px;
  height: 72px;
  overflow: hidden;
  border-radius: 10px;
}

body.page-forum .forum-thread-card-image {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  object-fit: cover;
  box-shadow: none;
}

body.page-forum .forum-empty-state,
body.page-forum.night-mode .forum-empty-state {
  color: var(--forum-muted);
}

body.page-forum .forum-load-more {
  display: block;
  min-height: 42px;
  margin: 20px auto 0;
  padding: 0 18px;
  border: 1px solid var(--forum-divider-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--surface-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
}

body.page-forum .forum-load-more[hidden] {
  display: none;
}

body.page-forum .forum-load-more:hover,
body.page-forum .forum-load-more:focus-visible {
  background: var(--forum-soft-strong);
  outline: none;
}

body.page-forum .forum-thread-footer {
  margin-top: 0;
}

body.page-forum .forum-thread-focus-card,
body.page-forum .forum-reply-item,
body.page-forum.night-mode .forum-thread-focus-card,
body.page-forum.night-mode .forum-reply-item {
  border-color: var(--forum-divider);
  background: transparent;
  box-shadow: none;
}

body.page-forum .forum-replies-block {
  overflow: visible;
}

body.page-forum .forum-reply-form,
body.page-forum.night-mode .forum-reply-form {
  border-color: var(--forum-divider);
  background: var(--forum-soft);
}

body.page-forum .forum-sidebar {
  position: sticky;
  top: calc(var(--header-offset, 96px) + 18px);
  display: grid;
  gap: 22px;
  max-height: calc(100dvh - var(--header-offset, 96px) - 36px);
  padding-left: 26px;
  border-left: 1px solid var(--forum-divider);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
  display: none;
}

body.page-forum .forum-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

body.page-forum .forum-sidebar-kicker {
  margin: 0 0 4px;
  color: var(--forum-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.page-forum .forum-sidebar-head h2 {
  margin: 0;
  font-size: 1.12rem;
}

body.page-forum .forum-sidebar-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--forum-divider);
  border-radius: 50%;
  background: transparent;
  color: var(--surface-text);
  font-size: 1.3rem;
  line-height: 1;
}

body.page-forum .forum-sidebar-close:hover,
body.page-forum .forum-sidebar-close:focus-visible {
  background: var(--forum-soft-strong);
  outline: none;
}

body.page-forum .forum-sidebar-create {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-text);
  color: var(--theme-surface-bg);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
}

body.page-forum .forum-sidebar-create > span:first-child {
  font-size: 1.2rem;
}

body.page-forum .forum-sidebar-section {
  display: grid;
  gap: 4px;
}

body.page-forum .forum-sidebar-section h3 {
  margin: 0 0 8px;
  color: var(--forum-muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.page-forum .forum-sidebar-section button {
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid var(--forum-divider);
  background: transparent;
  color: var(--surface-text);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
}

body.page-forum .forum-sidebar-section button:hover,
body.page-forum .forum-sidebar-section button:focus-visible,
body.page-forum .forum-sidebar-section button.is-active {
  padding-left: 12px;
  background: var(--forum-soft);
  outline: none;
}

body.page-forum .forum-sidebar-popular ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.page-forum .forum-sidebar-popular a {
  display: grid;
  gap: 3px;
  color: var(--surface-text);
  font-size: 0.78rem;
  line-height: 1.35;
  text-decoration: none;
}

body.page-forum .forum-sidebar-popular a span {
  color: var(--forum-muted);
  font-size: 0.68rem;
}

body.page-forum .forum-sidebar-popular a:hover,
body.page-forum .forum-sidebar-popular a:focus-visible {
  text-decoration: underline;
  outline: none;
}

body.page-forum .forum-sidebar-mobile-trigger {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 1003;
  display: none;
  min-height: 44px;
  margin: 0;
  padding: 0 15px;
  border: 1px solid var(--forum-divider-strong);
  border-radius: 999px;
  background: var(--theme-surface-bg);
  color: var(--surface-text);
  box-shadow: 0 10px 26px color-mix(in srgb, #000 18%, transparent);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

body.page-forum .forum-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1001;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.34);
}

body.page-forum .forum-sidebar-backdrop[hidden] {
  display: none;
}

@media (max-width: 980px) {
  body.page-forum .forum-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  body.page-forum .forum-panel-trigger {
    display: none;
  }

  body.page-forum .forum-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1002;
    width: min(88vw, 360px);
    height: 100dvh;
    max-height: none;
    padding: calc(20px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));
    border: 0;
    border-left: 1px solid var(--forum-divider);
    background: var(--theme-surface-bg);
    box-shadow: -18px 0 42px rgba(0, 0, 0, 0.18);
    transform: translateX(102%);
    visibility: hidden;
    transition:
      transform 220ms ease,
      visibility 0s linear 220ms;
  }

  body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-sidebar {
    display: grid;
    transform: translateX(0);
    visibility: visible;
    transition-delay: 0s;
  }

  body.page-forum .forum-sidebar-mobile-trigger {
    display: inline-flex;
    align-items: center;
  }

  body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-sidebar-mobile-trigger {
    display: none;
  }
}

@media (max-width: 720px) {
  body.page-forum main {
    padding-inline: 16px;
  }

  body.page-forum .forum-hero {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 16px;
    padding-top: 22px;
  }

  body.page-forum .forum-hero h1 {
    font-size: clamp(2.25rem, 13vw, 3.65rem);
  }

  body.page-forum .forum-pendulum {
    max-width: 72px;
  }

  body.page-forum .forum-discovery {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  body.page-forum .forum-filter-list {
    justify-content: flex-start;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  body.page-forum .forum-filter-list::-webkit-scrollbar {
    display: none;
  }

  body.page-forum .forum-filter {
    flex: 0 0 auto;
  }

  body.page-forum .forum-thread-section-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body.page-forum .forum-thread-head {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  body.page-forum .forum-thread-card-image-wrap {
    width: 74px;
    height: 62px;
  }

  body.page-forum .forum-thread-article {
    padding-block: 16px;
  }
}

@media (max-width: 460px) {
  body.page-forum .forum-hero {
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  body.page-forum .forum-pendulum {
    max-width: 58px;
  }

  body.page-forum .forum-actions {
    width: auto;
  }

  body.page-forum .forum-actions .forum-action-btn {
    flex: 0 1 auto;
    width: auto;
  }

  body.page-forum .forum-action-btn-label {
    white-space: normal;
  }

  body.page-forum .forum-thread-head {
    grid-template-columns: minmax(0, 1fr);
  }

  body.page-forum .forum-thread-card-image-wrap {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-forum .forum-sidebar,
  body.page-forum .forum-thread-card.is-clickable,
  body.page-forum .forum-action-btn {
    transition: none;
  }

  body.page-forum .forum-pendulum-swing,
  body.page-forum .forum-pendulum [class*="forum-pendulum-bird"] {
    animation: none !important;
  }
}

/* The forum guide shares the editorial grid with the conversations. */
body.page-forum .forum-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: clamp(26px, 3.4vw, 52px);
  transition: grid-template-columns 220ms cubic-bezier(0.22, 1, 0.36, 1), gap 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.page-forum .forum-main-column {
  min-width: 0;
}

body.page-forum .forum-panel-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid var(--forum-divider-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--surface-text);
  cursor: pointer;
}

body.page-forum .forum-panel-trigger svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

body.page-forum .forum-panel-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 3;
  width: max-content;
  max-width: 210px;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--surface-text);
  color: var(--theme-surface-bg);
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 130ms ease, transform 130ms ease;
}

body.page-forum .forum-panel-trigger:hover::after,
body.page-forum .forum-panel-trigger:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

body.page-forum .forum-sidebar,
body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
  position: sticky;
  top: calc(var(--header-offset, 96px) + 18px);
  right: auto;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 20px;
  width: auto;
  height: auto;
  max-height: calc(100dvh - var(--header-offset, 96px) - 36px);
  padding: 0 0 0 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-left: 1px solid var(--forum-divider);
  background: transparent;
  box-shadow: none;
  transform: none;
  visibility: visible;
  opacity: 1;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 160ms ease;
}

body.page-forum .forum-workspace.is-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0fr);
  gap: 0;
}

body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
  display: grid;
  min-width: 0;
  padding-left: 0;
  overflow: hidden;
  border-left-color: transparent;
  opacity: 0;
  transform: translateX(14px);
  visibility: hidden;
}

body.page-forum .forum-workspace.is-sidebar-open .forum-sidebar {
  display: grid;
  transform: none;
  visibility: visible;
}

body.page-forum .forum-sidebar-backdrop {
  display: none !important;
}

body.page-forum .forum-guide-topics {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--forum-divider);
}

body.page-forum .forum-guide-topic {
  border-bottom: 1px solid var(--forum-divider);
}

body.page-forum .forum-guide-topic summary {
  position: relative;
  padding: 15px 30px 15px 0;
  color: var(--surface-text);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

body.page-forum .forum-guide-topic summary::-webkit-details-marker {
  display: none;
}

body.page-forum .forum-guide-topic summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  color: var(--forum-muted);
  font-size: 1.15rem;
  font-weight: 400;
}

body.page-forum .forum-guide-topic[open] summary::after {
  content: "−";
}

body.page-forum .forum-guide-topic ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 0 16px 18px;
  color: var(--forum-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

body.page-forum .forum-sidebar-mobile-trigger {
  display: none !important;
}

@media (max-width: 980px) {
  body.page-forum .forum-workspace,
  body.page-forum .forum-workspace.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  body.page-forum .forum-panel-trigger {
    display: grid;
  }

  body.page-forum .forum-sidebar,
  body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1402;
    display: grid;
    width: min(100vw, 430px);
    height: 100dvh;
    max-height: none;
    padding: calc(22px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));
    border-left: 1px solid var(--forum-divider);
    background: var(--theme-surface-bg);
    transform: translateX(102%);
    visibility: hidden;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 220ms;
  }

  body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-sidebar {
    display: grid;
    transform: translateX(0);
    visibility: visible;
    transition-delay: 0s;
  }

  body.page-forum .forum-sidebar-backdrop:not([hidden]) {
    display: block !important;
  }
}

/* Conversational reading system: scoped to the forum so TempusDB's global type remains untouched. */
body.page-forum main {
  width: min(95vw, 1620px);
  max-width: 1620px;
  padding-inline: 0;
}

body.page-forum .forum-page {
  --forum-reading-font: "Reddit Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --forum-sidebar-width: 306px;
  --forum-divider: color-mix(in srgb, var(--surface-text) 14%, transparent);
  --forum-divider-strong: color-mix(in srgb, var(--surface-text) 24%, transparent);
  --forum-muted: color-mix(in srgb, var(--surface-text) 62%, transparent);
  font-family: var(--forum-reading-font);
}

body.page-forum .forum-page :is(input, textarea, select, button) {
  font-family: var(--forum-reading-font);
}

/* Editorial branding remains distinct; the reading interface below uses Reddit Sans. */
body.page-forum .forum-kicker,
body.page-forum .forum-hero h1 {
  font-family: var(--font-brand, inherit);
}

body.page-forum .forum-hero {
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: clamp(22px, 3vw, 42px);
  padding: clamp(20px, 2.6vw, 34px) 0 16px;
}

body.page-forum .forum-hero-copy { gap: 7px; }

body.page-forum .forum-kicker { font-size: 0.68rem; }

body.page-forum .forum-hero h1 {
  max-width: none;
  font-size: clamp(2.25rem, 3.8vw, 3.65rem);
  line-height: 0.98;
}

body.page-forum .forum-lead {
  max-width: 72ch;
  font-family: var(--forum-reading-font);
  font-size: 0.94rem;
  line-height: 1.55;
}

body.page-forum .forum-actions { margin-top: 2px; }

body.page-forum .forum-action-btn,
body.page-forum .forum-panel-trigger {
  min-height: 38px;
}

body.page-forum .forum-session-note {
  margin-top: 0;
  font-family: var(--forum-reading-font);
  font-size: 0.75rem;
}

body.page-forum .forum-pendulum { max-width: 82px; }

body.page-forum .forum-discovery {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 14px 0;
}

body.page-forum .forum-search { max-width: none; }

body.page-forum .forum-search input {
  min-height: 46px;
  font-size: 0.98rem;
}

body.page-forum .forum-filter-list {
  justify-content: flex-start;
  gap: 4px;
}

body.page-forum .forum-filter {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--forum-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

body.page-forum .forum-filter.is-active {
  border-color: var(--forum-divider-strong);
  background: var(--forum-soft-strong);
  color: var(--surface-text);
}

body.page-forum .forum-workspace {
  grid-template-columns: minmax(0, 1fr) var(--forum-sidebar-width);
  gap: clamp(28px, 2vw, 32px);
  padding-top: 20px;
}

body.page-forum .forum-main-column { gap: 20px; }

body.page-forum .forum-thread-section-head {
  display: block;
  margin: 0 0 4px;
  padding: 0 0 8px;
}

body.page-forum .forum-thread-section-head h2 {
  font-family: var(--forum-reading-font);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.3;
}

body.page-forum .forum-thread-section-head p:empty { display: none; }

body.page-forum .forum-thread-list { margin: 0; }

body.page-forum .forum-thread-article {
  gap: 6px;
  padding: 16px 8px;
}

body.page-forum .forum-thread-head {
  align-items: start;
  gap: 20px;
}

body.page-forum .forum-thread-title {
  font-family: var(--forum-reading-font);
  font-size: clamp(1.18rem, 1.3vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.28;
}

body.page-forum .forum-category-badge {
  margin-top: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--forum-muted);
  font-family: var(--forum-reading-font);
  font-size: 0.76rem;
  font-weight: 500;
}

body.page-forum .forum-thread-meta {
  margin-top: 5px;
  font-family: var(--forum-reading-font);
  font-size: 0.78rem;
  font-weight: 450;
}

body.page-forum .forum-thread-status {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--forum-muted);
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

body.page-forum .forum-thread-excerpt {
  max-width: 78ch;
  margin: 1px 0 0;
  color: color-mix(in srgb, var(--surface-text) 76%, transparent);
  font-family: var(--forum-reading-font);
  font-size: 0.97rem;
  font-weight: 400;
  line-height: 1.58;
}

body.page-forum .forum-thread-card-image-wrap {
  width: 112px;
  height: 82px;
  border-radius: 6px;
}

body.page-forum .forum-thread-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

body.page-forum .forum-tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 1px 6px;
  border: 1px solid var(--forum-divider);
  border-radius: 4px;
  color: var(--forum-muted);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
}

body.page-forum .forum-thread-card.is-clickable:hover { background: color-mix(in srgb, var(--forum-soft) 72%, transparent); }

/* Thread reading: one continuous column, with a quiet guide line instead of comment cards. */
body.page-forum .forum-thread-focus-card {
  padding: 0 0 20px;
  border: 0;
  border-bottom: 1px solid var(--forum-divider);
}

body.page-forum .forum-thread-focus-title {
  font-family: var(--forum-reading-font);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 620;
  line-height: 1.2;
}

body.page-forum .forum-thread-body,
body.page-forum .forum-reply-body {
  max-width: 78ch;
  font-family: var(--forum-reading-font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.62;
}

body.page-forum .forum-replies-block { margin-top: 24px; }

body.page-forum .forum-replies-block > h4 {
  margin-bottom: 14px;
  font-family: var(--forum-reading-font);
  font-size: 0.92rem;
  font-weight: 650;
}

body.page-forum .forum-replies-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.page-forum .forum-reply-item {
  position: relative;
  margin: 0;
  padding: 0 0 20px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.page-forum .forum-reply-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 1px;
  background: var(--forum-divider-strong);
  transition: background-color 160ms ease;
}

body.page-forum .forum-reply-item:hover::before { background: color-mix(in srgb, var(--surface-text) 42%, transparent); }

body.page-forum .forum-reply-head { margin-bottom: 5px; }

body.page-forum .forum-reply-meta {
  font-family: var(--forum-reading-font);
  font-size: 0.8rem;
  font-weight: 500;
}

body.page-forum .forum-reply-body { margin: 0; }

body.page-forum .forum-reply-form,
body.page-forum .forum-question-panel {
  border-radius: 10px;
}

/* The guide scrolls with the page; only the mobile drawer may need its own overflow. */
body.page-forum .forum-sidebar,
body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
  position: sticky;
  top: calc(var(--header-offset, 96px) + 14px);
  width: var(--forum-sidebar-width);
  max-height: none;
  padding-left: 22px;
  overflow: visible;
}

body.page-forum .forum-sidebar-head h2 {
  font-family: var(--forum-reading-font);
  font-size: 1rem;
  font-weight: 650;
}

body.page-forum .forum-sidebar-create {
  min-height: 40px;
  border-radius: 7px;
  font-family: var(--forum-reading-font);
  font-size: 0.84rem;
  font-weight: 600;
}

body.page-forum .forum-sidebar-section { gap: 0; }

body.page-forum .forum-sidebar-section h3 {
  margin: 0 0 5px;
  font-family: var(--forum-reading-font);
  font-size: 0.68rem;
  font-weight: 650;
}

body.page-forum .forum-sidebar-section button {
  min-height: 32px;
  padding: 6px 7px;
  font-family: var(--forum-reading-font);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
}

body.page-forum .forum-sidebar-section .forum-sidebar-subcategories button {
  min-height: 27px;
  padding: 4px 7px 4px 19px;
  font-size: 0.76rem;
  font-weight: 450;
}

body.page-forum .forum-sidebar-section .forum-sidebar-subcategories button::before {
  content: "–";
  display: inline-block;
  width: 10px;
  margin-left: -13px;
  color: var(--forum-divider-strong);
}

@media (max-width: 980px) {
  body.page-forum main {
    width: min(100% - 32px, 760px);
    padding: 0;
  }

  body.page-forum .forum-workspace,
  body.page-forum .forum-workspace.is-sidebar-mobile-open,
  body.page-forum .forum-workspace.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  body.page-forum .forum-sidebar,
  body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-sidebar,
  body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1402;
    width: min(88vw, 380px);
    height: 100dvh;
    max-height: none;
    padding: calc(20px + env(safe-area-inset-top)) 20px calc(22px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-left: 1px solid var(--forum-divider);
    background: var(--theme-surface-bg);
    box-shadow: -18px 0 42px color-mix(in srgb, #000 18%, transparent);
    transform: translateX(102%);
    visibility: hidden;
    opacity: 1;
  }

  body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  body.page-forum .forum-sidebar-backdrop:not([hidden]) { display: block !important; }
}

/* Thread-detail refinements: controls stay available without taking space from the conversation. */
body.page-forum .forum-thread-back-btn--compact { display: none; }

body.page-forum .forum-page.is-thread-detail-open .forum-discovery {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 11px;
  row-gap: 8px;
  padding-block: 10px 8px;
}

body.page-forum .forum-page.is-thread-detail-open .forum-thread-back-btn--compact {
  display: inline-grid;
  grid-column: 1;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--forum-ink);
  font-family: "Reddit Sans", system-ui, sans-serif;
  font-size: 19px;
  line-height: 1;
  box-shadow: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

body.page-forum .forum-page.is-thread-detail-open .forum-thread-back-btn--compact:hover,
body.page-forum .forum-page.is-thread-detail-open .forum-thread-back-btn--compact:focus-visible {
  border-color: var(--forum-divider);
  background: var(--forum-soft);
  color: var(--forum-accent);
  outline: none;
}

body.page-forum .forum-page.is-thread-detail-open .forum-search {
  grid-column: 2;
  min-width: 0;
}

body.page-forum .forum-page.is-thread-detail-open .forum-filter-list { grid-column: 3; }
body.page-forum .forum-page.is-thread-detail-open .forum-thread-detail-panel { padding-top: 0; }

body.page-forum .forum-thread-context-actions {
  position: fixed;
  right: clamp(16px, 2.6vw, 40px);
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--forum-divider) 84%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-surface-bg) 92%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, #1b130e 10%, transparent);
  backdrop-filter: blur(8px);
}

body.page-forum .forum-thread-context-action {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

body.page-forum .forum-workspace.is-sidebar-open .forum-thread-context-guide,
body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-thread-context-guide { display: none; }

/* A parent reference highlights its direct parent and just the physical path to this reply. */
body.page-forum .forum-replies-children:hover::before,
body.page-forum .forum-reply-item:hover > .forum-replies-children::before,
body.page-forum .forum-reply-item.is-local-subtree > .forum-replies-children::before {
  background: var(--forum-divider-strong);
}

body.page-forum .forum-replies-children.is-local-path-branch::before {
  bottom: auto;
  height: var(--local-path-branch-height);
  background: color-mix(in srgb, var(--forum-accent) 45%, var(--forum-divider)) !important;
}

body.page-forum .forum-reply-item.is-local-subtree .watch-detail-comment-author {
  color: var(--forum-accent);
  font-weight: 620;
}

body.page-forum .forum-reply-item.is-local-subtree-root .watch-detail-comment-author {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--forum-accent) 34%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* File removal is meaningful only after a real local selection. */
body.page-forum .forum-reply-image-remove[hidden],
body.page-forum .forum-inline-image-clear[hidden] { display: none !important; }

body.page-forum .forum-reply-composer-actions,
body.page-forum .forum-inline-composer-actions { align-items: center; }

body.page-forum .forum-reply-composer-actions .forum-reply-file-row,
body.page-forum .forum-inline-composer-actions .forum-reply-file-row { min-width: 0; }

body.page-forum .forum-reply-form .forum-question-file-trigger,
body.page-forum .forum-inline-reply-form .forum-inline-image-trigger,
body.page-forum .forum-reply-form .forum-form-actions .forum-action-btn,
body.page-forum .forum-inline-reply-form .forum-inline-reply-actions .forum-action-btn {
  box-sizing: border-box;
  min-height: 32px;
  padding-block: 0;
  border-radius: 999px;
}

/* The inline editor is a sibling below the immutable action row. */
body.page-forum .forum-reply-item > .forum-inline-reply-form {
  margin-top: 10px;
  margin-bottom: 2px;
  width: min(100%, 720px);
}

@media (max-width: 1120px) {
  body.page-forum .forum-page.is-thread-detail-open .forum-discovery { grid-template-columns: 30px minmax(0, 1fr); }
  body.page-forum .forum-page.is-thread-detail-open .forum-search { grid-column: 2; }
  body.page-forum .forum-page.is-thread-detail-open .forum-filter-list { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body.page-forum .forum-thread-context-actions {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 4px;
    padding: 4px;
  }

  body.page-forum .forum-thread-context-action {
    min-height: 29px;
    padding-inline: 8px;
    font-size: 11px;
  }
}

/* Internal thread UX: preserve the branch system while bringing context and reply tools closer. */
body.page-forum .forum-page.is-thread-detail-open .forum-hero {
  display: none;
}

body.page-forum .forum-page.is-thread-detail-open .forum-discovery {
  padding-top: 12px;
}

body.page-forum .forum-thread-detail-panel {
  padding-top: 2px;
}

body.page-forum .forum-thread-context-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 13px;
}

body.page-forum .forum-thread-context-action,
body.page-forum .forum-reply-teaser {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid var(--forum-divider);
  border-radius: 999px;
  background: transparent;
  color: var(--forum-muted);
  font: 550 0.74rem/1 var(--forum-reading-font);
  box-shadow: none;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

body.page-forum .forum-thread-context-action:hover,
body.page-forum .forum-thread-context-action:focus-visible,
body.page-forum .forum-reply-teaser:hover,
body.page-forum .forum-reply-teaser:focus-visible {
  border-color: var(--forum-divider-strong);
  background: var(--forum-soft);
  color: var(--surface-text);
}

body.page-forum .forum-reply-teaser .forum-reply-teaser-placeholder {
  display: none;
}

body.page-forum .forum-workspace.is-sidebar-open .forum-thread-context-guide {
  display: none;
}

body.page-forum .forum-thread-focus-card {
  padding: 15px 16px 18px;
  border: 1px solid var(--forum-divider);
  border-radius: 9px;
  background: color-mix(in srgb, var(--forum-soft) 54%, transparent);
}

body.page-forum .forum-reply-parent-reference {
  display: inline-flex;
  width: fit-content;
  margin: -1px 0 7px;
  padding: 2px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--forum-muted);
  font: 500 0.72rem/1.35 var(--forum-reading-font);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}

body.page-forum .forum-reply-parent-reference:hover,
body.page-forum .forum-reply-parent-reference:focus-visible {
  background: color-mix(in srgb, var(--forum-soft) 82%, transparent);
  color: var(--surface-text);
}

/* Only the referenced parent and its descendants receive this local orientation cue. */
body.page-forum .forum-reply-item.is-local-subtree .watch-detail-comment-author {
  font-weight: 660;
}

body.page-forum .forum-reply-item.is-local-subtree > .forum-replies-children::before {
  background: color-mix(in srgb, var(--surface-text) 31%, transparent);
}

body.page-forum .forum-reply-item.is-local-subtree::before {
  border-color: color-mix(in srgb, var(--surface-text) 31%, transparent);
}

body.page-forum .forum-reply-item.is-local-subtree-root > .forum-reply-head {
  color: var(--surface-text);
}

body.page-forum .forum-reply-item:has(> .forum-inline-reply-form) .forum-reply-to-button {
  background: var(--forum-soft) !important;
  color: var(--surface-text);
}

body.page-forum .forum-reply-form,
body.page-forum .forum-inline-reply-form {
  position: relative;
}

body.page-forum .forum-reply-composer-close,
body.page-forum .forum-inline-reply-close {
  position: absolute;
  top: 9px;
  right: 9px;
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--forum-muted);
  font: 400 1.15rem/1 var(--forum-reading-font);
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

body.page-forum .forum-reply-composer-close:hover,
body.page-forum .forum-reply-composer-close:focus-visible,
body.page-forum .forum-inline-reply-close:hover,
body.page-forum .forum-inline-reply-close:focus-visible {
  background: var(--forum-soft-strong);
  color: var(--surface-text);
}

body.page-forum .forum-reply-form .forum-reply-composer-head {
  padding-right: 28px;
}

body.page-forum .forum-reply-composer-actions,
body.page-forum .forum-inline-composer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

body.page-forum .forum-reply-composer-actions .forum-reply-file-row,
body.page-forum .forum-inline-composer-actions .forum-reply-file-row {
  grid-column: 1;
}

body.page-forum .forum-reply-composer-actions .forum-reply-image-preview {
  grid-column: 1 / -1;
}

body.page-forum .forum-reply-composer-actions .forum-form-actions,
body.page-forum .forum-inline-composer-actions .forum-inline-reply-actions {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 0;
  border: 0;
  justify-self: end;
}

body.page-forum .forum-inline-reply-form {
  width: min(100%, 790px);
  max-width: 790px;
  margin: 14px 0 5px;
  padding: 17px 18px 16px;
  border-color: var(--forum-divider);
  border-left-color: var(--forum-divider-strong);
  border-radius: 8px;
  background: var(--forum-soft);
}

body.page-forum .forum-inline-reply-form .forum-inline-reply-to {
  min-height: 22px;
  padding-right: 28px;
  color: var(--forum-muted);
}

body.page-forum .forum-inline-reply-form textarea {
  min-height: 112px;
}

body.page-forum .forum-inline-composer-actions {
  margin-top: 2px;
}

body.page-forum .forum-inline-composer-actions .forum-inline-reply-actions {
  display: flex;
  align-items: center;
}

body.page-forum .forum-inline-reply-form .forum-inline-image-trigger,
body.page-forum .forum-reply-form .forum-question-file-trigger {
  min-height: 30px;
  padding-inline: 10px;
  border-color: var(--forum-divider) !important;
  background: transparent !important;
}

body.page-forum .forum-inline-reply-form .forum-action-btn,
body.page-forum .forum-reply-form .forum-action-btn {
  min-height: 32px;
  padding-inline: 13px;
}

body.page-forum .forum-inline-reply-form .forum-inline-image-clear,
body.page-forum .forum-reply-form .forum-reply-image-remove {
  min-height: 28px;
  padding-inline: 6px;
  font-size: 0.7rem;
}

@media (max-width: 620px) {
  body.page-forum .forum-thread-focus-card { padding: 13px 0 16px; border-inline: 0; border-radius: 0; }
  body.page-forum .forum-thread-context-actions { margin-bottom: 11px; }
  body.page-forum .forum-thread-context-action { min-height: 29px; padding-inline: 9px; }
  body.page-forum .forum-reply-composer-actions,
  body.page-forum .forum-inline-composer-actions { gap: 8px; }
  body.page-forum .forum-reply-form { padding: 16px; }
  body.page-forum .forum-inline-reply-form { padding: 15px; }
  body.page-forum .forum-inline-reply-form textarea { min-height: 104px; }
}

/* Thread reading refinements: one connected guide per reply branch, without touching reply behaviour. */
body.page-forum .forum-replies-list {
  display: block;
}

body.page-forum .forum-reply-item,
body.page-forum .forum-replies-children > .forum-reply-item {
  margin-left: 0 !important;
  padding: 0 0 25px;
}

/* The branch owns its guide. Removing the per-item guide avoids disconnected parallel lines. */
body.page-forum .forum-reply-item::before {
  content: none;
}

body.page-forum .forum-replies-children {
  position: relative;
  margin: 15px 0 0;
  padding: 0 0 0 29px;
}

body.page-forum .forum-replies-children::before {
  top: -10px;
  bottom: 27px;
  left: 9px;
  width: 1px;
  background: var(--forum-divider-strong);
  transition: background-color 160ms ease;
}

/* Each direct child joins the branch guide with a quiet rounded elbow. */
body.page-forum .forum-replies-children > .forum-reply-item::before {
  content: "";
  position: absolute;
  top: 9px;
  left: -20px;
  width: 20px;
  height: 12px;
  border-bottom: 1px solid var(--forum-divider-strong);
  border-left: 1px solid var(--forum-divider-strong);
  border-bottom-left-radius: 8px;
  background: transparent;
  transition: border-color 160ms ease;
}

body.page-forum .forum-reply-item:hover > .forum-replies-children::before,
body.page-forum .forum-replies-children:hover::before {
  background: color-mix(in srgb, var(--surface-text) 36%, transparent);
}

body.page-forum .forum-replies-children > .forum-reply-item:hover::before {
  border-color: color-mix(in srgb, var(--surface-text) 36%, transparent);
}

/* Logical nesting remains unlimited; after four levels the visual step becomes gentler. */
body.page-forum .forum-reply-item[style*="--reply-depth: 4"] > .forum-replies-children {
  margin-left: -11px;
  padding-left: 25px;
}

body.page-forum .forum-reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin-bottom: 7px;
}

body.page-forum .forum-reply-meta {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--forum-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

body.page-forum .forum-reply-meta .watch-detail-comment-author-wrap {
  align-items: center;
  gap: 6px;
  min-width: 0;
}

body.page-forum .forum-reply-meta .watch-detail-comment-author {
  overflow: hidden;
  color: var(--surface-text);
  font-size: 0.8rem;
  font-weight: 630;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-forum .forum-reply-meta .watch-detail-comment-avatar,
body.page-forum .forum-reply-meta .watch-detail-comment-avatar img {
  width: 21px;
  height: 21px;
  border-radius: 50%;
}

body.page-forum .forum-reply-delete-btn {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 3px 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--forum-muted);
  font: 500 0.71rem/1 var(--forum-reading-font);
}

body.page-forum .forum-reply-body {
  margin: 0;
  color: color-mix(in srgb, var(--surface-text) 91%, transparent);
  line-height: 1.64;
}

body.page-forum .forum-reply-image-link {
  display: block;
  width: fit-content;
  max-width: min(100%, 520px);
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid var(--forum-divider);
  border-radius: 9px;
  background: var(--forum-soft);
}

body.page-forum .forum-reply-image {
  display: block;
  max-width: 100%;
  max-height: 460px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

body.page-forum .forum-reply-actions,
body.page-forum .forum-vote-controls,
body.page-forum .forum-reply-file-row,
body.page-forum .forum-inline-reply-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

body.page-forum .forum-reply-actions {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 25px;
  gap: 6px;
  margin-top: 9px;
  padding-top: 0;
  flex-wrap: nowrap;
  vertical-align: top;
  white-space: nowrap;
}

body.page-forum .forum-reply-to-button,
body.page-forum .forum-vote-button {
  min-height: 24px;
  border: 0 !important;
  border-radius: 6px;
  background: transparent !important;
  box-shadow: none !important;
  line-height: 1;
  transition: color 150ms ease, background-color 150ms ease;
}

body.page-forum .forum-reply-to-button {
  padding: 3px 4px;
  color: var(--forum-muted);
  font: 500 0.7rem/1 var(--forum-reading-font);
  letter-spacing: 0.005em;
}

body.page-forum .forum-reply-to-button:hover,
body.page-forum .forum-reply-to-button:focus-visible {
  color: var(--surface-text);
  background: var(--forum-soft) !important;
}

body.page-forum .forum-vote-controls {
  gap: 1px;
  margin-left: 0;
  padding-left: 2px;
  border-left-color: transparent;
}

body.page-forum .forum-vote-button {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 3px;
  padding: 3px 5px;
  color: var(--forum-muted);
  font-size: 0.69rem;
}

body.page-forum .forum-vote-icon {
  display: block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

body.page-forum .forum-vote-icon circle,
body.page-forum .forum-vote-icon path {
  fill: none;
  stroke: currentColor;
}

/* Keep the reaction faces expressive; only their surrounding controls stay quiet. */
body.page-forum .forum-vote-button--positive .forum-vote-icon {
  color: color-mix(in srgb, var(--forum-accent) 70%, white);
}

body.page-forum .forum-vote-button--negative .forum-vote-icon {
  color: color-mix(in srgb, var(--forum-brown) 68%, white);
}

body.page-forum .forum-vote-score {
  min-width: 0;
  color: currentColor;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

body.page-forum .forum-vote-button:hover,
body.page-forum .forum-vote-button:focus-visible,
body.page-forum .forum-vote-button.is-active {
  background: var(--forum-soft) !important;
}

body.page-forum .forum-vote-button--positive.is-active { color: var(--forum-accent); }
body.page-forum .forum-vote-button--negative.is-active { color: var(--forum-brown); }

body.page-forum .forum-reply-branch-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 8px 0 2px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--forum-muted);
  font: 550 0.71rem/1 var(--forum-reading-font);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

body.page-forum .forum-reply-branch-toggle:hover,
body.page-forum .forum-reply-branch-toggle:focus-visible {
  border-color: var(--forum-divider);
  background: color-mix(in srgb, var(--forum-soft) 78%, transparent);
  color: var(--surface-text);
}

/* Reply composers share a calm, compact language while preserving their existing controls. */
body.page-forum .forum-reply-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  padding: 18px 19px 17px;
  border: 1px solid var(--forum-divider);
  border-radius: 12px;
  background: color-mix(in srgb, var(--forum-soft) 74%, transparent);
}

body.page-forum .forum-reply-composer-head {
  display: grid;
  gap: 3px;
}

body.page-forum .forum-reply-composer-title {
  margin: 0;
  color: var(--surface-text);
  font: 630 0.94rem/1.3 var(--forum-reading-font);
}

body.page-forum .forum-reply-composer-lead {
  margin: 0;
  color: var(--forum-muted);
  font: 400 0.8rem/1.45 var(--forum-reading-font);
}

body.page-forum .forum-reply-form textarea,
body.page-forum .forum-inline-reply-form textarea {
  width: 100%;
  resize: vertical;
  border-radius: 8px;
  box-shadow: none;
}

body.page-forum .forum-reply-form textarea {
  min-height: 126px;
  padding: 11px 12px;
  font: 400 0.97rem/1.6 var(--forum-reading-font);
}

body.page-forum .forum-reply-file-row {
  gap: 8px;
  min-height: 30px;
}

body.page-forum .forum-reply-form .forum-question-file-trigger,
body.page-forum .forum-inline-image-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 29px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--forum-divider) 74%, transparent) !important;
  border-radius: 999px;
  background: transparent !important;
  color: var(--forum-muted);
  font: 550 0.74rem/1 var(--forum-reading-font);
  box-shadow: none !important;
  cursor: pointer;
  transform: none;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

body.page-forum .forum-reply-form .forum-question-file-trigger-icon {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent !important;
  color: currentColor;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1;
}

body.page-forum .forum-inline-image-trigger::before {
  content: "+";
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1;
}

body.page-forum .forum-reply-form .forum-question-file-trigger:hover,
body.page-forum .forum-inline-image-trigger:hover,
body.page-forum .forum-reply-form .forum-question-file-trigger:focus-visible,
body.page-forum .forum-inline-image-trigger:focus-visible {
  border-color: var(--forum-divider-strong);
  background: var(--forum-soft);
  color: var(--surface-text);
  box-shadow: none;
  transform: none;
}

body.page-forum .forum-reply-form .forum-question-file-name,
body.page-forum .forum-inline-image-name {
  display: none;
}

body.page-forum .forum-form-actions,
body.page-forum .forum-inline-reply-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1px;
}

body.page-forum .forum-reply-form .forum-action-btn,
body.page-forum .forum-inline-reply-form .forum-action-btn {
  min-height: 34px;
  padding-inline: 13px;
  font: 600 0.77rem/1 var(--forum-reading-font);
}

body.page-forum .forum-inline-reply-form {
  gap: 9px;
  width: min(100%, 760px);
  max-width: 760px;
  margin: 13px 0 3px;
  padding: 16px 17px 15px;
  border: 1px solid var(--forum-divider);
  border-left-color: var(--forum-divider-strong);
  border-radius: 8px;
  background: var(--forum-soft);
  box-shadow: none !important;
  box-sizing: border-box;
}

body.page-forum .forum-inline-reply-form::before,
body.page-forum .forum-inline-reply-form::after {
  content: none;
}

body.page-forum .forum-inline-reply-form .forum-inline-reply-to {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--forum-muted);
  font: 500 0.76rem/1.35 var(--forum-reading-font);
}

body.page-forum .forum-inline-reply-form .forum-inline-reply-to strong {
  color: var(--surface-text);
  font-weight: 630;
}

body.page-forum .forum-inline-reply-form textarea {
  min-height: 108px;
  padding: 10px 11px;
  font: 400 0.94rem/1.58 var(--forum-reading-font);
}

body.page-forum .forum-inline-reply-form .forum-reply-file-row {
  gap: 7px;
  min-height: 28px;
}

body.page-forum .forum-inline-reply-form .forum-inline-image-trigger {
  min-height: 28px;
  padding: 3px 8px;
  border-color: color-mix(in srgb, var(--forum-divider) 70%, transparent);
  color: var(--forum-muted);
  font-size: 0.71rem;
  font-weight: 500;
}

body.page-forum .forum-inline-reply-form .forum-inline-reply-actions {
  gap: 7px;
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px solid color-mix(in srgb, var(--forum-divider) 74%, transparent);
}

body.page-forum .forum-inline-reply-form .forum-action-btn {
  min-height: 32px;
  padding-inline: 12px;
  font-size: 0.75rem;
}

body.page-forum .forum-inline-reply-form .forum-inline-reply-cancel {
  min-height: 27px;
  padding-inline: 6px;
  font-size: 0.72rem;
}

body.page-forum .forum-inline-reply-cancel,
body.page-forum .forum-reply-image-remove,
body.page-forum .forum-inline-image-clear {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0;
  padding: 3px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--forum-muted);
  font: 500 0.74rem/1 var(--forum-reading-font);
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

body.page-forum .forum-inline-reply-cancel:hover,
body.page-forum .forum-reply-image-remove:hover,
body.page-forum .forum-inline-image-clear:hover,
body.page-forum .forum-inline-reply-cancel:focus-visible,
body.page-forum .forum-reply-image-remove:focus-visible,
body.page-forum .forum-inline-image-clear:focus-visible {
  background: var(--forum-soft);
  color: var(--surface-text);
}

body.page-forum .forum-reply-image-preview,
body.page-forum .forum-inline-image-preview {
  margin-top: 1px;
}

body.page-forum .forum-reply-image-preview img,
body.page-forum .forum-inline-image-preview img {
  border: 1px solid var(--forum-divider);
  border-radius: 7px;
}

body.page-forum .forum-form-feedback:empty {
  display: none;
}

@media (max-width: 620px) {
  body.page-forum .forum-replies-children {
    margin-top: 13px;
    padding-left: 22px;
  }

  body.page-forum .forum-replies-children::before { left: 7px; }

  body.page-forum .forum-replies-children > .forum-reply-item::before {
    left: -15px;
    width: 15px;
  }

  body.page-forum .forum-reply-item[style*="--reply-depth: 4"] > .forum-replies-children {
    margin-left: -8px;
    padding-left: 20px;
  }

  body.page-forum .forum-reply-form { padding: 15px; }
  body.page-forum .forum-inline-reply-form { padding: 12px; }
  body.page-forum .forum-form-actions,
  body.page-forum .forum-inline-reply-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  body.page-forum main { width: min(100% - 24px, 760px); }
  body.page-forum .forum-hero { grid-template-columns: minmax(0, 1fr) 62px; gap: 12px; padding-top: 18px; }
  body.page-forum .forum-hero h1 { font-size: clamp(2rem, 10vw, 2.7rem); }
  body.page-forum .forum-pendulum { max-width: 62px; }
  body.page-forum .forum-filter-list { overflow-x: auto; padding-bottom: 2px; }
  body.page-forum .forum-filter { flex: 0 0 auto; }
  body.page-forum .forum-thread-card-image-wrap { width: 78px; height: 62px; }
  body.page-forum .forum-thread-title { font-size: 1.08rem; }
  body.page-forum .forum-thread-excerpt { font-size: 0.94rem; }
}

@media (prefers-reduced-motion: reduce) {
  body.page-forum .forum-workspace,
  body.page-forum .forum-sidebar,
  body.page-forum .forum-panel-trigger::after {
    transition: none;
  }
}

/* Interactive forum categories and a lightly separated contextual guide. */
body.page-forum .forum-discovery {
  grid-template-columns: minmax(240px, 1fr) auto;
}

body.page-forum .forum-category-filter {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--forum-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.page-forum .forum-category-filter select,
body.page-forum .forum-question-form select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 34px 8px 11px;
  border: 1px solid var(--forum-divider-strong);
  border-radius: 10px;
  background: var(--theme-surface-bg);
  color: var(--surface-text);
  font: inherit;
  text-transform: none;
}

body.page-forum .forum-question-form select.is-invalid {
  border-color: #b33b31;
  outline: 2px solid color-mix(in srgb, #b33b31 18%, transparent);
}

body.page-forum .forum-field-help {
  margin: -5px 0 2px;
  color: var(--forum-muted);
  font-size: 0.73rem;
  line-height: 1.45;
}

body.page-forum .forum-category-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 7px;
  padding: 4px 9px;
  overflow: hidden;
  border: 1px solid var(--forum-divider-strong);
  border-radius: 999px;
  color: var(--forum-muted);
  font-size: 0.66rem;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-forum .forum-category-badge[hidden] {
  display: none;
}

body.page-forum .forum-thread-focus-head > .forum-category-badge {
  margin: 0 0 9px;
}

body.page-forum .forum-sidebar-backdrop {
  background: color-mix(in srgb, var(--surface-text) 6%, transparent);
  backdrop-filter: none;
}

body.page-forum .forum-guide-topics {
  gap: 0;
}

body.page-forum .forum-guide-topic {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 14px 32px 14px 0;
  border: 0;
  border-bottom: 1px solid var(--forum-divider);
  background: transparent;
  color: var(--surface-text);
  text-align: left;
  cursor: pointer;
}

body.page-forum .forum-guide-topic::after {
  content: "→";
  position: absolute;
  right: 4px;
  align-self: center;
  color: var(--forum-muted);
}

body.page-forum .forum-guide-topic strong {
  font-size: 0.86rem;
  font-weight: 720;
}

body.page-forum .forum-guide-topic span {
  color: var(--forum-muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

body.page-forum .forum-guide-topic:hover,
body.page-forum .forum-guide-topic:focus-visible,
body.page-forum .forum-guide-topic.is-active {
  padding-left: 10px;
  background: var(--forum-soft);
  outline: none;
}

body.page-forum .forum-sidebar-category-group {
  display: grid;
  min-width: 0;
}

body.page-forum .forum-sidebar-category-group > [data-forum-sidebar-category] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

body.page-forum .forum-sidebar-category-group > [data-forum-sidebar-category]::after {
  content: "›";
  color: var(--forum-muted);
  font-size: 1rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

body.page-forum .forum-sidebar-category-group.is-open > [data-forum-sidebar-category]::after {
  transform: rotate(-90deg);
}

body.page-forum .forum-sidebar-subcategories {
  display: grid;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: max-height 190ms ease, opacity 150ms ease, visibility 0s linear 190ms;
}

body.page-forum .forum-sidebar-category-group.is-open .forum-sidebar-subcategories {
  max-height: 620px;
  padding-block: 3px 7px;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

body.page-forum .forum-sidebar-section .forum-sidebar-subcategories button {
  min-height: 30px;
  padding: 5px 8px 5px 20px;
  border-bottom: 0;
  color: var(--forum-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

body.page-forum .forum-sidebar-section .forum-sidebar-subcategories button:hover,
body.page-forum .forum-sidebar-section .forum-sidebar-subcategories button:focus-visible,
body.page-forum .forum-sidebar-section .forum-sidebar-subcategories button.is-active {
  padding-left: 24px;
  color: var(--surface-text);
}

@media (prefers-reduced-motion: reduce) {
  body.page-forum .forum-sidebar-category-group > [data-forum-sidebar-category]::after,
  body.page-forum .forum-sidebar-subcategories {
    transition: none;
  }
}

body.page-forum .forum-guide-topic.is-active {
  border-left: 2px solid var(--surface-text);
}

body.page-forum .forum-guide-detail {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--forum-divider);
  border-radius: 14px;
  background: var(--forum-soft);
}

body.page-forum .forum-guide-detail[hidden] {
  display: none;
}

body.page-forum .forum-guide-detail h3,
body.page-forum .forum-guide-detail p {
  margin: 0;
}

body.page-forum .forum-guide-detail h3 {
  font-size: 1rem;
}

body.page-forum .forum-guide-detail p,
body.page-forum .forum-guide-related {
  color: var(--forum-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

body.page-forum .forum-guide-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

body.page-forum .forum-guide-detail-actions button {
  min-height: 36px;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid var(--forum-divider-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--surface-text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 680;
  cursor: pointer;
}

body.page-forum .forum-guide-related {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

body.page-forum .forum-guide-related a {
  color: inherit;
  text-underline-offset: 3px;
}

@media (max-width: 1120px) {
  body.page-forum .forum-discovery {
    grid-template-columns: minmax(240px, 1fr) auto;
  }

  body.page-forum .forum-filter-list {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body.page-forum .forum-discovery {
    grid-template-columns: minmax(0, 1fr);
  }

  body.page-forum .forum-filter-list {
    grid-column: auto;
  }

  body.page-forum .forum-sidebar-backdrop {
    background: color-mix(in srgb, #000 16%, transparent);
  }
}

/* Keep the guide inside the forum layout at every viewport size. */
body.page-forum .forum-sidebar-backdrop {
  display: none !important;
}

@media (max-width: 980px) {
  body.page-forum .forum-workspace,
  body.page-forum .forum-workspace.is-sidebar-mobile-open {
    grid-template-columns: minmax(min(78vw, 640px), 1fr) minmax(260px, 300px);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
  }

  body.page-forum .forum-workspace.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0fr);
    gap: 0;
    overflow-x: visible;
  }

  body.page-forum .forum-sidebar,
  body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-sidebar,
  body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
    position: sticky;
    top: calc(var(--header-offset, 96px) + 12px);
    right: auto;
    z-index: 1;
    display: grid;
    align-content: start;
    width: auto;
    height: auto;
    max-height: calc(100dvh - var(--header-offset, 96px) - 24px);
    padding: 0 0 0 20px;
    overflow-y: auto;
    border: 0;
    border-left: 1px solid var(--forum-divider);
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
      opacity 160ms ease,
      transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
    min-width: 0;
    padding-left: 0;
    overflow: hidden;
    border-left-color: transparent;
    opacity: 0;
    visibility: hidden;
    transform: translateX(12px);
  }
}

/* Final responsive guard: the guide becomes a drawer below desktop, never a squeezed second column. */
@media (max-width: 980px) {
  body.page-forum .forum-workspace,
  body.page-forum .forum-workspace.is-sidebar-mobile-open,
  body.page-forum .forum-workspace.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    overflow: visible;
  }

  body.page-forum .forum-sidebar,
  body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-sidebar,
  body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1402;
    width: min(88vw, 380px);
    height: 100dvh;
    max-height: none;
    padding: calc(20px + env(safe-area-inset-top)) 20px calc(22px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-left: 1px solid var(--forum-divider);
    background: var(--theme-surface-bg);
    box-shadow: -18px 0 42px color-mix(in srgb, #000 18%, transparent);
    transform: translateX(102%);
    visibility: hidden;
  }

  body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  body.page-forum .forum-sidebar-backdrop:not([hidden]) { display: block !important; }
}

/* Final source-order overrides for the internal-thread controls. */
body.page-forum .forum-page.is-thread-detail-open .forum-discovery {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 11px;
  row-gap: 8px;
  padding-block: 10px 8px;
}

body.page-forum .forum-page.is-thread-detail-open .forum-thread-back-btn--compact {
  display: inline-grid;
  grid-column: 1;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--forum-ink);
  font-size: 19px;
  line-height: 1;
  box-shadow: none;
}

body.page-forum .forum-page.is-thread-detail-open .forum-search { grid-column: 2; min-width: 0; }
body.page-forum .forum-page.is-thread-detail-open .forum-filter-list { grid-column: 3; }
body.page-forum .forum-page.is-thread-detail-open .forum-thread-detail-panel { padding-top: 0; }

body.page-forum .forum-thread-context-actions {
  position: fixed;
  right: clamp(16px, 2.6vw, 40px);
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--forum-divider) 84%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme-surface-bg) 92%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, #1b130e 10%, transparent);
  backdrop-filter: blur(8px);
}

body.page-forum .forum-thread-context-action {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

body.page-forum .forum-workspace.is-sidebar-open .forum-thread-context-guide,
body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-thread-context-guide { display: none; }

/* No ancestor receives hover colour; only the physical parent-to-child segment does. */
body.page-forum .forum-replies-children:hover::before,
body.page-forum .forum-reply-item:hover > .forum-replies-children::before,
body.page-forum .forum-reply-item.is-local-subtree > .forum-replies-children::before {
  background: var(--forum-divider-strong);
}

body.page-forum .forum-replies-children.is-local-path-branch::before {
  bottom: auto;
  height: var(--local-path-branch-height);
  background: color-mix(in srgb, var(--forum-accent) 45%, var(--forum-divider)) !important;
}

body.page-forum .forum-replies-children > .forum-reply-item:hover::before { border-color: var(--forum-divider-strong); }

body.page-forum .forum-reply-item.is-local-subtree::before {
  border-color: color-mix(in srgb, var(--forum-accent) 45%, var(--forum-divider));
}

body.page-forum .forum-reply-item.is-local-subtree .watch-detail-comment-author {
  color: var(--forum-accent);
  font-weight: 620;
}

body.page-forum .forum-reply-item.is-local-subtree-root .watch-detail-comment-author {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--forum-accent) 34%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

body.page-forum .forum-reply-image-remove[hidden],
body.page-forum .forum-inline-image-clear[hidden] { display: none !important; }

body.page-forum .forum-reply-composer-actions,
body.page-forum .forum-inline-composer-actions { align-items: center; }

body.page-forum .forum-reply-form .forum-question-file-trigger,
body.page-forum .forum-inline-reply-form .forum-inline-image-trigger,
body.page-forum .forum-reply-form .forum-form-actions .forum-action-btn,
body.page-forum .forum-inline-reply-form .forum-inline-reply-actions .forum-action-btn {
  box-sizing: border-box;
  min-height: 32px;
  padding-block: 0;
  border-radius: 999px;
}

body.page-forum .forum-reply-item > .forum-inline-reply-form {
  margin-top: 10px;
  margin-bottom: 2px;
  width: min(100%, 720px);
}

@media (max-width: 1120px) {
  body.page-forum .forum-page.is-thread-detail-open .forum-discovery { grid-template-columns: 30px minmax(0, 1fr); }
  body.page-forum .forum-page.is-thread-detail-open .forum-search { grid-column: 2; }
  body.page-forum .forum-page.is-thread-detail-open .forum-filter-list { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body.page-forum .forum-thread-context-actions {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 4px;
    padding: 4px;
  }
  body.page-forum .forum-thread-context-action { min-height: 29px; padding-inline: 8px; font-size: 11px; }
}

/* Final detail-only polish: stateful tools and a readable local-subthread surface. */
body.page-forum .forum-page.is-thread-detail-open .forum-thread-back-btn--compact {
  border-color: color-mix(in srgb, var(--forum-divider) 78%, transparent);
  color: color-mix(in srgb, var(--forum-ink) 78%, transparent);
  font-family: "Reddit Sans", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 350;
}

body.page-forum .forum-page.is-thread-detail-open .forum-thread-back-btn--compact:hover,
body.page-forum .forum-page.is-thread-detail-open .forum-thread-back-btn--compact:focus-visible {
  border-color: color-mix(in srgb, var(--forum-divider-strong) 74%, transparent);
  background: color-mix(in srgb, var(--forum-soft) 76%, transparent);
  color: var(--forum-accent);
}

body.page-forum .forum-thread-context-actions[hidden],
body.page-forum .forum-thread-context-action[hidden] { display: none !important; }

/* The action row is always its own row; the inline composer can never join its flex layout. */
body.page-forum .forum-reply-item > .forum-reply-actions {
  display: inline-flex !important;
  width: fit-content;
  min-height: 25px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
}

body.page-forum .forum-reply-item > .forum-inline-reply-form {
  display: grid;
  clear: both;
  width: min(100%, 760px);
  max-width: 760px;
  grid-template-columns: minmax(0, 1fr);
  align-self: stretch;
}

body.page-forum .forum-inline-composer-actions,
body.page-forum .forum-reply-composer-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

body.page-forum .forum-inline-composer-actions .forum-inline-reply-actions,
body.page-forum .forum-reply-composer-actions .forum-form-actions {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  justify-content: flex-end !important;
  margin: 0;
  padding: 0;
  border: 0;
}

body.page-forum .forum-inline-reply-form .forum-inline-image-trigger,
body.page-forum .forum-reply-form .forum-question-file-trigger,
body.page-forum .forum-inline-reply-form .forum-action-btn,
body.page-forum .forum-reply-form .forum-action-btn {
  min-height: 32px;
  box-sizing: border-box;
  padding-block: 0;
  border-radius: 999px;
}

body.page-forum .forum-reply-parent-reference,
body.page-forum .forum-reply-parent-reference:hover,
body.page-forum .forum-reply-parent-reference:focus-visible {
  text-decoration: none;
}

/* The root item's own box covers precisely its descendants in the nested DOM. */
body.page-forum .forum-reply-item.is-local-subtree-root {
  border-radius: 6px;
  background: color-mix(in srgb, var(--forum-accent) 8%, var(--forum-soft));
  transition: background-color 190ms ease;
}

body.page-forum .forum-reply-item.is-local-subtree,
body.page-forum .forum-reply-item.is-local-subtree .watch-detail-comment-author {
  color: var(--surface-text);
  text-decoration: none;
}

body.page-forum .forum-reply-item.is-local-subtree .watch-detail-comment-author {
  font-weight: 630;
}

body.page-forum .forum-reply-item.is-local-subtree-root .watch-detail-comment-author {
  text-decoration: none;
}

body.page-forum .forum-replies-children.is-local-subtree-branch::before {
  background: color-mix(in srgb, var(--forum-accent) 47%, var(--forum-divider)) !important;
}

body.page-forum .forum-replies-children.is-local-subtree-branch > .forum-reply-item::before {
  border-color: color-mix(in srgb, var(--forum-accent) 47%, var(--forum-divider));
}

/* Internal conversation tree: every actual children list owns one quiet vertical guide. */
body.page-forum .forum-reply-item::before { content: none; }

body.page-forum .forum-replies-children {
  position: relative;
  display: block;
  margin-top: 14px;
  padding-left: 30px;
}

/* A guide exists only when this reply has actual rendered children. */
body.page-forum .forum-replies-children::before {
  content: "";
  position: absolute;
  top: -9px;
  bottom: 25px;
  left: 9px;
  width: 1px;
  background: var(--forum-divider-strong);
  transition: background-color 180ms ease;
}

/* Each child joins its own parent's guide with a rounded, understated elbow. */
body.page-forum .forum-replies-children > .forum-reply-item {
  position: relative;
}

body.page-forum .forum-replies-children > .forum-reply-item::before {
  content: "";
  position: absolute;
  top: 9px;
  left: -21px;
  width: 21px;
  height: 12px;
  border-bottom: 1px solid var(--forum-divider-strong);
  border-left: 1px solid var(--forum-divider-strong);
  border-bottom-left-radius: 8px;
  background: transparent;
  transition: border-color 180ms ease;
}

/* The source order in the DOM keeps actions fixed; the editor starts a new block below them. */
body.page-forum .forum-reply-item > .forum-reply-actions {
  display: inline-flex !important;
  width: fit-content;
  min-height: 25px;
  margin-bottom: 0;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

body.page-forum .forum-reply-item > .forum-inline-reply-form {
  display: grid;
  clear: both;
  width: min(100%, 760px);
  margin-top: 10px;
  margin-bottom: 2px;
}

/* A real SVG, centered by grid, avoids the glyph baseline offset of the former arrow. */
body.page-forum .forum-page.is-thread-detail-open .forum-thread-back-btn--compact {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  line-height: 0;
}

body.page-forum .forum-thread-back-btn--compact svg {
  display: block;
  width: 15px;
  height: 15px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 620px) {
  body.page-forum .forum-replies-children { padding-left: 23px; }
  body.page-forum .forum-replies-children::before { left: 7px; }
  body.page-forum .forum-replies-children > .forum-reply-item::before {
    left: -16px;
    width: 16px;
  }
}

/* One rail belongs to each reply that owns a rendered children list. */
body.page-forum .forum-replies-children::before { content: none; }

body.page-forum .forum-reply-item:has(> .forum-replies-children)::after {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 26px;
  left: 9px;
  width: 1px;
  background: var(--forum-divider-strong);
  pointer-events: none;
  transition: background-color 180ms ease;
}

/* The elbows meet the rail of their direct parent, never a global branch line. */
body.page-forum .forum-replies-children > .forum-reply-item::before {
  top: 9px;
  left: -21px;
  width: 21px;
  border-bottom-color: var(--forum-divider-strong);
  border-left-color: var(--forum-divider-strong);
}

body.page-forum .forum-reply-item.is-local-subtree-root:has(> .forum-replies-children)::after,
body.page-forum .forum-reply-item.is-local-subtree:has(> .forum-replies-children)::after {
  background: color-mix(in srgb, var(--forum-accent) 47%, var(--forum-divider));
}

body.page-forum .forum-reply-branch-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  margin: 8px 0 4px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--forum-divider) 90%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--forum-soft) 64%, transparent);
  color: var(--forum-muted);
  font: 550 0.69rem/1 var(--forum-reading-font);
  letter-spacing: 0;
  box-shadow: none;
}

body.page-forum .forum-reply-branch-toggle:hover,
body.page-forum .forum-reply-branch-toggle:focus-visible {
  border-color: var(--forum-divider-strong);
  background: var(--forum-soft);
  color: var(--surface-text);
}

/* The action row and its editor are distinct block siblings in normal document flow. */
body.page-forum .forum-reply-item > .forum-reply-actions {
  display: inline-flex !important;
  position: relative;
  width: fit-content;
  min-height: 25px;
  margin-top: 9px;
  margin-bottom: 0;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  vertical-align: top;
}

body.page-forum .forum-reply-item > .forum-inline-reply-form {
  display: grid;
  clear: both;
  position: relative;
  width: min(100%, 760px);
  max-width: 760px;
  margin: 10px 0 2px;
}

body.page-forum .forum-inline-composer-actions,
body.page-forum .forum-reply-composer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 32px;
}

body.page-forum .forum-inline-composer-actions .forum-reply-file-row,
body.page-forum .forum-reply-composer-actions .forum-reply-file-row {
  display: flex;
  grid-column: 1;
  align-items: center;
  min-height: 32px;
}

body.page-forum .forum-inline-composer-actions .forum-inline-reply-actions,
body.page-forum .forum-reply-composer-actions .forum-form-actions {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  justify-content: flex-end !important;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
}

body.page-forum .forum-inline-reply-form .forum-inline-image-trigger,
body.page-forum .forum-reply-form .forum-question-file-trigger,
body.page-forum .forum-inline-reply-form .forum-action-btn,
body.page-forum .forum-reply-form .forum-action-btn {
  box-sizing: border-box;
  min-height: 32px;
  padding-block: 0;
  border-radius: 999px;
}

/* Generous SVG bounds plus visible overflow keep both arrowhead and tail intact. */
body.page-forum .forum-page.is-thread-detail-open .forum-thread-back-btn--compact {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  overflow: visible;
  line-height: 0;
}

body.page-forum .forum-thread-back-btn--compact svg {
  display: block;
  width: 16px;
  height: 16px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 620px) {
  body.page-forum .forum-reply-item:has(> .forum-replies-children)::after { left: 7px; }
  body.page-forum .forum-replies-children > .forum-reply-item::before {
    left: -16px;
    width: 16px;
  }
}

/* Rail length is measured against the elbow of the final direct child, never the whole reply box. */
body.page-forum .forum-reply-item:has(> .forum-replies-children)::after {
  top: 13px;
  bottom: auto;
  height: var(--reply-rail-height, 0px);
}

/* Reply body is a vertical flow: actions and the optional editor are independent block siblings. */
body.page-forum .forum-reply-item { display: block !important; }

body.page-forum .forum-reply-item > .forum-reply-actions {
  display: flex !important;
  width: max-content !important;
  max-width: 100%;
  min-height: 25px;
  flex: 0 0 auto;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 6px;
}

body.page-forum .forum-reply-actions > .forum-vote-controls {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
}

body.page-forum .forum-inline-reply-slot[hidden] { display: none !important; }

body.page-forum .forum-reply-item > .forum-inline-reply-slot:not([hidden]) {
  display: block;
  clear: both;
  width: min(100%, 760px);
  margin: 10px 0 2px;
}

body.page-forum .forum-inline-reply-slot > .forum-inline-reply-form {
  display: grid !important;
  width: 100%;
  max-width: 760px;
  margin: 0;
}

body.page-forum .forum-inline-reply-slot > .forum-inline-reply-form[hidden] { display: none !important; }

body.page-forum .forum-reply-item:has(> .forum-inline-reply-slot:not([hidden])) .forum-reply-to-button {
  background: var(--forum-soft) !important;
  color: var(--surface-text);
}

/* Expanded branches use only a compact minus control; collapsed branches expose the reply count. */
body.page-forum .forum-reply-branch-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  margin: 8px 0 4px;
  border: 1px solid color-mix(in srgb, var(--forum-divider) 88%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--forum-soft) 64%, transparent);
  color: var(--forum-muted);
  font: 550 0.69rem/1 var(--forum-reading-font);
  box-shadow: none;
}

body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] {
  position: absolute;
  top: var(--reply-collapse-control-top, 0px);
  left: -4px;
  z-index: 2;
  width: 25px;
  min-width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
  margin: 0;
}

body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] .forum-reply-branch-toggle-label { display: none; }
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] { padding: 3px 8px; }
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] .forum-reply-branch-toggle-icon { display: none; }

/* Keep both composer actions geometrically identical within their shared lower row. */
body.page-forum .forum-inline-composer-actions,
body.page-forum .forum-reply-composer-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 32px;
}

body.page-forum .forum-inline-composer-actions .forum-reply-file-row,
body.page-forum .forum-reply-composer-actions .forum-reply-file-row,
body.page-forum .forum-inline-composer-actions .forum-inline-reply-actions,
body.page-forum .forum-reply-composer-actions .forum-form-actions {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
}

body.page-forum .forum-inline-composer-actions .forum-inline-reply-actions,
body.page-forum .forum-reply-composer-actions .forum-form-actions {
  justify-content: flex-end !important;
}

@media (max-width: 620px) {
  body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] { left: -6px; }
}

/* Final thread-spacing correction: rails stay in the gutter, never through comment information. */
body.page-forum .forum-replies-children {
  padding-left: 37px;
}

body.page-forum .forum-replies-children > .forum-reply-item::before {
  left: -28px;
  width: 28px;
}

body.page-forum .forum-reply-item:has(> .forum-replies-children)::after { left: 9px; }

/* The solid dark circle masks the guide at its centre, so the minus reads as part of the rail. */
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] {
  z-index: 3;
  border-color: #211916;
  background: #211916;
  color: #fffdf9;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 0 0 2px var(--theme-surface-bg);
}

body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:hover,
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:focus-visible {
  border-color: #211916;
  background: #3b2b24;
  color: #fffdf9;
}

/* The actions are one non-wrapping row. The editor lives only in its next block sibling. */
body.page-forum .forum-reply-item > .forum-reply-actions {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-start;
  width: max-content !important;
  min-width: max-content;
  white-space: nowrap;
}

/* Canonical action/editor structure: this wrapper is the only layout owner for both elements. */
body.page-forum .forum-reply-item > .forum-reply-interaction {
  display: block;
  grid-column: 1;
  width: 100%;
  margin-left: 8px;
}

body.page-forum .forum-reply-interaction > .forum-reply-action-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: max-content !important;
  min-width: max-content;
  min-height: 25px;
  margin: 9px 0 0;
  padding: 0;
  position: static !important;
  float: none !important;
  white-space: nowrap;
}

body.page-forum .forum-reply-interaction > .forum-reply-actions > .forum-reply-to-button,
body.page-forum .forum-reply-interaction > .forum-reply-actions > .forum-vote-controls,
body.page-forum .forum-reply-interaction .forum-vote-controls > .forum-vote-button {
  position: static !important;
  flex: 0 0 auto;
}

body.page-forum .forum-reply-interaction > .forum-inline-reply-slot[hidden] { display: none !important; }

body.page-forum .forum-reply-interaction > .forum-inline-reply-slot:not([hidden]) {
  display: block;
  width: min(calc(100% - 8px), 760px);
  max-width: 760px;
  margin: 10px 0 2px;
  padding: 0;
  clear: both;
}

body.page-forum .forum-reply-interaction > .forum-inline-reply-slot > .forum-inline-reply-form {
  display: grid !important;
  width: 100%;
  max-width: none;
  margin: 0;
}

body.page-forum .forum-reply-item.forum-inline-layout-legacy:has(> .forum-reply-interaction > .forum-inline-reply-slot:not([hidden])) .forum-reply-to-button {
  background: var(--forum-soft) !important;
  color: var(--surface-text);
}

/* Authoritative final thread-gutter rules. They follow the legacy forum CSS
   intentionally, so no earlier visual iteration can reopen or offset a rail. */
body.page-forum .forum-reply-item { --forum-reply-rail-x: 20px; }

body.page-forum .forum-replies-children { padding-left: 48px !important; }

body.page-forum .forum-reply-item:has(> .forum-replies-children)::after {
  left: var(--forum-reply-rail-x) !important;
  z-index: 0;
}

body.page-forum .forum-replies-children > .forum-reply-item::before {
  content: "" !important;
  left: -28px !important;
  width: 28px !important;
  z-index: 1;
}

body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] {
  width: 19px !important;
  min-width: 19px !important;
  height: 19px !important;
  min-height: 19px !important;
  left: calc(var(--forum-reply-rail-x) - 9.5px) !important;
  padding: 0 !important;
  border: 1px solid #211916 !important;
  border-radius: 50% !important;
  background: var(--theme-surface-bg) !important;
  color: #211916 !important;
  font-size: 0.9rem !important;
  line-height: 17px !important;
  box-shadow: 0 0 0 3px var(--theme-surface-bg) !important;
  z-index: 4 !important;
}

body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:hover,
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:focus-visible {
  background: var(--theme-surface-bg) !important;
  color: #211916 !important;
}
/* A collapsed branch remains a compact continuation of its rail, never a text pill. */
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] {
  position: absolute !important;
  top: calc(var(--reply-rail-top, 13px) + 22px) !important;
  left: calc(var(--forum-reply-rail-x) - 9.5px) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 19px !important;
  min-width: 19px !important;
  height: 19px !important;
  min-height: 19px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #211916 !important;
  border-radius: 50% !important;
  background: var(--theme-surface-bg) !important;
  color: #211916 !important;
  font-size: 0.88rem !important;
  line-height: 17px !important;
  box-shadow: 0 0 0 3px var(--theme-surface-bg) !important;
  z-index: 4 !important;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] .forum-reply-branch-toggle-icon { display: inline !important; }
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] .forum-reply-branch-toggle-label { display: none !important; }
body.page-forum .forum-reply-item:has(> .forum-reply-branch-toggle[aria-expanded="false"])::after {
  content: "";
  position: absolute;
  top: var(--reply-rail-top, 13px);
  left: var(--forum-reply-rail-x);
  width: 1px;
  height: 31px;
  background: var(--forum-divider-strong);
  z-index: 0;
}

body.page-forum .forum-reply-to-button.is-active {
  background: var(--forum-soft) !important;
  color: var(--surface-text);
}

body.page-forum .forum-reply-item.is-local-subtree:has(> .forum-replies-children)::after {
  background: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
}

body.page-forum .forum-replies-children.is-local-subtree-branch > .forum-reply-item::before {
  content: "" !important;
  border-bottom-color: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
  border-left-color: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
}

@media (max-width: 620px) {
  body.page-forum .forum-reply-item { --forum-reply-rail-x: 19px; }
  body.page-forum .forum-replies-children { padding-left: 42px !important; }
  body.page-forum .forum-replies-children > .forum-reply-item::before {
    left: -23px !important;
    width: 23px !important;
  }
}

/* Measured geometry overrides fixed nesting offsets: avatar centre → rail → elbow. */
body.page-forum .forum-replies-children > .forum-reply-item::before {
  left: var(--reply-elbow-left, -28px) !important;
  width: var(--reply-elbow-width, 28px) !important;
}

/* A rail must never cross the reading column of the reply that owns it. */
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-parent-reference,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-body,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-image-link,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-interaction {
  margin-left: var(--reply-content-offset, 28px) !important;
}

/* Inline composer: one relaxed lower row, with controls on the same Y axis. */
body.page-forum .forum-inline-composer-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 40px !important;
}
body.page-forum .forum-inline-composer-actions .forum-reply-file-row,
body.page-forum .forum-inline-composer-actions .forum-inline-reply-actions {
  display: flex !important;
  align-items: center !important;
  min-height: 40px !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
body.page-forum .forum-inline-reply-form .forum-inline-image-trigger,
body.page-forum .forum-inline-reply-form .forum-action-btn {
  box-sizing: border-box !important;
  min-height: 40px !important;
  height: 40px !important;
  margin: 0 !important;
}
body.page-forum .forum-inline-reply-form .forum-inline-reply-to {
  display: flex !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  gap: 4px !important;
}
body.page-forum .forum-inline-reply-form .forum-inline-reply-to strong {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 620px) {
  body.page-forum .forum-replies-children > .forum-reply-item::before {
    left: var(--reply-elbow-left, -23px) !important;
    width: var(--reply-elbow-width, 23px) !important;
  }
  body.page-forum .forum-reply-interaction > .forum-inline-reply-slot:not([hidden]) {
    width: min(calc(100vw - 108px), 430px) !important;
  }
}

/* Final rail geometry: the guide starts at the avatar centre, lives entirely
   in the gutter, and is masked cleanly by its compact collapse control. */
body.page-forum .forum-reply-item {
  --forum-reply-rail-x: 20px;
}

body.page-forum .forum-replies-children {
  padding-left: 48px !important;
}

body.page-forum .forum-reply-item:has(> .forum-replies-children)::after {
  left: var(--forum-reply-rail-x) !important;
  z-index: 0;
}

body.page-forum .forum-replies-children > .forum-reply-item::before {
  content: "" !important;
  left: -28px !important;
  width: 28px !important;
  z-index: 1;
}

body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] {
  width: 19px !important;
  min-width: 19px !important;
  height: 19px !important;
  min-height: 19px !important;
  left: calc(var(--forum-reply-rail-x) - 9.5px) !important;
  padding: 0 !important;
  border: 1px solid #211916 !important;
  border-radius: 50% !important;
  background: var(--theme-surface-bg) !important;
  color: #211916 !important;
  font-size: 0.9rem !important;
  line-height: 17px !important;
  box-shadow: 0 0 0 3px var(--theme-surface-bg) !important;
  z-index: 4 !important;
}

body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:hover,
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:focus-visible {
  background: var(--theme-surface-bg) !important;
  color: #211916 !important;
}

body.page-forum .forum-reply-to-button.is-active {
  background: var(--forum-soft) !important;
  color: var(--surface-text);
}

/* Highlight every existing rail and elbow in the selected local subtree. */
body.page-forum .forum-reply-item.is-local-subtree:has(> .forum-replies-children)::after {
  background: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
}

body.page-forum .forum-replies-children.is-local-subtree-branch > .forum-reply-item::before {
  content: "" !important;
  border-bottom-color: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
  border-left-color: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
}

@media (max-width: 620px) {
  body.page-forum .forum-reply-item { --forum-reply-rail-x: 19px; }
  body.page-forum .forum-replies-children { padding-left: 42px !important; }
  body.page-forum .forum-replies-children > .forum-reply-item::before {
    left: -23px !important;
    width: 23px !important;
  }
}

/* Inline-reply layout contract: one real grid column, so the editor cannot share the action row. */
body.page-forum .forum-reply-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  align-items: start;
}

body.page-forum .forum-reply-item > .forum-reply-head,
body.page-forum .forum-reply-item > .forum-reply-parent-reference,
body.page-forum .forum-reply-item > .forum-reply-body,
body.page-forum .forum-reply-item > .forum-reply-image-link,
body.page-forum .forum-reply-item > .forum-reply-actions,
body.page-forum .forum-reply-item > .forum-inline-reply-slot,
body.page-forum .forum-reply-item > .forum-reply-branch-toggle,
body.page-forum .forum-reply-item > .forum-replies-children {
  grid-column: 1;
  justify-self: start;
}

body.page-forum .forum-reply-item > .forum-reply-actions {
  position: static !important;
  float: none !important;
  align-self: start;
  justify-self: start;
}

body.page-forum .forum-reply-actions > .forum-vote-controls,
body.page-forum .forum-vote-controls > .forum-vote-button {
  position: static !important;
  float: none !important;
}

body.page-forum .forum-reply-item > .forum-inline-reply-slot:not([hidden]) {
  grid-column: 1;
  grid-row: auto;
  align-self: start;
  justify-self: start;
}

body.page-forum .forum-reply-actions > .forum-reply-to-button,
body.page-forum .forum-reply-actions > .forum-vote-controls,
body.page-forum .forum-vote-controls > .forum-vote-button {
  flex: 0 0 auto;
}

body.page-forum .forum-reply-item > .forum-inline-reply-slot:not([hidden]) {
  display: block;
  clear: both;
  width: min(100%, 760px);
  max-width: 760px;
}

@media (max-width: 620px) {
  body.page-forum .forum-replies-children { padding-left: 30px; }
  body.page-forum .forum-replies-children > .forum-reply-item::before {
    left: -23px;
    width: 23px;
  }
  body.page-forum .forum-reply-item:has(> .forum-replies-children)::after { left: 7px; }
}

/* Keep all reply information clear of the rails, at every nesting level. */
body.page-forum .forum-reply-item > .forum-reply-head,
body.page-forum .forum-reply-item > .forum-reply-parent-reference,
body.page-forum .forum-reply-item > .forum-reply-body,
body.page-forum .forum-reply-item > .forum-reply-image-link,
body.page-forum .forum-reply-item > .forum-reply-actions,
body.page-forum .forum-reply-item > .forum-inline-reply-slot {
  margin-left: 8px;
}

body.page-forum .forum-reply-item > .forum-inline-reply-slot:not([hidden]) {
  width: min(calc(100% - 8px), 760px);
}

/* Reddit-like control: dark outline and minus, opaque page-colour centre to interrupt the rail. */
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] {
  border-color: #211916;
  background: var(--theme-surface-bg);
  color: #211916;
  box-shadow: 0 0 0 2px var(--theme-surface-bg);
}

body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:hover,
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:focus-visible {
  border-color: #211916;
  background: var(--forum-soft);
  color: #211916;
}

/* The parent reference lights its entire local subtree: rail and every elbow, never only the label. */
body.page-forum .forum-reply-item.is-local-subtree:has(> .forum-replies-children)::after {
  background: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
}

body.page-forum .forum-replies-children.is-local-subtree-branch > .forum-reply-item::before {
  border-bottom-color: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
  border-left-color: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
}

/* Preserve the action row as one unmovable row while the editor occupies the next block. */
body.page-forum .forum-reply-item > .forum-reply-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: max-content !important;
  min-width: max-content;
  white-space: nowrap;
}

/*
 * Canonical inline-reply layout.  Older forum iterations styled an action row
 * and a composer as direct children of the reply.  They are now deliberately
 * contained here, in two explicit grid rows: controls first, composer second.
 * This is structural layout, not a spacing workaround.
 */
body.page-forum .forum-reply-item > .forum-reply-interaction {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas:
    "actions"
    "editor";
  grid-auto-flow: row !important;
  align-items: start !important;
  justify-items: start !important;
  width: 100% !important;
  margin: 0 0 0 8px !important;
  padding: 0 !important;
  position: static !important;
}

body.page-forum .forum-reply-interaction > .forum-reply-action-row {
  display: inline-flex !important;
  grid-area: actions !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: start !important;
  justify-self: start !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: max-content !important;
  min-width: max-content !important;
  min-height: 25px;
  gap: 6px !important;
  margin: 9px 0 0 !important;
  padding: 0 !important;
  position: static !important;
  inset: auto !important;
  float: none !important;
  transform: none !important;
  white-space: nowrap !important;
}

body.page-forum .forum-reply-interaction > .forum-reply-action-row > .forum-reply-to-button,
body.page-forum .forum-reply-interaction > .forum-reply-action-row > .forum-vote-controls,
body.page-forum .forum-reply-interaction > .forum-reply-action-row .forum-vote-button {
  position: static !important;
  inset: auto !important;
  float: none !important;
  transform: none !important;
  flex: 0 0 auto !important;
}

body.page-forum .forum-reply-interaction > .forum-reply-action-row > .forum-vote-controls {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  margin: 0 !important;
}

body.page-forum .forum-reply-interaction > .forum-inline-reply-slot[hidden] {
  display: none !important;
}

body.page-forum .forum-reply-interaction > .forum-inline-reply-slot:not([hidden]) {
  display: block !important;
  grid-area: editor !important;
  grid-column: 1 !important;
  grid-row: 2 !important;
  align-self: start !important;
  justify-self: start !important;
  clear: both !important;
  width: min(calc(100% - 8px), 760px) !important;
  max-width: 760px !important;
  margin: 10px 0 2px !important;
  padding: 0 !important;
  position: static !important;
  inset: auto !important;
  float: none !important;
  transform: none !important;
}

body.page-forum .forum-reply-interaction > .forum-inline-reply-slot > .forum-inline-reply-form {
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

body.page-forum .forum-reply-item:has(> .forum-reply-interaction > .forum-inline-reply-slot:not([hidden])) .forum-reply-to-button {
  background: var(--forum-soft) !important;
  color: var(--surface-text);
}

/* Final authority: do not let legacy branch rules override this geometry. */
body.page-forum .forum-reply-item { --forum-reply-rail-x: 20px; }
body.page-forum .forum-replies-children { padding-left: 48px !important; }
body.page-forum .forum-reply-item:has(> .forum-replies-children)::after {
  left: var(--forum-reply-rail-x) !important;
  top: var(--reply-rail-top, 13px) !important;
  z-index: 0;
}
body.page-forum .forum-replies-children > .forum-reply-item::before {
  content: "" !important;
  top: var(--reply-elbow-top, 9px) !important;
  left: var(--reply-elbow-left, -28px) !important;
  width: var(--reply-elbow-width, 28px) !important;
  height: 12px !important;
  z-index: 1;
}

body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-parent-reference,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-body,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-image-link,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-interaction {
  margin-left: var(--reply-content-offset, 28px) !important;
}

body.page-forum .forum-inline-reply-form {
  border-radius: 7px !important;
  padding: 19px 20px 18px !important;
  gap: 13px !important;
}
body.page-forum .forum-inline-composer-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 36px !important;
}
body.page-forum .forum-inline-composer-actions .forum-reply-file-row,
body.page-forum .forum-inline-composer-actions .forum-inline-reply-actions {
  display: flex !important;
  align-items: center !important;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
body.page-forum .forum-inline-reply-form .forum-inline-image-trigger,
body.page-forum .forum-inline-reply-form .forum-action-btn {
  box-sizing: border-box !important;
  height: 32px !important;
  min-height: 32px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  padding-inline: 12px !important;
}
body.page-forum .forum-inline-reply-form .forum-inline-reply-to,
body.page-forum .forum-inline-reply-form .forum-inline-reply-to strong {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] {
  width: 19px !important;
  min-width: 19px !important;
  height: 19px !important;
  min-height: 19px !important;
  left: calc(var(--forum-reply-rail-x) - 9.5px) !important;
  padding: 0 !important;
  border: 1px solid #211916 !important;
  border-radius: 50% !important;
  background: var(--theme-surface-bg) !important;
  color: #211916 !important;
  font-size: 0.9rem !important;
  line-height: 17px !important;
  box-shadow: 0 0 0 3px var(--theme-surface-bg) !important;
  z-index: 4 !important;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:hover,
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:focus-visible {
  background: var(--theme-surface-bg) !important;
  color: #211916 !important;
}
body.page-forum .forum-reply-to-button.is-active {
  background: var(--forum-soft) !important;
  color: var(--surface-text);
}
body.page-forum .forum-reply-item.is-local-subtree:has(> .forum-replies-children)::after {
  background: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
}
body.page-forum .forum-replies-children.is-local-subtree-branch > .forum-reply-item::before {
  content: "" !important;
  border-bottom-color: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
  border-left-color: color-mix(in srgb, var(--forum-accent) 58%, var(--forum-divider)) !important;
}
@media (max-width: 620px) {
  body.page-forum .forum-reply-item { --forum-reply-rail-x: 19px; }
  body.page-forum .forum-replies-children { padding-left: 42px !important; }
  body.page-forum .forum-replies-children > .forum-reply-item::before {
    left: var(--reply-elbow-left, -23px) !important;
    width: var(--reply-elbow-width, 23px) !important;
  }
  body.page-forum .forum-reply-interaction > .forum-inline-reply-slot:not([hidden]) {
    width: min(calc(100vw - 82px), 440px) !important;
    max-width: none !important;
  }
}

/* One measured SVG layer owns every rail and elbow in the reply tree. */
body.page-forum .forum-replies-list {
  --forum-reply-avatar-size: 22px;
  --forum-thread-indent: 48px;
  --forum-thread-content-offset: 12px;
  --forum-thread-nested-head-offset: 12px;
  --forum-thread-rail-content-clearance: 36px;
  --forum-thread-line-width: 1px;
  --forum-thread-avatar-gap: 5px;
  --forum-thread-elbow-radius: 7px;
  --forum-thread-control-radius: 9px;
  --forum-thread-control-rail-gap: 2px;
  --forum-thread-control-ink: color-mix(in srgb, var(--surface-text) 60%, var(--forum-divider-strong));
  --forum-thread-control-edge: color-mix(in srgb, var(--surface-text) 46%, var(--forum-divider));
  position: relative;
}
body.page-forum .forum-reply-meta .watch-detail-comment-avatar,
body.page-forum .forum-reply-meta .watch-detail-comment-avatar img {
  width: var(--forum-reply-avatar-size);
  height: var(--forum-reply-avatar-size);
}
body.page-forum .forum-replies-children {
  padding-left: calc(var(--forum-thread-indent) + var(--forum-thread-content-offset)) !important;
}
body.page-forum .forum-reply-item::before,
body.page-forum .forum-reply-item::after,
body.page-forum .forum-replies-children::before,
body.page-forum .forum-replies-children > .forum-reply-item::before {
  content: none !important;
}
body.page-forum .forum-thread-geometry {
  position: absolute;
  inset: 0 auto auto 0;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
body.page-forum .forum-thread-geometry-path {
  fill: none;
  stroke: var(--forum-divider-strong);
  stroke-width: var(--forum-thread-line-width);
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.page-forum .forum-replies-list > .forum-reply-item,
body.page-forum .forum-replies-children > .forum-reply-item {
  position: relative;
  z-index: 1;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"],
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] {
  position: absolute !important;
  top: var(--reply-collapse-y, 0px) !important;
  left: var(--reply-collapse-x, 0px) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: calc(var(--forum-thread-control-radius) * 2) !important;
  min-width: calc(var(--forum-thread-control-radius) * 2) !important;
  height: calc(var(--forum-thread-control-radius) * 2) !important;
  min-height: calc(var(--forum-thread-control-radius) * 2) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #211916 !important;
  border-radius: 50% !important;
  background: var(--theme-surface-bg) !important;
  color: #211916 !important;
  box-shadow: 0 0 0 3px var(--theme-surface-bg) !important;
  z-index: 3 !important;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] .forum-reply-branch-toggle-label { display: none !important; }
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] .forum-reply-branch-toggle-icon { display: inline !important; }
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] .forum-reply-branch-toggle-label {
  display: block !important;
  position: absolute;
  left: calc(100% + 8px);
  width: max-content;
  color: var(--forum-muted);
  font: 500 0.71rem/1 var(--forum-reading-font);
  white-space: nowrap;
}

/* Final tree integration: SVG is the single visual source for rails and elbows. */
body.page-forum .forum-thread-geometry-path {
  stroke: var(--forum-divider-strong);
  stroke-width: var(--forum-thread-line-width);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  transition: stroke 180ms ease, opacity 180ms ease;
}
body.page-forum .forum-thread-geometry-path[data-forum-geometry-kind="connection"] {
  opacity: 0;
  stroke: color-mix(in srgb, var(--forum-accent) 84%, var(--forum-divider-strong));
}
body.page-forum .forum-thread-geometry-path[data-forum-geometry-kind="connection"].is-parent-path-highlight {
  opacity: 1;
  stroke: color-mix(in srgb, var(--forum-accent) 84%, var(--forum-divider-strong));
}
/* Do not resurrect former pseudo-connector treatments while a parent is inspected. */
body.page-forum .forum-reply-item.is-local-subtree-root {
  background: transparent !important;
  border-radius: 0 !important;
}
body.page-forum .forum-reply-item.is-local-subtree-root .watch-detail-comment-author {
  text-decoration: none !important;
}

/* An open branch is a small interruption centred directly over its own rail. */
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] {
  position: absolute !important;
  inset: auto !important;
  top: var(--reply-collapse-y, 0px) !important;
  left: var(--reply-collapse-x, 0px) !important;
  width: calc(var(--forum-thread-control-radius) * 2) !important;
  min-width: calc(var(--forum-thread-control-radius) * 2) !important;
  height: calc(var(--forum-thread-control-radius) * 2) !important;
  min-height: calc(var(--forum-thread-control-radius) * 2) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--forum-thread-control-edge) !important;
  border-radius: 50% !important;
  background: var(--theme-surface-bg) !important;
  color: var(--forum-thread-control-ink) !important;
  box-shadow: 0 0 0 1px var(--theme-surface-bg) !important;
  transform: none !important;
  z-index: 3 !important;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] .forum-reply-branch-toggle-label {
  display: none !important;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"] .forum-reply-branch-toggle-icon {
  line-height: 1;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:hover,
body.page-forum .forum-reply-branch-toggle[aria-expanded="true"]:focus-visible {
  border-color: var(--forum-thread-control-edge) !important;
  background: color-mix(in srgb, var(--forum-soft) 68%, var(--theme-surface-bg)) !important;
  color: var(--forum-thread-control-ink) !important;
}

/* A closed branch has its own in-flow row at the virtual child-avatar position. */
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: auto !important;
  min-width: 0 !important;
  height: calc(var(--forum-thread-control-radius) * 2) !important;
  min-height: calc(var(--forum-thread-control-radius) * 2) !important;
  margin: 13px 0 13px var(--reply-collapse-flow-offset, 0px) !important;
  padding: 0 !important;
  gap: 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--forum-muted) !important;
  box-shadow: none !important;
  transform: none !important;
  z-index: 2 !important;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] .forum-reply-branch-toggle-icon {
  display: grid !important;
  place-items: center;
  width: calc(var(--forum-thread-control-radius) * 2);
  height: calc(var(--forum-thread-control-radius) * 2);
  flex: 0 0 calc(var(--forum-thread-control-radius) * 2);
  border: 1px solid var(--forum-thread-control-edge);
  border-radius: 50%;
  background: var(--theme-surface-bg);
  color: var(--forum-thread-control-ink);
  box-shadow: 0 0 0 1px var(--theme-surface-bg);
  box-sizing: border-box;
  padding: 0 0 1px;
  font: 500 1rem/1 Arial, sans-serif;
  line-height: 1;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"] .forum-reply-branch-toggle-label {
  display: block !important;
  position: static !important;
  width: auto !important;
  color: var(--forum-muted) !important;
  font: 500 0.71rem/1 var(--forum-reading-font) !important;
  white-space: nowrap;
}
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"]:hover .forum-reply-branch-toggle-icon,
body.page-forum .forum-reply-branch-toggle[aria-expanded="false"]:focus-visible .forum-reply-branch-toggle-icon {
  border-color: var(--forum-thread-control-edge);
  background: color-mix(in srgb, var(--forum-soft) 68%, var(--theme-surface-bg));
  color: var(--forum-thread-control-ink);
}

/* The collapsed continuation is one stable, self-sized line in the tree. */
body.page-forum .forum-reply-item > .forum-reply-branch-toggle[aria-expanded="false"] {
  justify-self: start !important;
  align-self: start !important;
  width: max-content !important;
  max-width: calc(100% - var(--reply-collapse-flow-offset, 0px)) !important;
  white-space: nowrap !important;
  isolation: isolate;
}
body.page-forum .forum-reply-item > .forum-reply-branch-toggle[aria-expanded="false"]:hover,
body.page-forum .forum-reply-item > .forum-reply-branch-toggle[aria-expanded="false"]:focus-visible {
  margin: 13px 0 13px var(--reply-collapse-flow-offset, 0px) !important;
  transform: none !important;
}

/* A nested reply is offset as one coherent unit: avatar, metadata, copy,
 * actions, controls and its inline composer all clear the rail by the same gap. */
body.page-forum .forum-replies-children > .forum-reply-item > .forum-reply-head,
body.page-forum .forum-replies-children > .forum-reply-item > .forum-reply-parent-reference,
body.page-forum .forum-replies-children > .forum-reply-item > .forum-reply-body,
body.page-forum .forum-replies-children > .forum-reply-item > .forum-reply-image-link,
body.page-forum .forum-replies-children > .forum-reply-item > .forum-reply-interaction,
body.page-forum .forum-replies-children > .forum-reply-item > .forum-reply-actions,
body.page-forum .forum-replies-children > .forum-reply-item > .forum-inline-reply-slot {
  margin-left: var(--forum-thread-content-offset) !important;
}

/* A reply that owns a rail keeps its reading column to the rail's right.  The
 * avatar remains on the measured rail axis; contextual text, copy, actions and
 * the composer start beyond the avatar instead of beneath the descending line. */
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-parent-reference,
body.page-forum .forum-reply-item:has(> .forum-reply-branch-toggle[aria-expanded="false"]) > .forum-reply-parent-reference,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-body,
body.page-forum .forum-reply-item:has(> .forum-reply-branch-toggle[aria-expanded="false"]) > .forum-reply-body,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-image-link,
body.page-forum .forum-reply-item:has(> .forum-reply-branch-toggle[aria-expanded="false"]) > .forum-reply-image-link,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-interaction,
body.page-forum .forum-reply-item:has(> .forum-reply-branch-toggle[aria-expanded="false"]) > .forum-reply-interaction,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-reply-actions,
body.page-forum .forum-reply-item:has(> .forum-reply-branch-toggle[aria-expanded="false"]) > .forum-reply-actions,
body.page-forum .forum-reply-item:has(> .forum-replies-children) > .forum-inline-reply-slot,
body.page-forum .forum-reply-item:has(> .forum-reply-branch-toggle[aria-expanded="false"]) > .forum-inline-reply-slot {
  margin-left: var(--forum-thread-rail-content-clearance) !important;
}

/* Legacy pseudo-connectors are permanently disabled, including their old
 * local-subtree hover variants.  The SVG layer above is the only tree renderer. */
body.page-forum .forum-replies-list .forum-reply-item::before,
body.page-forum .forum-replies-list .forum-reply-item::after,
body.page-forum .forum-replies-list .forum-replies-children::before,
body.page-forum .forum-replies-list .forum-replies-children::after,
body.page-forum .forum-replies-list .forum-replies-children > .forum-reply-item::before,
body.page-forum .forum-replies-list .forum-replies-children > .forum-reply-item::after,
body.page-forum .forum-replies-list .forum-reply-item:has(> .forum-replies-children)::after,
body.page-forum .forum-replies-list .forum-reply-item.is-local-subtree:has(> .forum-replies-children)::after,
body.page-forum .forum-replies-list .forum-reply-item:has(> .forum-reply-branch-toggle[aria-expanded="false"])::after,
body.page-forum .forum-replies-list .forum-replies-children.is-local-subtree-branch > .forum-reply-item::before {
  content: none !important;
  background: none !important;
  border: 0 !important;
}

/* Reply reading rhythm: the parent relation remains in the DOM for the tree,
 * but no longer competes with the visual hierarchy. */
body.page-forum .forum-reply-parent-reference {
  display: none !important;
}
body.page-forum .forum-reply-interaction > .forum-reply-action-row {
  margin-top: 2px !important;
}
body.page-forum .forum-reply-item {
  padding-bottom: 30px !important;
}

/* Author, separator and timestamp form one compact, consistently spaced group. */
body.page-forum .forum-reply-meta {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
body.page-forum .forum-reply-meta-separator {
  color: var(--forum-muted);
  line-height: 1;
}
body.page-forum .forum-reply-meta-time {
  white-space: nowrap;
}

/* The collapse control is intentionally allowed to extend a few pixels into
 * the tree gutter.  The shared forum shells formerly clipped that extent at
 * the root level, leaving the first control as a semicircle. */
body.page-forum .forum-page,
body.page-forum .forum-thread-detail-panel,
body.page-forum .forum-thread-focus-card,
body.page-forum .forum-replies-block,
body.page-forum .forum-replies-list,
body.page-forum .forum-reply-item {
  overflow: visible !important;
}

/* Child lists must fill their parent's grid track.  `justify-self: start`
 * shrink-wrapped a nested subtree to its text width, which in turn kept the
 * inline editor narrow regardless of its own declared max-width. */
body.page-forum .forum-replies-children {
  width: 100% !important;
  box-sizing: border-box;
  justify-self: stretch !important;
}
body.page-forum .forum-replies-children > .forum-reply-item {
  width: 100%;
  box-sizing: border-box;
}

/* Inline editor: a writing-oriented horizontal proportion, with one stable
 * action row and a compact icon-only image removal control. */
body.page-forum .forum-reply-interaction > .forum-inline-reply-slot:not([hidden]) {
  width: min(calc(100% + 72px), 980px) !important;
  max-width: 980px !important;
}
@media (max-width: 620px) {
  body.page-forum .forum-reply-interaction > .forum-inline-reply-slot:not([hidden]) {
    width: 100% !important;
    max-width: 100% !important;
  }
}
body.page-forum .forum-inline-reply-form {
  width: 100% !important;
  max-width: none !important;
  gap: 8px !important;
  padding: 14px 16px 13px !important;
}
body.page-forum .forum-inline-reply-form textarea {
  /* Do not make the initial height important: Chrome applies the user's
   * native resize as a runtime height, which an author !important height
   * prevents from taking visual effect. */
  height: 84px;
  min-height: 84px !important;
  max-height: none !important;
  max-block-size: none !important;
  overflow: auto !important;
  resize: vertical !important;
}
body.page-forum .forum-inline-composer-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-height: 32px !important;
  margin-top: 1px !important;
}
body.page-forum .forum-inline-composer-actions .forum-reply-file-row {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 32px !important;
  min-height: 32px !important;
}
body.page-forum .forum-inline-composer-actions .forum-inline-reply-actions {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  height: 32px !important;
  min-height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
body.page-forum .forum-inline-reply-form .forum-inline-image-trigger,
body.page-forum .forum-inline-reply-form .forum-action-btn {
  height: 32px !important;
  min-height: 32px !important;
}
body.page-forum .forum-inline-reply-form .forum-inline-image-clear {
  display: inline-grid !important;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, var(--forum-divider) 78%, transparent);
  border-radius: 50%;
  background: transparent;
  color: var(--forum-muted);
}
body.page-forum .forum-inline-reply-form .forum-inline-image-clear[hidden] {
  display: none !important;
}
body.page-forum .forum-inline-reply-form .forum-inline-image-clear svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}
body.page-forum .forum-inline-reply-form .forum-inline-image-clear:hover,
body.page-forum .forum-inline-reply-form .forum-inline-image-clear:focus-visible {
  border-color: var(--forum-divider-strong);
  background: var(--forum-soft);
  color: var(--surface-text);
}

/* The thread row itself receives keyboard focus. The previous outline was
 * rectangular because outlines do not follow the row's rounded geometry. */
body.page-forum .forum-thread-card.is-clickable:focus,
body.page-forum .forum-thread-card.is-clickable:focus-within {
  outline: none;
}
body.page-forum .forum-thread-card.is-clickable:focus-visible {
  outline: none;
  border-radius: 10px;
  border-color: var(--forum-divider-strong);
  background: color-mix(in srgb, var(--forum-soft) 72%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--forum-divider-strong) 54%, transparent);
}

/* Acciones persistentes del hilo: reutilizan el compositor y la guía ya
   existentes, sin duplicar formularios ni paneles. */
body.page-forum .forum-thread-context-actions {
  display: contents;
}

body.page-forum .forum-thread-context-reply-bar {
  position: fixed;
  z-index: 1200;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  display: flex;
  width: auto;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid color-mix(in srgb, #fff 18%, transparent);
  border-radius: 4px;
  background: var(--color-brand-header);
  color: #fff;
  font-family: var(--font-header-menu);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(31, 19, 9, 0.24);
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

body.page-forum .forum-thread-context-reply-bar:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--color-brand-header) 84%, #000);
  color: #fff;
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(31, 19, 9, 0.3);
}

body.page-forum .forum-thread-context-guide {
  position: fixed;
  z-index: 1201;
  top: calc(var(--editorial-header-height, 64px) + 14px);
  right: clamp(16px, 3vw, 42px);
  display: grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--color-brand-header) 72%, transparent);
  border-radius: 50%;
  background: var(--color-brand-header);
  color: #fff;
  box-shadow: 0 7px 18px rgba(31, 19, 9, 0.18);
  transition: background-color 160ms ease, transform 160ms ease;
}

body.page-forum .forum-thread-context-guide svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

body.page-forum .forum-thread-context-guide:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--color-brand-header) 84%, #000);
  color: #fff;
  outline: none;
  transform: translateY(-1px);
}

body.page-forum .forum-page.is-thread-detail-open .forum-thread-detail-panel {
  padding-bottom: max(88px, calc(72px + env(safe-area-inset-bottom)));
}

/* El acceso fijo sustituye al teaser contextual previo. */
body.page-forum .forum-page.is-thread-detail-open .forum-reply-teaser {
  display: none !important;
}

@media (max-width: 720px) {
  body.page-forum .forum-thread-context-reply-bar {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    min-height: 44px;
  }

  body.page-forum .forum-thread-context-guide {
    top: calc(var(--editorial-header-height, 64px) + 11px);
    right: max(12px, env(safe-area-inset-right));
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-forum :is(.forum-thread-context-reply-bar, .forum-thread-context-guide) {
    transition: none;
  }
}

/* Detail actions use the existing composer as a single bottom sheet. */
body.page-forum .forum-thread-context-guide svg { stroke-width: 2.15; }

body.page-forum .forum-page.is-thread-detail-open .forum-reply-form {
  position: fixed;
  z-index: 1250;
  right: max(22px, env(safe-area-inset-right));
  bottom: var(--forum-keyboard-offset, 0px);
  left: auto;
  display: grid !important;
  width: min(620px, calc(100vw - 44px));
  max-width: 620px;
  max-height: min(78dvh, 620px);
  margin: 0;
  padding: 22px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid color-mix(in srgb, #fff 24%, transparent);
  border-radius: 13px 13px 0 0;
  background: var(--color-brand-header);
  color: #fff;
  box-shadow: 0 -16px 42px rgba(31, 19, 9, 0.28);
  box-sizing: border-box;
  /* These values match the compact desktop action: while it shrinks, the
     same brown surface lands exactly on the reply button's footprint. */
  transform: scale(.331, .171);
  transform-origin: right bottom;
  opacity: 1;
  visibility: hidden;
  pointer-events: none;
  transition: transform 280ms cubic-bezier(.22, 1, .36, 1), visibility 0s linear 280ms;
}

body.page-forum .forum-page.is-thread-detail-open.is-reply-panel-open .forum-reply-form {
  transform: scale(1);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

body.page-forum .forum-page.is-thread-detail-open .forum-reply-form > * {
  opacity: 0;
  transition: opacity 150ms ease;
}

body.page-forum .forum-page.is-thread-detail-open.is-reply-panel-open .forum-reply-form > * {
  opacity: 1;
  transition-delay: 96ms;
}

/* Close in two deliberate phases.  First the editor content dissolves while
   the brown sheet remains whole; only then is that same sheet allowed to
   contract back into the compact action. */
body.page-forum .forum-page.is-thread-detail-open.is-reply-panel-closing .forum-reply-form {
  pointer-events: none;
}

body.page-forum .forum-page.is-thread-detail-open.is-reply-panel-closing .forum-reply-form > * {
  opacity: 0;
  transition-delay: 0s;
}

body.page-forum .forum-page.is-thread-detail-open .forum-reply-form :is(.forum-reply-composer-title, .forum-reply-composer-lead, .forum-form-feedback) { color: #fff; }
body.page-forum .forum-page.is-thread-detail-open .forum-reply-form textarea {
  border-color: color-mix(in srgb, #fff 36%, transparent);
  background: rgba(255, 255, 255, .96);
  color: #21170f;
}
body.page-forum .forum-page.is-thread-detail-open .forum-reply-form .forum-question-file-trigger {
  border-color: color-mix(in srgb, #fff 46%, transparent) !important;
  color: #fff;
}
body.page-forum .forum-page.is-thread-detail-open .forum-reply-form .forum-question-file-name,
body.page-forum .forum-page.is-thread-detail-open .forum-reply-form .forum-reply-composer-close { color: #fff; }
body.page-forum .forum-page.is-reply-panel-open .forum-thread-context-reply-bar {
  opacity: 0;
  pointer-events: none;
}

body.page-forum .forum-thread-context-reply-bar {
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease, opacity 150ms ease;
}

body.page-forum .forum-thread-context-reply-label {
  display: inline-block;
  opacity: 1;
  transition: opacity 130ms ease;
}

/* In the last leg the compact action is already underneath the shrinking
   sheet. Only its label fades in, so no second brown surface can flash. */
body.page-forum .forum-page.is-reply-panel-closing.is-reply-panel-open .forum-thread-context-reply-bar,
body.page-forum .forum-page.is-reply-panel-closing.is-reply-panel-open .forum-thread-context-reply-label {
  opacity: 0;
}

body.page-forum .forum-page.is-reply-panel-closing:not(.is-reply-panel-open) .forum-thread-context-reply-bar {
  opacity: 1;
  pointer-events: none;
}

body.page-forum .forum-page.is-reply-panel-closing:not(.is-reply-panel-open) .forum-thread-context-reply-label {
  opacity: 1;
  transition-delay: 130ms;
}

@media (min-width: 721px) {
  body.page-forum .forum-page.is-thread-detail-open .forum-reply-form {
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  body.page-forum .forum-thread-context-reply-bar {
    right: max(22px, env(safe-area-inset-right));
    left: auto;
    width: auto;
    min-width: 196px;
  }
}

@media (max-width: 720px) {
  body.page-forum .forum-thread-context-reply-bar {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: calc(52px + env(safe-area-inset-bottom));
    padding: 0 18px env(safe-area-inset-bottom);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body.page-forum .forum-page.is-thread-detail-open .forum-thread-detail-panel {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
  body.page-forum .forum-page.is-thread-detail-open .forum-reply-form {
    right: 0;
    bottom: var(--forum-keyboard-offset, 0px);
    left: 0;
    width: 100%;
    max-width: none;
    max-height: min(82dvh, 680px);
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 17px 17px 0 0;
    /* The collapsed sheet remains full width and matches the mobile bar
       height, so the handoff never exposes a separate surface. */
    transform: scaleY(.185);
    transform-origin: center bottom;
  }

  /* Esta regla llega después de la geometría compartida del panel. Reafirma
     el estado abierto en móvil para que la forma compacta solo se aplique al
     mismo componente cuando está cerrado, no durante su expansión. */
  body.page-forum .forum-page.is-thread-detail-open.is-reply-panel-open .forum-reply-form {
    transform: scale(1) !important;
  }
}

/* The guide drawer owns its viewport on phones: its heading and X cannot
   * leave the visible area, while long guide content scrolls beneath it. */
@media (max-width: 980px) {
  body.page-forum .forum-sidebar,
  body.page-forum .forum-workspace.is-sidebar-mobile-open .forum-sidebar,
  body.page-forum .forum-workspace.is-sidebar-collapsed .forum-sidebar {
    top: var(--editorial-header-height, 64px);
    bottom: auto;
    width: min(100%, 430px);
    height: calc(100dvh - var(--editorial-header-height, 64px));
    max-height: calc(100dvh - var(--editorial-header-height, 64px));
    padding: 18px 20px max(20px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
  }
  body.page-forum .forum-sidebar-head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 42px;
    margin: 0 -2px 12px;
    padding: 0 2px 10px;
    background: var(--theme-surface-bg);
  }
  body.page-forum .forum-sidebar-close { flex: 0 0 34px; }
}

@media (prefers-reduced-motion: reduce) {
  body.page-forum .forum-page.is-thread-detail-open .forum-reply-form { transition: none; }
}
