/* ── Forum Design Tokens ───────────────────────────────────────────── */
.forum-body {
  --gold:  #d4a85a;
  --gold2: #e8c07a;
  --fire:  #c4622a;
  --fi:    #ede0c8;
  --fi-soft: #c4aa80;
  --fm:    #8a7055;
  --fp:    #1e1810;
  --fs:    #1a1510;
  --fs-hover: #221a10;
  --fl:    rgba(212,168,90,.12);
  --fl-strong: rgba(212,168,90,.22);
  --fa:    #d4a85a;
  --fa-h:  #e8c07a;
  --fa-light:  rgba(212,168,90,.10);
  --fa-border: rgba(212,168,90,.32);
  --fg:    #5a9870;
  --fg-light: rgba(90,152,112,.12);
  --flike: #e05060;
  --flike-light: rgba(224,80,96,.12);
  --fsh:    0 2px 14px rgba(0,0,0,.28);
  --fsh-md: 0 8px 32px rgba(0,0,0,.38);
  --fsh-lg: 0 20px 60px rgba(0,0,0,.50);
  --frad:    22px;
  --frad-sm: 14px;
  --ftrans:  160ms ease;
  background: #0f0c08;
  color: var(--fi);
}

.forum-body.modal-open { overflow: hidden; }

.forum-body .site-wrap {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 88% 0%,   rgba(212,168,90,.18) 0%, transparent 36%),
    radial-gradient(ellipse at 5%  28%,  rgba(196,98,42,.13)  0%, transparent 28%),
    radial-gradient(ellipse at 50% 72%,  rgba(100,55,12,.22)  0%, transparent 38%),
    linear-gradient(160deg, #171209 0%, #120e07 45%, #0c0905 100%);
}

.forum-body h1, .forum-body h2, .forum-body h3,
.forum-body h4 { color: var(--fi); }
.forum-body strong { color: var(--fi); }
.forum-body p { color: var(--fi-soft); }
.forum-body .section-eyebrow { color: var(--gold); }

/* ── Utility ────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Buttons override ────────────────────────────────────────────────── */
.forum-body .btn-glass {
  background: rgba(255,255,255,.07);
  color: var(--fi);
  border-color: var(--fl-strong);
}
.forum-body .btn-glass:hover { background: rgba(255,255,255,.12); }
.forum-body .btn-outline { color: var(--gold); border-color: var(--fa-border); }
.forum-body .btn-outline:hover { background: var(--gold); color: #1a0e05; border-color: var(--gold); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.forum-hero {
  position: relative;
  padding: 70px 0 36px;
}

.forum-hero-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 20px;
  align-items: stretch;
}

.forum-hero-copy, .forum-hero-aside, .forum-panel, .forum-note-card {
  background: rgba(28,20,12,.75);
  border: 1px solid var(--fl);
  border-radius: var(--frad);
  box-shadow: var(--fsh-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.forum-hero-copy,
.forum-hero-aside {
  position: relative;
  overflow: hidden;
}

.forum-hero-copy::before,
.forum-hero-aside::before,
.forum-note-card::before {
  content: "";
  position: absolute;
  inset: auto;
  pointer-events: none;
}

.forum-hero-copy::before {
  width: 300px; height: 300px;
  right: -90px; bottom: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,90,.14) 0%, transparent 70%);
}
.forum-hero-aside::before {
  width: 240px; height: 240px;
  right: -72px; top: -88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90,152,112,.16) 0%, transparent 74%);
}
.forum-note-card::before {
  width: 180px; height: 180px;
  right: -50px; bottom: -62px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,90,.13) 0%, transparent 76%);
}

.forum-hero-copy > *,
.forum-hero-aside > *,
.forum-note-card > * { position: relative; z-index: 1; }

.forum-hero-copy {
  padding: 36px 38px;
  background: linear-gradient(145deg, rgba(32,24,12,.88) 0%, rgba(24,18,8,.82) 100%);
}
.forum-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}
.forum-hero-copy h1 {
  font-size: clamp(2.6rem,4.5vw,4.4rem);
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--fi) 20%, var(--gold2) 65%, var(--fire) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.forum-hero-copy p { max-width: 680px; font-size: 1.02rem; }

.forum-stat-row {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
  margin-top: 28px;
}

.forum-hero-auth {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
  padding: 8px;
  border-radius: 999px;
  background: rgba(212,168,90,.07);
  border: 1px solid var(--fl);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
  backdrop-filter: blur(8px);
}
.forum-hero-auth .btn,
.forum-hero-auth .toolbar-member-chip { min-height: 40px; padding: 8px 16px; box-shadow: none; }
.forum-hero-auth .btn-fire { box-shadow: 0 10px 22px rgba(196,98,42,.22); }
.forum-hero-auth .btn-glass,
.forum-hero-auth .btn-outline,
.forum-hero-auth .toolbar-member-chip {
  background: rgba(255,255,255,.07);
}

.forum-stat-card {
  padding: 16px 18px; border-radius: 18px;
  background: linear-gradient(145deg, rgba(36,26,14,.90) 0%, rgba(26,18,8,.85) 100%);
  border: 1px solid var(--fl);
  box-shadow: var(--fsh);
}
.forum-stat-card strong {
  display: block; font-family: var(--serif); font-size: 1.9rem;
  color: var(--gold); line-height: 1; margin-bottom: 6px;
}
.forum-stat-card span {
  display: block; color: var(--fm); font-size: .74rem;
  letter-spacing: .08em; text-transform: uppercase;
}

/* ── Hero aside / auth shell ──────────────────────────────────────────── */
.forum-hero-aside {
  padding: 28px;
  background: linear-gradient(150deg, rgba(30,22,12,.90) 0%, rgba(22,16,8,.88) 100%);
}
.forum-hero-aside h2 { font-size: 1.75rem; margin-bottom: 10px; }

.account-shell { display: grid; gap: 16px; margin-top: 20px; }
.account-shell-head strong { display: block; font-size: 1.05rem; margin-bottom: 6px; }
.account-shell-head p { font-size: .92rem; }

.auth-shell-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.auth-shell-card {
  min-height: 104px; padding: 14px; border-radius: 18px;
  border: 1px solid var(--fl);
  background: rgba(255,255,255,.04);
}
.auth-shell-card strong { display: block; font-size: .9rem; margin-bottom: 6px; }
.auth-shell-card span { display: block; color: var(--fm); font-size: .78rem; line-height: 1.55; }

/* Profile card */
.profile-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: 18px;
  background: linear-gradient(145deg, rgba(36,26,14,.90) 0%, rgba(26,18,8,.85) 100%);
  border: 1px solid var(--fl);
  box-shadow: var(--fsh);
}
.profile-card-avatar { position: relative; flex: 0 0 auto; cursor: pointer; }
.profile-card-avatar .avatar { width: 52px; height: 52px; border-radius: 16px; }
.avatar-upload-btn {
  position: absolute; inset: 0; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.52); opacity: 0;
  transition: opacity var(--ftrans); cursor: pointer;
  border: none; color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.2;
}
.profile-card-avatar:hover .avatar-upload-btn { opacity: 1; }
.profile-card-info strong { display: block; font-size: 1rem; }
.profile-card-info span { display: block; margin-top: 3px; color: var(--fm); font-size: .8rem; }

.auth-shell-meta { display: flex; align-items: center; gap: 12px; }
.auth-shell-copy strong { display: block; font-size: .98rem; }
.auth-shell-copy span { display: block; margin-top: 3px; color: var(--fm); font-size: .82rem; }

.account-shell-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.account-shell-foot span, .toolbar-member-chip {
  display: inline-flex; align-items: center; min-height: 34px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(212,168,90,.07); border: 1px solid var(--fl);
  color: var(--fm); font-size: .78rem; font-weight: 600;
}
.auth-shell-actions, .reply-actions, .forum-toolbar-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* ── Main forum area ──────────────────────────────────────────────────── */
.forum-main { padding: 0 0 60px; }

.forum-toolbar {
  display: grid; gap: 16px; margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--fl);
  border-radius: 24px;
  background: rgba(26,18,10,.80);
  box-shadow: var(--fsh);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.forum-toolbar-main {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
}
.forum-toolbar-copy h2 { font-size: 1.9rem; }
.forum-toolbar-copy p { margin-top: 7px; max-width: 620px; font-size: .92rem; }
.forum-toolbar-right {
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px;
}
.forum-toolbar-filters {
  padding-top: 16px;
  border-top: 1px solid rgba(212,168,90,.08);
}

.forum-search { min-width: min(100%,340px); }
.forum-search input {
  width: 100%; min-height: 46px;
  padding: 12px 16px 12px 42px;
  border: 1.5px solid var(--fl-strong); border-radius: var(--frad-sm);
  background: rgba(255,255,255,.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a7055' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 13px center / 16px no-repeat;
  color: var(--fi); font: inherit; outline: none;
  transition: border-color var(--ftrans), box-shadow var(--ftrans), background var(--ftrans);
}
.forum-search input:focus {
  border-color: var(--fa-border);
  background-color: rgba(255,255,255,.08);
  box-shadow: 0 0 0 3px var(--fa-light);
}
.forum-search input::placeholder { color: var(--fm); }

/* ── Category chips ──────────────────────────────────────────────────── */
.forum-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.forum-chip {
  border: 1px solid var(--fl-strong);
  padding: 8px 15px; border-radius: 999px;
  background: rgba(212,168,90,.06);
  color: var(--fi-soft);
  font-size: .82rem; font-weight: 700;
  box-shadow: var(--fsh);
  transition: var(--ftrans);
}
.forum-chip:hover {
  background: rgba(212,168,90,.12);
  border-color: var(--fa-border);
  color: var(--gold);
  transform: translateY(-1px);
}
.forum-chip.active {
  background: linear-gradient(135deg, var(--fire), #8a3010);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 20px rgba(196,98,42,.30);
}

/* ── Forum grid ──────────────────────────────────────────────────────── */
.forum-grid { display: block; }
.forum-panel { overflow: hidden; }
.forum-panel {
  background: rgba(24,18,10,.78);
}
.topic-panel { position: static; max-height: none; overflow: visible; }

.forum-panel-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; padding: 20px 20px 0;
}
.forum-panel-head h3 { font-family: var(--sans); font-size: 1.12rem; }

.topic-list-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; padding: 14px 20px 0;
}
.topic-page-size {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px;
  padding: 6px 8px 6px 14px; border-radius: 999px;
  border: 1px solid var(--fl);
  background: rgba(212,168,90,.06);
  color: var(--fm); font-size: .8rem; font-weight: 700;
}
.topic-page-size select {
  min-width: 72px; min-height: 30px; padding: 5px 28px 5px 12px;
  border: 1px solid var(--fl); border-radius: 999px;
  background: rgba(24,18,10,.90)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238a7055' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") calc(100% - 10px) center / 12px no-repeat;
  color: var(--fi); font: inherit; font-weight: 700;
  appearance: none; outline: none; cursor: pointer;
}
.topic-page-size select:focus { border-color: var(--fa-border); box-shadow: 0 0 0 3px var(--fa-light); }

.topic-page-meta {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; flex-wrap: wrap; margin-left: auto;
}
.topic-page-summary { color: var(--fm); font-size: .78rem; font-weight: 700; }
.topic-pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topic-page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--fl);
  background: rgba(212,168,90,.06);
  color: var(--fi-soft); font-size: .8rem; font-weight: 700;
  box-shadow: var(--fsh); transition: var(--ftrans);
}
.topic-page-btn:hover:not(:disabled) {
  border-color: var(--fa-border); color: var(--gold); transform: translateY(-1px);
}
.topic-page-btn.active {
  background: linear-gradient(135deg, var(--fire), #8a3010);
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 24px rgba(196,98,42,.28);
}
.topic-page-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.topic-page-nav { min-width: 58px; }
.topic-page-gap { color: var(--fm); font-size: .95rem; font-weight: 700; }

/* Pills & badges */
.forum-pill, .topic-category, .topic-kind, .thread-category, .thread-kind,
.comment-role, .thread-tag, .tag-cloud span {
  display: inline-flex; align-items: center; border-radius: 999px;
  font-size: .71rem; font-weight: 700; letter-spacing: .06em;
}
.forum-pill {
  padding: 7px 12px;
  background: rgba(212,168,90,.08); border: 1px solid var(--fl); color: var(--gold);
}
.topic-category, .thread-category {
  padding: 5px 10px; color: #6aba88;
  background: rgba(90,152,112,.12); border: 1px solid rgba(90,152,112,.25);
}
.topic-kind, .thread-kind {
  padding: 5px 10px; color: var(--gold);
  background: var(--fa-light); border: 1px solid var(--fa-border);
}

/* ── Topic list & cards ────────────────────────────────────────────── */
.topic-list { display: grid; gap: 12px; padding: 14px 14px 18px; }

/* inactive row = just the card */
.topic-row { display: grid; gap: 0; }

/* active row becomes the unified outer box */
.topic-row.active {
  border: 1px solid var(--fa-border);
  border-left: 3px solid var(--gold);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(212,168,90,.16), 0 2px 8px rgba(0,0,0,.40);
  background: linear-gradient(160deg, rgba(32,22,10,.96) 0%, rgba(20,14,6,.94) 100%);
}

.topic-card {
  position: relative; overflow: hidden;
  width: 100%; display: grid; gap: 10px; text-align: left;
  padding: 15px 16px 15px 20px;
  border-radius: 18px; border: 1px solid var(--fl);
  border-left: 3px solid transparent;
  background: linear-gradient(145deg, rgba(30,22,12,.85) 0%, rgba(22,16,8,.80) 100%);
  color: inherit; box-shadow: var(--fsh);
  transition: transform var(--ftrans), border-color var(--ftrans),
              box-shadow var(--ftrans), background var(--ftrans);
}
.topic-card::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(180deg, var(--gold), rgba(196,98,42,.55));
  transition: width var(--ftrans);
}
.topic-card:hover {
  transform: translateY(-1px);
  border-color: var(--fa-border);
  border-left-color: var(--gold);
  box-shadow: var(--fsh-md);
  background: linear-gradient(145deg, rgba(36,26,14,.90) 0%, rgba(26,18,8,.85) 100%);
}
.topic-card:hover::after, .topic-card.active::after { width: 4px; }

/* when card is inside the active row, merge it into the box */
.topic-row.active .topic-card.active {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(212,168,90,.18);
  box-shadow: none;
  background: rgba(212,168,90,.04);
  transform: none;
}
.topic-row.active .topic-card.active::after { display: none; }

.topic-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.topic-card-head-right { display: flex; align-items: center; gap: 10px; }
.topic-pill-row, .thread-badge-row, .thread-tags, .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-date { color: var(--fm); font-size: .76rem; white-space: nowrap; }
.topic-expand-indicator {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 999px;
  border: 1px solid var(--fl);
  background: rgba(212,168,90,.07);
  color: var(--gold); font-size: 1.2rem; line-height: 1;
}
.topic-card h4 { font-size: 1rem; line-height: 1.45; color: var(--fi); }
.topic-card-excerpt {
  font-size: .87rem; line-height: 1.6; color: var(--fi-soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.topic-meta-row {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 10px;
}
.topic-card-author { display: flex; align-items: center; gap: 10px; }
.topic-card-author strong { display: block; font-size: .88rem; }
.topic-card-author span { display: block; margin-top: 2px; color: var(--fm); font-size: .74rem; }

.topic-metrics, .thread-metrics { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.topic-metrics span, .thread-metric {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 30px; padding: 4px 10px; border-radius: 999px;
  background: rgba(212,168,90,.06); border: 1px solid var(--fl);
  color: var(--fm); font-size: .73rem; font-weight: 600;
}

/* ── Inline thread panel ─────────────────────────────────────────────── */
.topic-inline-thread {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: transparent;
  border: none;
}

/* thread header — author + metrics bar */
.topic-inline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 12px 20px;
  background: rgba(255,255,255,.025);
  border-bottom: 1px solid rgba(212,168,90,.12);
}

/* ── Thread panel ────────────────────────────────────────────────────── */
.thread-empty, .comment-empty {
  padding: 32px; border-radius: var(--frad);
  background: rgba(26,18,10,.80); border: 1px solid var(--fl); text-align: center;
}
.thread-empty h3, .comment-empty h3 { font-family: var(--sans); font-size: 1.06rem; margin-bottom: 8px; }

.thread-hero-card, .starter-card, .reply-composer,
.thread-auth-prompt, .comment-card {
  background: rgba(26,18,10,.80); border: 1px solid var(--fl); box-shadow: var(--fsh);
}
.thread-hero-card, .starter-card, .reply-composer, .thread-auth-prompt {
  padding: 22px; border-radius: var(--frad);
}
.thread-hero-card {
  margin-bottom: 16px;
  background: linear-gradient(145deg, rgba(34,24,12,.90) 0%, rgba(24,16,8,.85) 100%);
}
.thread-hero-card h2 { margin: 12px 0 16px; font-size: 1.8rem; }

.thread-author-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.thread-author { display: flex; align-items: center; gap: 12px; }

/* ── Avatars ─────────────────────────────────────────────────────────── */
.avatar {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; overflow: hidden;
  color: #fff; font-size: .88rem; font-weight: 700; letter-spacing: .04em;
  box-shadow: 0 4px 12px rgba(0,0,0,.28); flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.avatar-fire { background: linear-gradient(135deg, #d96e3a, #9e431d); }
.avatar-gold { background: linear-gradient(135deg, #d7b067, #8e672c); }
.avatar-sage { background: linear-gradient(135deg, #669b76, #3e5d47); }
.avatar-plum { background: linear-gradient(135deg, #8b6aa6, #5d4775); }
.avatar-blue { background: linear-gradient(135deg, #5588cc, #2d4f9a); }

.author-meta strong { display: block; font-size: .95rem; }
.author-meta span { display: block; margin-top: 3px; color: var(--fm); font-size: .8rem; }

/* ── Original post (OP) ──────────────────────────────────────────────── */
.starter-card {
  margin: 0;
  border-radius: 0;
  border: none;
  border-bottom: 2px solid rgba(212,168,90,.18);
  background: linear-gradient(160deg, rgba(212,168,90,.07) 0%, rgba(196,98,42,.04) 100%);
  box-shadow: none;
  padding: 22px 20px 18px;
}
.starter-card strong {
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 12px; color: var(--gold);
  font-size: .70rem; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(212,168,90,.12);
  border: 1px solid rgba(212,168,90,.22);
  padding: 4px 10px; border-radius: 999px;
}
.starter-card p { font-size: .97rem; line-height: 1.80; white-space: pre-wrap; color: var(--fi); }

.thread-conversation { display: contents; }
.thread-conversation::before { display: none; }

.thread-parent-card, .thread-replies, .thread-auth-prompt, .reply-composer {
  position: static; margin-left: 0;
}
.thread-parent-card { margin-bottom: 0; }
.thread-parent-card::before, .thread-replies::before,
.thread-auth-prompt::before, .reply-composer::before { display: none; }

.thread-tag, .tag-cloud span {
  padding: 7px 11px;
  background: rgba(212,168,90,.07); border: 1px solid var(--fl); color: var(--fi-soft);
}

/* ── Engagement bar ──────────────────────────────────────────────────── */
.engage-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--fl);
}
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid var(--fl-strong);
  background: transparent; color: var(--fm);
  font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: all var(--ftrans);
}
.like-btn:hover { border-color: var(--flike); color: var(--flike); }
.like-btn.liked { border-color: var(--flike); background: var(--flike-light); color: var(--flike); }
.like-btn svg { width: 15px; height: 15px; flex: 0 0 auto; transition: transform .2s ease, fill .2s ease; }
.like-btn.liked svg { fill: var(--flike); transform: scale(1.18); }

.reaction-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.reaction-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 999px;
  border: 1.5px solid var(--fl-strong);
  background: rgba(255,255,255,.04); font-size: .84rem;
  cursor: pointer; transition: all var(--ftrans); user-select: none;
}
.reaction-pill:hover { border-color: var(--fa-border); background: var(--fa-light); }
.reaction-pill.reacted { border-color: var(--gold); background: var(--fa-light); font-weight: 700; }
.reaction-pill .r-count { font-size: .74rem; font-weight: 600; color: var(--fm); min-width: 12px; }
.reaction-pill.reacted .r-count { color: var(--gold); }

/* ── Comments ─────────────────────────────────────────────────────────── */
.reply-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; margin-bottom: 12px;
}
.reply-head h3 { font-family: var(--sans); font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fm); }
.reply-head span { color: var(--fm); font-size: .78rem; }

.thread-replies { padding: 0; }
.thread-replies .reply-head {
  padding: 10px 20px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--fl);
  background: rgba(255,255,255,.025);
}

/* Chat-stream comment list */
.comment-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,168,90,.20) transparent;
}
.comment-stack::-webkit-scrollbar { width: 5px; }
.comment-stack::-webkit-scrollbar-track { background: transparent; }
.comment-stack::-webkit-scrollbar-thumb { background: rgba(212,168,90,.18); border-radius: 99px; }

.comment-card {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(212,168,90,.06);
  transition: background var(--ftrans);
  border-radius: 0;
  box-shadow: none;
}
.comment-card:last-child { border-bottom: none; }
.comment-card:hover { background: rgba(255,255,255,.025); }
.comment-card::before { display: none; }

/* Avatar sits on the left, content fills right */
.comment-inner {
  display: contents;
}
.comment-card > .avatar {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  border-radius: 10px;
  align-self: flex-start;
  margin-top: 2px;
}
.comment-card > div:last-child {
  flex: 1;
  min-width: 0;
}
.comment-inner { display: grid; grid-template-columns: auto 1fr; gap: 13px; }
.comment-top {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: 6px; flex-wrap: wrap;
}
.comment-top strong { font-size: .90rem; color: var(--fi); white-space: nowrap; }
.comment-top > span:not(.comment-role) { color: var(--fm); font-size: .74rem; }
.comment-role {
  padding: 5px 9px; color: var(--gold);
  background: var(--fa-light); border: 1px solid var(--fa-border);
  text-transform: uppercase;
}
.comment-body { font-size: .93rem; line-height: 1.78; white-space: pre-wrap; }

.comment-quote {
  margin-bottom: 10px; padding: 10px 14px;
  border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0;
  background: var(--fa-light); font-size: .84rem; color: var(--fi-soft);
}
.comment-quote strong { font-size: .74rem; color: var(--gold); display: block; margin-bottom: 4px; }

.comment-image {
  margin-top: 12px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--fl); max-width: 420px;
}
.comment-image img { display: block; width: 100%; height: auto; cursor: zoom-in; transition: transform .2s ease; }
.comment-image img:hover { transform: scale(1.015); }

.comment-reply-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px; border: 1.5px solid var(--fl);
  background: transparent; color: var(--fm); font-size: .77rem; font-weight: 600;
  cursor: pointer; transition: all var(--ftrans);
}
.comment-reply-btn:hover { border-color: var(--fa-border); color: var(--gold); }

/* ── Reply composer ───────────────────────────────────────────────────── */
.thread-auth-prompt, .reply-composer {
  margin-top: 0;
  border-top: 1px solid var(--fl-strong);
  border-radius: 0;
  background: rgba(18,13,7,.85);
  padding: 16px 20px;
  box-shadow: none;
  border-left: none; border-right: none; border-bottom: none;
}
.thread-auth-prompt h3, .reply-composer h3 { font-family: var(--sans); font-size: 1rem; margin-bottom: 10px; }
.reply-composer-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.reply-quote-preview {
  padding: 10px 14px; border-radius: 12px; margin-bottom: 14px;
  background: var(--fa-light); border-left: 3px solid var(--gold);
  font-size: .84rem; color: var(--fi-soft);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.reply-quote-preview .clear-quote {
  background: none; border: none; color: var(--fm); cursor: pointer;
  font-size: .9rem; padding: 0; line-height: 1; flex: 0 0 auto;
}
.reply-quote-preview .clear-quote:hover { color: var(--fi); }

.composer-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--fl);
}
.composer-attach-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--fl-strong);
  background: rgba(255,255,255,.04); color: var(--fm); font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: all var(--ftrans);
}
.composer-attach-btn:hover { border-color: var(--fa-border); color: var(--gold); }

.attachment-preview { margin-top: 12px; position: relative; display: inline-block; }
.attachment-preview img { height: 100px; border-radius: 10px; border: 1px solid var(--fl); display: block; object-fit: cover; }
.attachment-preview .remove-attachment {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 999px;
  background: #e04050; color: #fff; border: none; font-size: .75rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ── Forms ────────────────────────────────────────────────────────────── */
.forum-form-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.auth-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.forum-form-group { margin-bottom: 14px; }
.forum-form-group label {
  display: block; margin-bottom: 7px; color: var(--fm);
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.forum-form-group:focus-within label { color: var(--gold); }

.input-wrap { position: relative; }
.input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--fm); pointer-events: none; display: flex; align-items: center;
}
.input-wrap .forum-input { padding-left: 42px; }

.forum-input {
  width: 100%; border: 1.5px solid var(--fl-strong); border-radius: var(--frad-sm);
  padding: 12px 14px;
  background: rgba(255,255,255,.06);
  color: var(--fi); font: inherit; outline: none;
  transition: border-color var(--ftrans), box-shadow var(--ftrans), background var(--ftrans);
}
.forum-input:focus {
  border-color: var(--fa-border);
  background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 3px var(--fa-light);
}
.forum-input::placeholder { color: var(--fm); }
.forum-textarea { min-height: 130px; resize: vertical; line-height: 1.7; }

.forum-input-hint { margin-top: 7px; color: var(--fm); font-size: .78rem; line-height: 1.5; }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px;
  background: rgba(255,255,255,.04); border: 1px solid transparent; color: var(--fm);
  cursor: pointer; padding: 2px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; transition: color var(--ftrans), background var(--ftrans), border-color var(--ftrans);
}
.pw-toggle:hover { color: var(--fi); background: var(--fa-light); border-color: var(--fa-border); }

.forum-error-msg {
  padding: 10px 14px; border-radius: var(--frad-sm); margin-bottom: 14px;
  background: rgba(220,60,60,.10); border: 1px solid rgba(220,60,60,.28);
  color: #e07070; font-size: .84rem; display: none;
}
.forum-error-msg.show { display: block; }

.forum-submit-btn {
  width: 100%; min-height: 50px; padding: 13px; font-size: .95rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.forum-submit-btn:disabled { cursor: wait; transform: none; box-shadow: none; filter: saturate(.9); }

/* ── Auth tabs ────────────────────────────────────────────────────────── */
.auth-tab-row { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab {
  flex: 1; border: 1.5px solid var(--fl-strong); border-radius: var(--frad-sm);
  padding: 11px 12px;
  background: rgba(255,255,255,.05);
  color: var(--fi-soft); font-size: .88rem; font-weight: 700; transition: var(--ftrans);
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--fire), #8a3010);
  border-color: transparent; color: #fff;
  box-shadow: 0 12px 28px rgba(196,98,42,.25);
}
.auth-form-intro { margin: 0 0 16px; color: var(--fi-soft); font-size: .9rem; line-height: 1.65; }
.auth-helper-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; }
.auth-helper-list span, .auth-form-footer span {
  display: inline-flex; align-items: center; min-height: 34px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(212,168,90,.07); border: 1px solid var(--fl);
  color: var(--fm); font-size: .77rem; font-weight: 700;
}
.auth-form-footer { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; }
.auth-form-hidden { display: none; }
.auth-note {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--fl);
  font-size: .82rem; color: var(--fm); text-align: center;
}
.auth-form.is-submitting .forum-submit-btn::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.30); border-top-color: #fff;
  animation: forum-spin .8s linear infinite;
}

/* ── Modals ───────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(10,6,2,.55); backdrop-filter: blur(8px);
  z-index: 2100;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 560px; border-radius: 26px;
  background: rgba(26,18,10,.96); border: 1px solid var(--fl-strong);
  box-shadow: 0 28px 80px rgba(0,0,0,.60);
  overflow: hidden; max-height: 92vh; overflow-y: auto;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--fl); font-weight: 700;
  position: sticky; top: 0; background: rgba(26,18,10,.98); z-index: 1;
}
.modal-body { padding: 22px; }
.modal-close {
  border: none; background: none; color: var(--fm);
  font-size: 1.1rem; line-height: 1; padding: 4px;
  border-radius: 8px; cursor: pointer;
}
.modal-close:hover { color: var(--fi); background: rgba(255,255,255,.07); }
.forum-dialog { max-width: 580px; }
.auth-dialog { max-width: 560px; }

.auth-modal-head { align-items: flex-start; padding: 22px 26px; }
.auth-modal-head-copy span { display: block; font-size: 1.25rem; }
#auth-modal-subtitle {
  margin: 7px 0 0; max-width: 540px; color: var(--fm); font-size: .9rem;
  font-weight: 500; line-height: 1.55;
}
.auth-modal-body {
  padding: 22px;
  background: linear-gradient(145deg, rgba(28,20,10,.96) 0%, rgba(20,14,6,.92) 100%);
}
.auth-modal-layout { display: block; }
.auth-modal-panel {
  border-radius: 24px; border: 1px solid var(--fl);
  padding: 22px;
  background: rgba(255,255,255,.03);
  box-shadow: 0 20px 48px rgba(0,0,0,.30);
}

/* ── Toast ────────────────────────────────────────────────────────────── */
.forum-toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 2300;
  max-width: 320px; padding: 13px 18px; border-radius: 14px;
  background: rgba(30,22,10,.97); border: 1px solid var(--fl);
  color: var(--fi); box-shadow: 0 16px 40px rgba(0,0,0,.40);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease; font-size: .9rem;
}
.forum-toast.show { opacity: 1; transform: none; }

/* ── Notes / tag cloud ────────────────────────────────────────────────── */
.forum-notes { padding: 0 0 80px; }
.forum-notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.forum-note-card {
  position: relative; overflow: hidden; padding: 22px;
  border-radius: var(--frad);
  background: linear-gradient(145deg, rgba(30,22,12,.85) 0%, rgba(22,16,8,.80) 100%);
}
.forum-note-card h3 { font-size: 1.18rem; margin-bottom: 10px; }
.tag-cloud { gap: 8px; }
.tag-cloud span { cursor: default; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.forum-footer {
  margin-top: 0;
  background: rgba(18,12,6,.90);
  border-top: 1px solid var(--fl);
}
.forum-footer .footer-grid { border-bottom: 1px solid var(--fl); }
.forum-footer .footer-brand p,
.forum-footer .footer-col a,
.forum-footer .footer-bottom { color: var(--fm); }
.forum-footer .footer-col h4 { color: var(--fi-soft); }
.forum-footer .social-btn { border-color: var(--fl-strong); color: var(--fm); }
.forum-footer .social-btn.yt:hover { background: var(--fire); border-color: var(--fire); color: #fff; }

/* ── Image lightbox ───────────────────────────────────────────────────── */
.img-lightbox {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,.90); align-items: center; justify-content: center;
  padding: 20px; cursor: zoom-out;
}
.img-lightbox.open { display: flex; }
.img-lightbox img {
  max-width: 100%; max-height: 90vh; border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.forum-input:-webkit-autofill,
.forum-input:-webkit-autofill:hover,
.forum-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fi);
  -webkit-box-shadow: 0 0 0 1000px #1a1408 inset;
  transition: background-color 9999s ease-in-out 0s;
}

@keyframes forum-spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .forum-hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .forum-hero { padding-top: 84px; }
  .forum-hero-copy, .forum-hero-aside, .forum-note-card { padding: 18px; }
  .forum-stat-row, .forum-notes-grid, .forum-form-row, .auth-form-grid, .auth-shell-card-grid {
    grid-template-columns: 1fr;
  }
  .forum-toolbar-main, .forum-toolbar-right, .reply-head,
  .thread-author-row, .forum-panel-head, .topic-meta-row, .comment-top {
    flex-direction: column; align-items: flex-start;
  }
  .auth-modal-body, .auth-modal-panel { padding: 18px; }
  .forum-search { min-width: 100%; }
  .topic-metrics, .thread-metrics { justify-content: flex-start; }
  .comment-inner { grid-template-columns: 1fr; }
  .forum-hero-copy h1 { font-size: 2.2rem; }
  .topic-list-toolbar, .topic-page-meta { align-items: flex-start; justify-content: flex-start; }
  .topic-page-summary { width: 100%; }
  .topic-card-head-right { width: 100%; justify-content: space-between; }
  .topic-inline-meta { margin-left: 0; }
  .forum-hero-top { flex-direction: column; align-items: flex-start; }
  .forum-hero-auth { justify-content: flex-start; margin-left: 0; }
  .topic-inline-thread { border-radius: 14px; }
}
