/* ==========================================================================
   Forum view (category.php) — Invision Community style
   ========================================================================== */
.fvHeader,
.fvBox {
  background: var(--i-box, #262a56);
  border: 1px solid var(--i-border, #424a8a);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  margin-bottom: 16px;
}

/* ---- Header ---- */
.fvHeader { position: relative; overflow: hidden; }
.fvHeader::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--fv-accent), #fbbf24 60%, transparent);
}
.fvHeader__banner { height: 140px; background-size: cover; background-position: center; border-bottom: 1px solid var(--i-border); }
.fvHeader__body {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 22px 24px;
  background: radial-gradient(120% 140% at 0% 0%, var(--fv-accent-soft), transparent 55%);
}
.fvHeader__icon {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  background: var(--fv-accent-soft); border: 1px solid color-mix(in srgb, var(--fv-accent) 40%, transparent);
  color: var(--fv-accent); font-size: 26px; overflow: hidden;
}
.fvHeader__icon img, .fvHeader__icon svg { width: 36px; height: 36px; object-fit: contain; }
.fvHeader__title {
  margin: 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; font-weight: 700; color: var(--text);
  font-family: var(--font-reading, Georgia, serif); letter-spacing: -0.01em;
}
.fvHeader__desc { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 72ch; }
.fvHeader__stats { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.fvHeader__stats strong { color: var(--text); font-weight: 700; }
.fvHeader__flag { color: #fcd34d; font-weight: 600; }
.fvHeader__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.fvHeader__actions .btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.follow-btn.is-following { border-color: #fcd34d; color: #fcd34d; }

.fvRules { border-top: 1px solid var(--i-border-soft, #343a72); }
.fvRules summary {
  list-style: none; cursor: pointer; padding: 12px 24px; font-size: 13px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.fvRules summary::-webkit-details-marker { display: none; }
.fvRules summary .fa-scroll { color: #fcd34d; }
.fvRules__caret { margin-left: auto; font-size: 11px; opacity: 0.7; transition: transform 0.2s; }
.fvRules[open] .fvRules__caret { transform: rotate(180deg); }
.fvRules__body { padding: 0 24px 16px; color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ---- Generic box title ---- */
.fvBox__title {
  margin: 0; padding: 12px 18px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); background: var(--i-box-head, #33307a); border-bottom: 1px solid var(--i-border);
  border-radius: 14px 14px 0 0;
}

/* ---- Subforums ---- */
.fvSubforums__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1px; background: var(--i-border-soft); border-radius: 0 0 14px 14px; overflow: hidden; }
.fvSubforum { background: var(--i-box); }
.fvSubforum__link { display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: var(--text); text-decoration: none; transition: background 0.15s; }
.fvSubforum__link:hover { background: var(--i-row-hover, #2e3368); }
.fvSubforum__icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: rgba(139, 92, 246, 0.16); color: #c4b5fd; font-size: 16px; overflow: hidden; }
.fvSubforum__icon img, .fvSubforum__icon svg { width: 24px; height: 24px; object-fit: contain; }
.fvSubforum__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fvSubforum__name { font-weight: 700; font-size: 14px; }
.fvSubforum__desc { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fvSubforum__count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fvSubforum__count strong { color: var(--text); }
.fvSubforum.is-locked { opacity: 0.6; }
.fvSubforum.is-locked .fvSubforum__link { cursor: default; }
.fvSubforum__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px 68px; }
.fvSubforum__chips a { font-size: 12px; color: var(--muted); padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--i-border-soft); }
.fvSubforum__chips a:hover { color: #fcd34d; }

/* ---- Toolbar ---- */
.fvBar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--i-box-head, #33307a); border-bottom: 1px solid var(--i-border);
  border-radius: 14px 14px 0 0;
}
.fvBar--bottom { border-bottom: 0; border-top: 1px solid var(--i-border); border-radius: 0 0 14px 14px; justify-content: flex-end; }
.fvBar__filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fvBar__pages .coven-pagination { margin: 0; }
.fvSelect {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--i-border); font-size: 12.5px; cursor: pointer;
}
.fvSelect:focus-within { border-color: #fcd34d; }
.fvSelect__label { color: var(--muted); font-weight: 600; }
.fvSelect select {
  appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: var(--text);
  font: inherit; font-weight: 700; padding: 0 22px 0 2px; height: 100%; cursor: pointer; outline: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 10px top 50%, right 6px top 50%; background-size: 4px 4px; background-repeat: no-repeat;
}
.fvSelect select option { background: #262a56; color: var(--text); }

/* ---- Moderation bar ---- */
.fvModBar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; background: rgba(251, 191, 36, 0.07); border-bottom: 1px solid var(--i-border-soft); font-size: 13px;
}
.fvModBar__form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.fvModBar select {
  height: 30px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--i-border); color: var(--text); font: inherit; font-size: 12.5px;
}
.fvCheck { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; cursor: pointer; }
.fvCheck input, .fvRow__mod input { width: 16px; height: 16px; accent-color: #8b5cf6; cursor: pointer; }

/* ---- Topic rows ---- */
.fvList { list-style: none; margin: 0; padding: 0; }
.fvGroup { border-bottom: 1px solid var(--i-border-soft); background: rgba(255, 255, 255, 0.025); }
.fvGroup__btn {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 18px; background: none; border: 0;
  color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; cursor: pointer;
}
.fvGroup__btn:hover { color: var(--text); }
.fvGroup__btn .fa-thumbtack { color: #fcd34d; }
.fvGroup__caret { margin-left: auto; transition: transform 0.2s; }
.fvGroup__btn.collapsed .fvGroup__caret { transform: rotate(-90deg); }

.fvRow {
  position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 110px 190px auto;
  align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--i-border-soft);
  transition: background 0.15s;
}
.fvRow:last-child { border-bottom: 0; }
.fvRow:hover { background: var(--i-row-hover, #2e3368); }
.fvRow.is-pinned { background: linear-gradient(90deg, rgba(251, 191, 36, 0.06), transparent 40%); }
.fvRow.is-pinned:hover { background: var(--i-row-hover); }
.fvRow.is-hidden { opacity: 0.65; background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(239, 68, 68, 0.05) 10px 20px); }
.fvRow.is-selected { background: rgba(139, 92, 246, 0.16); }
.fvRow[hidden] { display: none; }
.fvRow__panel { position: absolute; inset: 0; z-index: 0; }
.fvRow > *:not(.fvRow__panel) { position: relative; z-index: 1; }

.fvRow__avatar { position: relative; width: 42px; height: 42px; }
.fvRow__avatar img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: block; background: var(--i-box-alt); }
.fvRow__dot { position: absolute; top: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; background: #fbbf24; border: 2px solid var(--i-box); }

.fvRow__main { min-width: 0; }
.fvRow__title { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fvRow__title > a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.fvRow__title > a:hover { color: var(--i-link, #a5b8ff); text-decoration: underline; text-underline-offset: 3px; }
.fvRow.is-unread .fvRow__title > a { font-weight: 800; }
.fvRow:not(.is-unread) .fvRow__title > a { font-weight: 600; }
.fvBadge { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 10px; flex-shrink: 0; }
.fvBadge--pinned { background: rgba(251, 191, 36, 0.18); color: #fcd34d; }
.fvBadge--locked { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
.fvBadge--hidden { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.fvBadge--featured { background: rgba(139, 92, 246, 0.22); color: #c4b5fd; }
.fvNew {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px;
  background: #fbbf24; color: #1d1a4b; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
}
.fvRow__meta { margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12.5px; color: var(--muted); }
.fvRow__author { color: var(--text); font-weight: 600; }
.fvRow__author:hover { color: #fcd34d; }
.fvDot { opacity: 0.5; }
.fvPages { display: inline-flex; gap: 3px; margin-left: 4px; }
.fvPages a, .fvPages span {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--i-border-soft);
}
.fvPages a:hover { color: var(--text); border-color: var(--i-border); }
.fvPages span { border: 0; }
.fvRow__mstats { display: none; }
.fvRow__mstats i { margin-left: 4px; font-size: 11px; }

.fvRow__stats { text-align: right; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.fvRow__stats strong { color: var(--text); font-weight: 700; }

.fvRow__last { display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: 16px; border-left: 1px solid var(--i-border-soft); }
.fvRow__lastAv img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: block; }
.fvRow__lastText { min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; line-height: 1.4; }
.fvRow__lastName { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fvRow__lastName:hover { color: #fcd34d; }
.fvRow__lastTime { color: var(--muted); }
.fvRow__lastTime:hover { color: var(--text); }
.fvRow__lastText--none { color: var(--muted); font-style: italic; opacity: 0.75; }

.fvRow__mod { display: flex; align-items: center; padding-left: 4px; }

/* ---- Empty state ---- */
.fvEmpty { text-align: center; padding: 48px 20px; color: var(--muted); }
.fvEmpty__icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: rgba(139, 92, 246, 0.14); color: #c4b5fd; }
.fvEmpty p { margin: 0 0 16px; font-size: 15px; }

/* ---- Floating "new topic" (phones) ---- */
.fvFab { display: none; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .fvRow { grid-template-columns: 42px minmax(0, 1fr) 170px auto; }
  .fvRow__stats { display: none; }
  .fvRow__mstats { display: inline-flex; align-items: center; gap: 4px; }
}
@media (max-width: 720px) {
  .fvHeader__body { grid-template-columns: auto minmax(0, 1fr); padding: 18px 16px; gap: 14px; }
  .fvHeader__icon { width: 48px; height: 48px; border-radius: 13px; font-size: 21px; }
  .fvHeader__actions { grid-column: 1 / -1; justify-content: stretch; }
  .fvHeader__actions .btn { flex: 1; justify-content: center; }
  .fvRules summary { padding: 12px 16px; }
  .fvRules__body { padding: 0 16px 14px; }

  .fvBar { padding: 10px 12px; }
  .fvBar__filters { width: 100%; }
  .fvSelect { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .fvSelect select { flex: 1; min-width: 0; }
  .fvBar .mark-read { flex: 1 1 100%; justify-content: center; }
  .fvBar__pages { width: 100%; display: flex; justify-content: center; }

  .fvRow { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; padding: 13px 14px; align-items: start; }
  .fvRow__avatar, .fvRow__avatar img { width: 38px; height: 38px; }
  .fvRow__title { font-size: 14.5px; }
  .fvRow__last {
    grid-column: 2 / -1; grid-row: 2; padding: 6px 10px; border: 1px solid var(--i-border-soft); border-radius: 10px;
    background: rgba(255, 255, 255, 0.03); margin-top: -4px;
  }
  .fvRow__lastAv img { width: 22px; height: 22px; }
  .fvRow__lastText { flex-direction: row; gap: 6px; font-size: 12px; min-width: 0; }
  .fvRow__lastTime { white-space: nowrap; }
  .fvRow__lastText--none { font-size: 12px; }
  .fvRow__mod { grid-column: 3; grid-row: 1; }
  .fvPages { display: none; }
  .fvRow__mstats .fvDot { display: none; }
  .fvRow__mstats { width: 100%; margin-top: 1px; }
  .fvRow__last--none { display: none; }
  .fvSubforums__grid { grid-template-columns: 1fr; }
  .fvSubforum__chips { padding-left: 18px; }

  .fvFab {
    display: grid; place-items: center; position: fixed; left: auto !important; right: 16px; top: auto; bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    width: 52px; height: 52px; padding: 0 !important; border-radius: 50% !important; font-size: 18px; z-index: 40;
    box-shadow: 0 10px 28px rgba(91, 43, 181, 0.55);
  }
}
@media (prefers-reduced-motion: reduce) {
  .fvRow, .fvRules__caret, .fvGroup__caret { transition: none; }
}
