/* ==========================================================================
   Coven+ forum — "Channels" design (forum index, forum view, topic view).
   Active when <html class="cv-ch"> (AdminCP → Site settings → Forum design).
   Every rule is scoped to html.cv-ch so it wins over ips-theme.css and the
   page <style> blocks, and the classic design is untouched when it is off.
   Dark and light palettes; mobile first breakpoints at 960 / 640 px.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Palettes (also re-point the site variables so every widget matches)
   -------------------------------------------------------------------------- */
html.cv-ch,
html.cv-ch[data-theme="light"] {
  --ch-bg: #f4f4f7;
  --ch-card: #ffffff;
  --ch-card-2: #f8f8fb;
  --ch-inset: #fbfbfd;
  --ch-line: #e4e4ea;
  --ch-line-soft: #ededf2;
  --ch-row-hover: #f6f5fb;
  --ch-text: #15151b;
  --ch-muted: #686876;
  --ch-faint: #8d8d9a;
  --ch-chip: #efeff4;
  --ch-pill-bg: #ffffff;
  --ch-accent: #6d5dfc;
  --ch-accent-soft: rgba(109, 93, 252, 0.12);
  --ch-grad: linear-gradient(90deg, #7c5cff 0%, #38bdf8 100%);
  --ch-shadow: 0 1px 2px rgba(17, 17, 26, 0.04), 0 8px 28px -12px rgba(17, 17, 26, 0.08);
  --ch-radius: 18px;
  --ch-radius-sm: 12px;
  --ch-header: rgba(255, 255, 255, 0.86);
  --ch-hero: radial-gradient(120% 140% at 0% 0%, rgba(124, 92, 255, 0.07), transparent 55%),
             radial-gradient(120% 140% at 100% 100%, rgba(45, 212, 191, 0.07), transparent 55%), #ffffff;

  --bg: var(--ch-bg);
  --surface: var(--ch-card);
  --surface-2: var(--ch-card-2);
  --border: var(--ch-line);
  --text: var(--ch-text);
  --muted: var(--ch-muted);
  --radius: 12px;
  --i-box: var(--ch-card);
  --i-box-head: var(--ch-card-2);
  --i-box-alt: var(--ch-inset);
  --i-row-hover: var(--ch-row-hover);
  --i-border: var(--ch-line);
  --i-border-soft: var(--ch-line-soft);
  --i-primary: var(--ch-accent);
  --i-radius: 12px;
  --i-container: 1180px;
}
html.cv-ch[data-theme="dark"] {
  --ch-bg: #060609;
  --ch-card: #111116;
  --ch-card-2: #16161c;
  --ch-inset: #0d0d12;
  --ch-line: #24242d;
  --ch-line-soft: #1c1c24;
  --ch-row-hover: #15151c;
  --ch-text: #f3f3f7;
  --ch-muted: #9b9bab;
  --ch-faint: #77778a;
  --ch-chip: #1f1f27;
  --ch-pill-bg: transparent;
  --ch-accent: #8b7bff;
  --ch-accent-soft: rgba(139, 123, 255, 0.16);
  --ch-shadow: none;
  --ch-header: rgba(8, 8, 12, 0.86);
  --ch-hero: radial-gradient(120% 140% at 0% 0%, rgba(124, 92, 255, 0.10), transparent 55%),
             radial-gradient(120% 140% at 100% 100%, rgba(45, 212, 191, 0.08), transparent 55%), #0f1014;
}

html.cv-ch body { background: var(--ch-bg); color: var(--ch-text); }
html.cv-ch body::before { display: none; }
html.cv-ch body .app-container { max-width: var(--i-container); }

/* --------------------------------------------------------------------------
   Shared pieces
   -------------------------------------------------------------------------- */
html.cv-ch body .ch-pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px 16px; flex-wrap: wrap; margin: 6px 0 18px;
}
html.cv-ch body .ch-pagehead__main { min-width: 0; }
html.cv-ch body .ch-crumbs {
  display: flex; align-items: center; gap: 7px; margin-bottom: 6px;
  font-size: 12.5px; color: var(--ch-muted);
}
html.cv-ch body .ch-title {
  margin: 0; font-family: var(--font-ui); font-size: 28px; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.15; color: var(--ch-text);
}
html.cv-ch body .ch-pagehead__actions { display: flex; flex-wrap: wrap; gap: 8px; }
html.cv-ch body .ch-pill,
html.cv-ch body .fvHeader__actions .follow-btn,
html.cv-ch body .topic-follow-btn,
html.cv-ch body .topic-actions .btn-small {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border: 1px solid var(--ch-line); border-radius: 999px; background: var(--ch-pill-bg);
  color: var(--ch-text); font: 600 13px/1 var(--font-ui); text-decoration: none; cursor: pointer;
  box-shadow: none; white-space: nowrap; transition: border-color .15s, background .15s;
}
html.cv-ch body .ch-pill:hover,
html.cv-ch body .fvHeader__actions .follow-btn:hover,
html.cv-ch body .topic-follow-btn:hover,
html.cv-ch body .topic-actions .btn-small:hover { border-color: var(--ch-accent); text-decoration: none; }
html.cv-ch body .topic-actions .btn-small.danger { color: #f87171; }
html.cv-ch body .topic-actions .btn-small.success { color: #4ade80; }

html.cv-ch body .ch-cta,
html.cv-ch body .cvTabs__new,
html.cv-ch body .quick-reply .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--ch-grad); color: #fff !important;
  font: 700 14.5px/1 var(--font-ui); text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(124, 92, 255, 0.6); transition: transform .15s, box-shadow .15s;
}
html.cv-ch body .ch-cta:hover,
html.cv-ch body .cvTabs__new:hover,
html.cv-ch body .quick-reply .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -8px rgba(124, 92, 255, 0.75); text-decoration: none; }

html.cv-ch body .ch-search {
  display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 16px; min-width: 230px;
  border: 1px solid var(--ch-line); border-radius: 999px; background: var(--ch-card); color: var(--ch-muted);
  margin: 0; cursor: text;
}
html.cv-ch body .ch-search:focus-within { border-color: var(--ch-accent); }
html.cv-ch body .ch-search input {
  flex: 1; min-width: 0; height: 100%; padding: 0; margin: 0; border: 0; outline: 0; box-shadow: none;
  background: transparent; color: var(--ch-text); font: 500 14px var(--font-ui);
}
html.cv-ch body .ch-search input::placeholder { color: var(--ch-faint); }

html.cv-ch body .ch-card,
html.cv-ch body .right-sidebar .sidebar-widget {
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: var(--ch-radius);
  padding: 18px; margin: 0 0 16px; box-shadow: var(--ch-shadow);
}
html.cv-ch body .ch-card__title,
html.cv-ch body .right-sidebar .sidebar-widget > h3 {
  margin: 0 0 14px; font: 700 15px/1.3 var(--font-ui); color: var(--ch-text);
  letter-spacing: 0; text-transform: none; border: 0; padding: 0; background: none; box-shadow: none;
}
html.cv-ch body .right-sidebar .sidebar-widget > *:not(h3) { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
html.cv-ch body .contributor-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 0; padding-right: 0; }
html.cv-ch body .contributor-item .count { font-size: 12px; color: var(--ch-muted); }
html.cv-ch body .contributor-item .avatar-small img { width: 24px; height: 24px; border-radius: 50%; }
html.cv-ch body .announcement-item { padding-left: 0; padding-right: 0; }
html.cv-ch body .announcement-item .title { font-weight: 600; color: var(--ch-text); }
html.cv-ch body .announcement-item .meta { font-size: 12px; color: var(--ch-muted); }
html.cv-ch body .ch-av { display: inline-block; flex: none; line-height: 0; }
html.cv-ch body .ch-av img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; }
html.cv-ch body .ch-chip {
  display: inline-block; margin-bottom: 14px; padding: 4px 11px; border-radius: 999px;
  background: var(--ch-chip); color: var(--ch-text); font: 700 12px/1.3 var(--font-ui);
}
html.cv-ch body .ch-hide { display: none !important; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
html.cv-ch body .app-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: start; }
html.cv-ch body .app-layout:not(:has(> .right-sidebar)) { grid-template-columns: minmax(0, 1fr); }
html.cv-ch body .left-sidebar { display: none; }
html.cv-ch body .right-sidebar { display: block; position: static; }

/* --------------------------------------------------------------------------
   Forum index: hero + stats
   -------------------------------------------------------------------------- */
html.cv-ch body .ch-hero {
  margin: 0 0 18px; padding: 24px 20px; text-align: center;
  background: var(--ch-hero); border: 1px solid var(--ch-line); border-radius: var(--ch-radius); box-shadow: var(--ch-shadow);
}
html.cv-ch body .ch-hero__lead { margin: 0 auto 18px; max-width: 640px; color: var(--ch-muted); font-size: 14.5px; line-height: 1.5; }
html.cv-ch body .ch-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
html.cv-ch body .ch-stat {
  width: 112px; padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--ch-card-2); border: 1px solid var(--ch-line); border-radius: 15px;
}
html.cv-ch body .ch-stat strong { font: 800 22px/1.15 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .ch-stat > span:last-child { font: 700 10.5px/1.3 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ch-muted); }
html.cv-ch body .ch-stat__icon { width: 32px; height: 32px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 9px; font-size: 13px; }
html.cv-ch body .ch-stat__icon--violet { background: rgba(139, 92, 246, 0.16); color: #a78bfa; }
html.cv-ch body .ch-stat__icon--teal { background: rgba(45, 212, 191, 0.15); color: #2dd4bf; }
html.cv-ch body .ch-stat__icon--pink { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
html.cv-ch body .ch-stat__icon--green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

/* Who is online */
html.cv-ch body .who-online-bar { max-width: none; margin: 0 0 16px; padding: 0; }
html.cv-ch body .who-online-trigger {
  width: 100%; padding: 14px 18px; border-radius: var(--ch-radius-sm); background: var(--ch-card);
  border: 1px solid var(--ch-line); box-shadow: var(--ch-shadow); color: var(--ch-text);
}

/* Feed tabs (Forums / Latest / Popular / Unanswered) */
html.cv-ch body .cvTabs { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; padding: 0; border: 0; background: none; }
html.cv-ch body .cvTabs__list {
  display: inline-flex; gap: 4px; padding: 5px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 14px;
}
html.cv-ch body .cvTabs__list::-webkit-scrollbar { display: none; }
html.cv-ch body .cvTabs__tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 0;
  color: var(--ch-muted); background: none; font: 600 14px/1 var(--font-ui); text-decoration: none; white-space: nowrap;
}
html.cv-ch body .cvTabs__tab:hover { color: var(--ch-text); text-decoration: none; }
html.cv-ch body .cvTabs__tab.is-on { background: var(--ch-accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(124, 92, 255, 0.8); }

/* --------------------------------------------------------------------------
   Forum index: category sections and forum rows
   -------------------------------------------------------------------------- */
html.cv-ch body .category-section {
  margin: 0 0 20px; padding: 0; overflow: hidden;
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: var(--ch-radius); box-shadow: var(--ch-shadow);
}
html.cv-ch body .category-section .section-banner {
  position: relative; min-height: 150px; margin: 0; padding: 0;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch;
  background-color: transparent; background-size: cover; background-position: center;
  border: 0; border-radius: 0; box-shadow: none; overflow: hidden;
}
html.cv-ch body .category-section .section-banner:not([style*="background-image"]) { min-height: 0; }
/* Fade the banner image into the card (::after is hidden by the classic theme). */
html.cv-ch body .category-section .section-banner::before {
  content: ''; display: block; position: absolute; inset: 0; z-index: 0; opacity: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 20%, var(--ch-card) 100%); background-image: linear-gradient(180deg, transparent 20%, var(--ch-card) 100%);
}
html.cv-ch body .category-section .banner-content { position: relative; z-index: 1; width: 100%; margin: 0; padding: 18px 20px 14px; text-align: left; background: none; }
html.cv-ch body .category-section .banner-title {
  margin: 0; font: 800 19px/1.25 var(--font-ui); color: var(--ch-text); letter-spacing: -0.01em; text-align: left; text-shadow: none;
}
html.cv-ch body .category-section .banner-subtitle { margin-top: 4px; font-size: 14px; color: var(--ch-text); opacity: 0.85; text-align: left; }
html.cv-ch[data-theme="dark"] body .category-section .section-banner[style*="background-image"] .banner-title,
html.cv-ch[data-theme="dark"] body .category-section .section-banner[style*="background-image"] .banner-subtitle { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }

html.cv-ch body .section-forums {
  margin: 0; padding: 0; overflow: hidden;
  background: transparent; border: 0; border-top: 1px solid var(--ch-line-soft); border-radius: 0;
}
html.cv-ch body .forum-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-areas: "icon info stats" "icon last stats";
  column-gap: 14px; row-gap: 6px; align-items: start; padding: 16px 18px; margin: 0;
  background: transparent; border: 0; border-bottom: 1px solid var(--ch-line-soft); border-radius: 0; box-shadow: none;
}
html.cv-ch body .forum-row:last-child { border-bottom: 0; }
html.cv-ch body .forum-row:hover { background: var(--ch-row-hover); }
html.cv-ch body .forum-icon {
  grid-area: icon; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ch-accent-soft); border: 1px solid rgba(124, 92, 255, 0.28); color: #a78bfa; font-size: 16px;
}
html.cv-ch body .forum-icon img { width: 22px; height: 22px; object-fit: contain; }
html.cv-ch body .forum-info { grid-area: info; min-width: 0; }
html.cv-ch body .forum-name,
html.cv-ch body .forum-name > a { font: 700 15.5px/1.35 var(--font-ui); color: var(--ch-text); text-decoration: none; }
html.cv-ch body .forum-name > a:hover { color: var(--ch-accent); }
html.cv-ch body .forum-desc { margin-top: 3px; font-size: 13.5px; line-height: 1.45; color: var(--ch-muted); }
html.cv-ch body .forum-stats {
  grid-area: stats; display: flex; flex-direction: row; align-items: flex-start; gap: 18px; padding-top: 2px; text-align: center;
  font-size: 11.5px; color: var(--ch-muted); text-transform: capitalize;
}
html.cv-ch body .forum-stats > div { display: flex; flex-direction: column; align-items: center; min-width: 40px; }
html.cv-ch body .forum-stats .stat-number { font: 800 15px/1.3 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .forum-row .forum-lastpost {
  grid-area: last; display: flex; align-items: center; gap: 8px; min-width: 0; margin: 2px 0 0; padding: 0;
  font-size: 12.5px; color: var(--ch-muted); background: none; border: 0;
}
html.cv-ch body .forum-row .forum-lastpost:not(:has(.forum-lastpost__body)) { display: none; }
html.cv-ch body .forum-lastpost__avatar { flex: 0 0 20px; width: 20px; height: 20px; line-height: 0; }
html.cv-ch body .forum-lastpost__avatar img { width: 20px !important; height: 20px !important; min-width: 20px; border-radius: 50%; object-fit: cover; }
html.cv-ch body .forum-lastpost__body { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
html.cv-ch body .forum-lastpost__title { color: var(--ch-text); font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.cv-ch body .forum-lastpost__meta { color: var(--ch-muted); }
html.cv-ch body .forum-lastpost__meta a { color: var(--ch-text); font-weight: 600; }
html.cv-ch body .subforum-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--ch-chip); border: 1px solid var(--ch-line); color: var(--ch-text); font-size: 12px;
}

/* Index sidebar */
html.cv-ch body .ch-activity__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
html.cv-ch body .ch-activity__item { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
html.cv-ch body .ch-activity__body { min-width: 0; }
html.cv-ch body .ch-activity__title {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 14.5px/1.35 var(--font-ui); color: var(--ch-text); text-decoration: none;
}
html.cv-ch body .ch-activity__title:hover { color: var(--ch-accent); }
html.cv-ch body .ch-activity__meta { margin-top: 2px; font-size: 12px; color: var(--ch-muted); }
html.cv-ch body .ch-activity__meta a { color: inherit; }

html.cv-ch body .ch-rules__head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--ch-line-soft); }
html.cv-ch body .ch-rules__head .ch-card__title { margin: 0 0 2px; }
html.cv-ch body .ch-rules__head p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ch-muted); }
html.cv-ch body .ch-rules__icon {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.25); color: #4ade80;
}
html.cv-ch body .ch-rules__list { list-style: none; margin: 0; padding: 0; }
html.cv-ch body .ch-rules__list li {
  display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--ch-line);
  font-size: 13.5px; line-height: 1.45; color: var(--ch-text);
}
html.cv-ch body .ch-rules__list li:last-child { border-bottom: 0; padding-bottom: 0; }
html.cv-ch body .ch-rules__list i { margin-top: 3px; font-size: 12px; color: #4ade80; }

html.cv-ch body .contributor-item,
html.cv-ch body .announcement-item { padding: 8px 0; border-bottom: 1px solid var(--ch-line-soft); background: none; }
html.cv-ch body .contributor-item:last-child,
html.cv-ch body .announcement-item:last-child { border-bottom: 0; }

/* --------------------------------------------------------------------------
   Breadcrumbs (forum view + topic view)
   -------------------------------------------------------------------------- */
html.cv-ch body .ch-pagehead--crumbs { align-items: center; margin: 4px 0 8px; }
html.cv-ch body .breadcrumb-nav { margin: 0; padding: 0; background: none; border: 0; }
html.cv-ch body .breadcrumb-nav .breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none;
  background: none; border: 0; font-size: 12.5px; color: var(--ch-muted);
}
html.cv-ch body .breadcrumb-nav .breadcrumb li { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
html.cv-ch body .breadcrumb-nav .breadcrumb li::after { content: none; }
html.cv-ch body .breadcrumb-nav .breadcrumb li::before { content: none; }
html.cv-ch body .breadcrumb-nav .breadcrumb li + li::before { content: '/'; opacity: 0.6; }
html.cv-ch body .breadcrumb-nav .breadcrumb li:first-child::before {
  content: '\f0ca'; font: 900 11px/1 "Font Awesome 6 Free"; margin-right: 2px; opacity: 0.8;
}
html.cv-ch body .breadcrumb-nav a,
html.cv-ch body .breadcrumbs a { color: var(--ch-muted); text-decoration: none; }
html.cv-ch body .breadcrumb-nav a:hover,
html.cv-ch body .breadcrumbs a:hover { color: var(--ch-text); }
html.cv-ch body .breadcrumb-nav .active { color: var(--ch-muted); }

/* --------------------------------------------------------------------------
   Forum view (category.php)
   -------------------------------------------------------------------------- */
html.cv-ch body .fvHeader { margin: 0 0 16px; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
html.cv-ch body .fvHeader__banner,
html.cv-ch body .fvHeader__icon,
html.cv-ch body .fvHeader__actions .btn-new-topic { display: none; }
html.cv-ch body .fvHeader__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 0; background: none; }
html.cv-ch body .fvHeader__title { margin: 0; font: 800 28px/1.15 var(--font-ui); letter-spacing: -0.02em; color: var(--ch-text); }
html.cv-ch body .fvHeader__desc { margin: 8px 0 0; font-size: 14.5px; color: var(--ch-muted); }
html.cv-ch body .fvHeader__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ch-muted); }
html.cv-ch body .fvHeader__stats strong { color: var(--ch-text); }
html.cv-ch body .fvHeader__flag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.32); color: #f5b544; font-weight: 700;
}
html.cv-ch body .fvHeader__actions { display: flex; gap: 8px; align-items: center; }
html.cv-ch body .fvRules {
  margin: 14px 0 0; background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: var(--ch-radius-sm);
}
html.cv-ch body .fvBox { margin: 0 0 18px; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
html.cv-ch body .fvBox__title { margin: 0 0 10px; font: 700 15px var(--font-ui); color: var(--ch-text); background: none; border: 0; padding: 0; }
html.cv-ch body .fvSubforums__grid { gap: 10px; background: none; border-radius: 0; }
html.cv-ch body .fvSubforum { background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: var(--ch-radius-sm); }
html.cv-ch body .fvBar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin: 0 0 14px; padding: 0; background: none; border: 0;
}
html.cv-ch body .fvBar__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
html.cv-ch body .fvSelect {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; margin: 0;
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 999px;
}
html.cv-ch body .fvSelect__label { font-size: 12px; color: var(--ch-muted); }
html.cv-ch body .fvSelect select {
  height: 100%; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none;
  color: var(--ch-text); font: 600 13.5px var(--font-ui); cursor: pointer;
}
html.cv-ch body .fvSelect select option { background: var(--ch-card); color: var(--ch-text); }
html.cv-ch body .fvBar .mark-read { height: 42px; border-radius: 999px; padding: 0 16px; }
html.cv-ch body .ch-bar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
html.cv-ch body .fvBar__pages { width: 100%; }
html.cv-ch body .fvBar--bottom { margin-top: 14px; }

html.cv-ch body .fvList {
  margin: 0; padding: 0; list-style: none; overflow: hidden;
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: var(--ch-radius); box-shadow: var(--ch-shadow);
}
html.cv-ch body .fvRow {
  grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 16px 20px; background: transparent; border: 0; border-bottom: 1px solid var(--ch-line-soft);
}
html.cv-ch body .fvRow:last-child { border-bottom: 0; }
html.cv-ch body .fvRow:hover { background: var(--ch-row-hover); }
html.cv-ch body .fvRow.is-pinned { background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), transparent 45%); }
html.cv-ch body .fvRow__avatar img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
html.cv-ch body .fvRow__title { margin: 0; font: 600 16px/1.35 var(--font-ui); }
html.cv-ch body .fvRow__title > a { color: var(--ch-text); }
html.cv-ch body .fvRow__meta { margin-top: 4px; font-size: 12.5px; color: var(--ch-muted); }
html.cv-ch body .fvRow__stats { display: none; }
html.cv-ch body .fvRow__mstats { display: inline-flex; align-items: center; gap: 4px; }
html.cv-ch body .fvRow__last { display: flex; align-items: center; gap: 8px; justify-content: flex-end; text-align: right; min-width: 0; }
html.cv-ch body .fvRow__lastAv img { width: 22px; height: 22px; border-radius: 50%; }
html.cv-ch body .fvRow__lastText { display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 2px; min-width: 0; }
html.cv-ch body .fvRow__lastTime { color: var(--ch-text); font-weight: 700; font-size: 12.5px; }
html.cv-ch body .fvRow__lastName { font-size: 12.5px; font-weight: 600; }
html.cv-ch body .fvGroup { padding: 0; background: var(--ch-card-2); border-bottom: 1px solid var(--ch-line-soft); }
html.cv-ch body .fvEmpty { padding: 40px 20px; text-align: center; color: var(--ch-muted); }

/* --------------------------------------------------------------------------
   Topic view (topic.php)
   -------------------------------------------------------------------------- */
html.cv-ch body .topic-container {
  max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 280px; column-gap: 22px; align-items: start;
  grid-template-areas: "crumbs crumbs" "head head" "hero hero" "op op" "feed side" "reply side";
}
html.cv-ch body .topic-container > .breadcrumbs { grid-area: crumbs; margin: 4px 0 6px; padding: 0; font-size: 12.5px; color: var(--ch-muted); background: none; }
html.cv-ch body .topic-container > .ch-pagehead--topic { grid-area: head; align-items: center; margin: 0 0 14px; }
html.cv-ch body .topic-container > .topic-header { grid-area: hero; }
html.cv-ch body .topic-container > .post-card { grid-area: op; }
html.cv-ch body .topic-container > .replies-feed { grid-area: feed; min-width: 0; }
html.cv-ch body .topic-container > .quick-reply,
html.cv-ch body .topic-container > .card { grid-area: reply; min-width: 0; }
html.cv-ch body .topic-container > .ch-topic-side { grid-area: side; position: sticky; top: 90px; display: flex; flex-direction: column; gap: 14px; }
html.cv-ch body .ch-topic-side .ch-card { margin: 0; }

/* Hero */
html.cv-ch body .topic-header {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  position: relative; margin: 0 0 16px; padding: 36px 22px 28px; text-align: center; overflow: hidden;
  background: var(--ch-hero); border: 1px solid var(--ch-line); border-radius: var(--ch-radius); box-shadow: var(--ch-shadow);
}
html.cv-ch body .topic-header.has-banner {
  background: linear-gradient(180deg, rgba(8, 8, 14, 0.45), rgba(8, 8, 14, 0.78)), var(--ch-banner) center / cover no-repeat;
  border-color: transparent;
}
html.cv-ch body .topic-header h1 { width: 100%; text-align: center; margin: 0 0 12px; font: 800 30px/1.2 var(--font-ui); letter-spacing: -0.02em; color: var(--ch-text); }
html.cv-ch body .topic-header.has-banner h1 { color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45); }
html.cv-ch body .ch-topic-author { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: var(--ch-muted); }
html.cv-ch body .ch-topic-author__name { color: var(--ch-text); font-weight: 700; text-decoration: none; }
html.cv-ch body .topic-header.has-banner .ch-topic-author { color: rgba(255, 255, 255, 0.82); }
html.cv-ch body .topic-header.has-banner .ch-topic-author__name { color: #fff; }
html.cv-ch body .ch-dot { opacity: 0.6; }
html.cv-ch body .topic-header .topic-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; margin-top: 14px; font-size: 12.5px; color: var(--ch-muted); }
html.cv-ch body .topic-header.has-banner .topic-meta { color: rgba(255, 255, 255, 0.8); }
html.cv-ch body .topic-header .topic-meta .badge { border-radius: 999px; padding: 3px 10px; }
html.cv-ch body .topic-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
html.cv-ch body .topic-header.has-banner .topic-follow-btn,
html.cv-ch body .topic-header.has-banner .topic-actions .btn-small { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.2); }

/* Posts */
html.cv-ch body .post-card {
  position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr); margin: 0 0 14px; padding: 0;
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: var(--ch-radius); box-shadow: var(--ch-shadow); overflow: visible;
}
html.cv-ch body .post-card:hover { border-color: var(--ch-line); box-shadow: var(--ch-shadow); }
html.cv-ch body .topic-container > .post-card {
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.12), 0 14px 44px -18px rgba(124, 92, 255, 0.45);
}
html.cv-ch body .post-sidebar {
  padding: 22px 14px; gap: 6px; background: transparent;
  border-right: 1px solid var(--ch-line-soft); border-radius: var(--ch-radius) 0 0 var(--ch-radius);
}
html.cv-ch body .post-sidebar .user-avatar { order: -2; }
html.cv-ch body .post-sidebar .user-avatar img { width: 80px; height: 80px; }
html.cv-ch body .post-sidebar .username { order: -1; margin: 6px 0 0; font: 700 14.5px/1.3 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .post-sidebar .username .op-badge {
  display: inline-block; margin-left: 4px; padding: 2px 8px; border-radius: 6px; vertical-align: middle;
  background: var(--ch-accent-soft); color: var(--ch-accent); font: 700 10.5px/1.4 var(--font-ui);
}
html.cv-ch body .post-sidebar .user-role {
  padding: 2px 9px; border-radius: 6px; background: rgba(239, 68, 68, 0.13); color: #f87171; font: 700 11px/1.5 var(--font-ui);
}
html.cv-ch body .post-sidebar .user-role:empty { display: none; }
html.cv-ch body .post-sidebar .user-stats {
  display: grid; gap: 5px; width: 100%; margin-top: 10px; padding: 0; border: 0; font-size: 12px; text-align: left;
}
html.cv-ch body .post-sidebar .user-stats > div { display: flex; justify-content: space-between; gap: 8px; }
html.cv-ch body .post-sidebar .user-stats .k { color: var(--ch-muted); }
html.cv-ch body .post-sidebar .user-stats .v { color: var(--ch-text); font-weight: 700; }
html.cv-ch body .ch-colon { display: none; }

html.cv-ch body .post-content { position: static; padding: 0 0 56px; }
html.cv-ch body .post-header-compact {
  position: static; background: none; border-radius: 0; display: flex; align-items: center; gap: 8px; margin: 0 20px; padding: 16px 0 14px;
  border-bottom: 1px solid var(--ch-line-soft); font-size: 12.5px; color: var(--ch-muted);
}
html.cv-ch body .post-header-compact .post-number { color: var(--ch-muted); }
html.cv-ch body .post-header-compact .post-number::before { content: '· '; }
html.cv-ch body .post-header-compact .post-actions { position: static; margin-left: auto; }
html.cv-ch body .post-header-compact .post-actions .btn-ghost { width: 34px; height: 34px; border-radius: 10px; color: var(--ch-muted); }
html.cv-ch body .post-header-compact .post-actions .btn-ghost:hover { background: var(--ch-chip); }
html.cv-ch body .post-header-compact .post-actions .dropdown-menu { top: 56px; right: 14px; border-radius: 12px; background: var(--ch-card); border: 1px solid var(--ch-line); z-index: 30; }
/* Reply sits bottom-right of the post, reactions bottom-left. */
html.cv-ch body .post-header-compact .post-actions .reply-btn {
  position: absolute; right: 16px; bottom: 12px; display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ch-muted); font: 600 13px/1 var(--font-ui);
}
html.cv-ch body .post-header-compact .post-actions .reply-btn:hover { background: var(--ch-chip); color: var(--ch-text); }
html.cv-ch body .post-body { padding: 18px 20px 8px; font: 400 15.5px/1.7 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .post-reactions { position: absolute; left: 190px; bottom: 12px; display: flex; gap: 6px; padding: 0; }
html.cv-ch body .reaction-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--ch-card-2); border: 1px solid var(--ch-line); color: var(--ch-muted); font-size: 13px;
}
html.cv-ch body .reaction-btn.active { border-color: rgba(124, 92, 255, 0.5); color: var(--ch-text); }
html.cv-ch body .user-signature { margin: 0 20px; }

/* Replies toolbar */
html.cv-ch body .replies-feed { margin: 0; padding: 0; background: none; border: 0; }
html.cv-ch body .feed-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; padding: 0; border: 0; background: none; }
html.cv-ch body .feed-header h3 { order: 2; margin: 0; font: 700 14.5px var(--font-ui); color: var(--ch-text); }
html.cv-ch body .feed-header .sort-dropdown { order: 1; }
html.cv-ch body .feed-header .ch-topic-search { order: 3; margin-left: auto; }
html.cv-ch body .feed-header select {
  height: 42px; padding: 0 16px; border-radius: 999px; background: var(--ch-card); border: 1px solid var(--ch-line);
  color: var(--ch-text); font: 600 13.5px var(--font-ui); cursor: pointer;
}
html.cv-ch body .reply-pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
html.cv-ch body .reply-pagination a,
html.cv-ch body .reply-pagination span {
  min-width: 36px; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ch-line); border-radius: 999px; background: var(--ch-card); color: var(--ch-text); font-weight: 600; text-decoration: none;
}
html.cv-ch body .reply-pagination .active { background: var(--ch-accent); border-color: var(--ch-accent); color: #fff; }

/* Reply editor */
html.cv-ch body .quick-reply {
  margin: 4px 0 20px; padding: 0; overflow: hidden;
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: var(--ch-radius); box-shadow: var(--ch-shadow);
}
html.cv-ch body .quick-reply-header {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 18px;
  border-bottom: 1px solid var(--ch-line-soft); font: 700 14.5px var(--font-ui); color: var(--ch-text); background: none;
}
html.cv-ch body .quick-reply-header img { width: 28px; height: 28px; border-radius: 50%; }
html.cv-ch body .quick-reply form { padding: 0 0 14px; }
html.cv-ch body .quick-reply form > div:last-child { padding: 0 14px; }
html.cv-ch body .quick-reply .ql-toolbar.ql-snow { padding: 10px 14px; border: 0; border-bottom: 1px solid var(--ch-line-soft); background: none; }
html.cv-ch body .quick-reply .ql-container.ql-snow { min-height: 170px; border: 0; background: none; font: 400 15px var(--font-ui); color: var(--ch-text); }
html.cv-ch body .quick-reply .ql-editor.ql-blank::before { color: var(--ch-faint); font-style: normal; }
html.cv-ch body .quick-reply .ql-snow .ql-stroke { stroke: var(--ch-muted); }
html.cv-ch body .quick-reply .ql-snow .ql-fill { fill: var(--ch-muted); }
html.cv-ch body .quick-reply .ql-snow .ql-picker { color: var(--ch-muted); }
html.cv-ch body .topic-container > .card { padding: 18px; text-align: center; background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: var(--ch-radius); }

/* Topic sidebar */
html.cv-ch body .ch-tstats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--ch-line-soft); }
html.cv-ch body .ch-tstats > div { display: flex; flex-direction: column; gap: 2px; }
html.cv-ch body .ch-tstats strong { font: 800 22px/1.15 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .ch-tstats span { font: 700 10.5px/1.3 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ch-muted); }
html.cv-ch body .ch-people { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 14px; }
html.cv-ch body .ch-people .ch-av img { width: 28px; height: 28px; }
html.cv-ch body .ch-side-note { margin: 12px 0 0; font-size: 12.5px; color: var(--ch-muted); }
html.cv-ch body .ch-toc ol { margin: 0; padding: 0 0 0 12px; list-style: none; border-left: 2px solid var(--ch-line); }
html.cv-ch body .ch-toc li a {
  display: block; padding: 5px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--ch-muted); text-decoration: none;
}
html.cv-ch body .ch-toc li a:hover { color: var(--ch-text); }
html.cv-ch body .ch-toc li a.is-active { margin-left: -14px; padding-left: 12px; border-left: 2px solid var(--ch-accent); color: var(--ch-text); font-weight: 700; }
html.cv-ch body .post-card[id] { scroll-margin-top: 90px; }


/* --------------------------------------------------------------------------
   Header (logo bar + navigation) — same flat look as the pages
   -------------------------------------------------------------------------- */
html.cv-ch body .topbar.ipsHeader {
  background: var(--ch-header); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--ch-line);
}
html.cv-ch body .ipsHeader__primary,
html.cv-ch body .ipsNavBar { background: transparent; background-image: none; box-shadow: none; border: 0; }
html.cv-ch body .ipsHeader__inner { min-height: 62px; }
html.cv-ch body .ipsLogo,
html.cv-ch body .ipsLogo:hover,
html.cv-ch body .ipsLogo__text { color: var(--ch-text); font-family: var(--font-ui); font-weight: 800; letter-spacing: -0.02em; }
/* The logo artwork is dark: give it a soft light disc on dark backgrounds. */
html.cv-ch[data-theme="dark"] body .ipsLogo__badge { padding: 3px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 1px var(--ch-line); }
html.cv-ch[data-theme="dark"] body .ipsLogo__img { width: 32px; height: 32px; }
html.cv-ch body .ipsLogo__plus { background: var(--ch-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

html.cv-ch body .ipsUserNav { gap: 6px; }
html.cv-ch body .ipsUserNav .header-btn {
  width: 38px; height: 38px; border-radius: 999px; color: var(--ch-muted) !important; background: transparent;
}
html.cv-ch body .ipsUserNav .header-btn:hover { background: var(--ch-chip); color: var(--ch-text) !important; }
html.cv-ch body .ipsUserNav .unread-badge,
html.cv-ch body .ipsUserNav .header-btn .unread-badge { border-color: var(--ch-bg); }
html.cv-ch body .ipsUserNav .header-btn.ipsCoins {
  width: auto; min-width: 0; height: 36px; padding: 0 13px 0 6px; gap: 7px;
  display: inline-flex; align-items: center; flex: none; white-space: nowrap;
  border-radius: 999px; background: var(--ch-chip); color: var(--ch-text) !important; border: 1px solid var(--ch-line);
  font: 700 13.5px/1 var(--font-ui);
}
html.cv-ch body .ipsUserNav .header-btn.ipsCoins:hover { border-color: rgba(251, 191, 36, 0.55); background: var(--ch-chip); }
html.cv-ch body .ipsUserNav .header-btn.ipsCoins .coven-coin { width: 22px; height: 22px; }
html.cv-ch body .ipsUserNav .header-btn.ipsCoins .coin-amt { display: inline-block; }
html.cv-ch body .ipsUserMenu .profile-trigger { padding: 3px 12px 3px 3px; border-radius: 999px; color: var(--ch-text); border: 1px solid transparent; }
html.cv-ch body .ipsUserMenu .profile-trigger:hover { background: var(--ch-chip); border-color: var(--ch-line); }
html.cv-ch body .ipsUserMenu .dropdown-arrow { color: var(--ch-muted); }
html.cv-ch body .ipsUserMenu__av .ipsUserMenu__online { border-color: var(--ch-bg); }
html.cv-ch body .ipsUserNav__create {
  height: 38px; padding: 0 16px; border-radius: 999px; background: var(--ch-grad); color: #fff !important;
  font-weight: 700; box-shadow: 0 6px 20px -8px rgba(124, 92, 255, 0.7);
}
html.cv-ch body .ipsUserNav__create:hover { background: var(--ch-grad); filter: brightness(1.08); }
html.cv-ch body .ipsUserNav__signin {
  height: 36px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center;
  background: transparent !important; color: var(--ch-text) !important; border: 1px solid var(--ch-line) !important; font-weight: 600;
}
html.cv-ch body .ipsUserNav__signin:hover { background: var(--ch-chip) !important; }
html.cv-ch body .ipsUserNav .btn-primary {
  height: 36px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center;
  background: var(--ch-grad); border: 0; color: #fff !important; font-weight: 700; box-shadow: 0 6px 20px -8px rgba(124, 92, 255, 0.7);
}

/* Menus and pop-ups */
html.cv-ch body .ipsUserMenu__menu,
html.cv-ch body .header-popup {
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 48px -16px rgba(0, 0, 0, 0.45);
}
html.cv-ch body .ipsUserMenu__menu { padding: 6px; }
html.cv-ch body .ipsUserMenu__menu a { border-radius: 9px; }
html.cv-ch body .ipsUserMenu__menu a:hover { background: var(--ch-chip); }
html.cv-ch body .header-popup .popup-header { background: var(--ch-card-2); border-bottom: 1px solid var(--ch-line); }
html.cv-ch body .header-popup .popup-header i { color: var(--ch-accent); }

/* Navigation row */
html.cv-ch body .ipsNavBar__inner { align-items: center; min-height: 54px; gap: 16px; }
html.cv-ch body .ipsNavBar__primary { align-items: center; gap: 4px; padding: 0; }
html.cv-ch body .ipsNavBar__link {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent;
  color: var(--ch-muted) !important; background: transparent; box-shadow: none; font-weight: 600; font-size: 14px;
}
html.cv-ch body .ipsNavBar__link:hover { color: var(--ch-text) !important; background: var(--ch-chip); }
html.cv-ch body .ipsNavBar__link.is-active {
  color: var(--ch-text) !important; background: var(--ch-card); border-color: var(--ch-line); box-shadow: none;
}
html.cv-ch body .ipsNavBar__link.is-active i { color: var(--ch-accent); }
html.cv-ch body .ipsNavBar__search { margin: 0 0 0 auto; flex: 0 1 300px; max-width: 300px; }
html.cv-ch body .ipsNavBar .ipsNavBar__search input,
html.cv-ch body .ipsNavBar__search input[type] {
  height: 38px; padding: 0 40px 0 16px; border-radius: 999px; font-size: 14px;
  background: var(--ch-card); border: 1px solid var(--ch-line); color: var(--ch-text);
}
html.cv-ch body .ipsNavBar .ipsNavBar__search input::placeholder { color: var(--ch-faint); }
html.cv-ch body .ipsNavBar .ipsNavBar__search input:focus,
html.cv-ch body .ipsNavBar__search input[type]:focus { background: var(--ch-card); color: var(--ch-text); border-color: var(--ch-accent); }
html.cv-ch body .ipsNavBar__search button { color: var(--ch-muted); right: 6px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
html.cv-ch body .site-footer.ipsFooter {
  margin: 40px 0 -20px !important; background: var(--ch-bg); border-image: none; border-top: 1px solid var(--ch-line);
}
html.cv-ch body .ipsFooter .footer-inner { padding: 22px 20px; }
html.cv-ch body .ipsFooter__brand { color: var(--ch-muted); gap: 3px; }
html.cv-ch body .ipsFooter__brand b { color: var(--ch-text); font: 800 15px var(--font-ui); letter-spacing: -0.01em; }
html.cv-ch body .ipsFooter__links { gap: 6px; }
html.cv-ch body .ipsFooter__links a {
  padding: 6px 12px; border-radius: 999px; color: var(--ch-muted); font-size: 13px; font-weight: 600; text-decoration: none;
}
html.cv-ch body .ipsFooter__links a:hover { background: var(--ch-chip); color: var(--ch-text); }
html.cv-ch body .ipsFooter .lang-btn {
  height: 36px; padding: 0 14px; border-radius: 999px; background: var(--ch-card); border: 1px solid var(--ch-line); color: var(--ch-text);
}
html.cv-ch body .ipsFooter .lang-btn:hover { border-color: var(--ch-accent); }
html.cv-ch body .ipsFooter .lang-btn .fa-globe { color: var(--ch-accent); }
html.cv-ch body .lang-list { background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 14px; padding: 6px; }
html.cv-ch body .lang-list a { border-radius: 9px; }


/* --------------------------------------------------------------------------
   Who is Online (bar + pop-up)
   -------------------------------------------------------------------------- */
html.cv-ch body .who-online-trigger { display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; transition: border-color .15s; }
html.cv-ch body .who-online-trigger:hover { border-color: var(--ch-accent); }
html.cv-ch body .who-online-label { font-weight: 700; color: var(--ch-text); }
html.cv-ch body .who-online-counts { color: var(--ch-muted); font-size: 13.5px; }
html.cv-ch body .who-online-counts strong { color: var(--ch-text); }
html.cv-ch body .who-online-chevron { margin-left: auto; color: var(--ch-muted); }

html.cv-ch body .who-online-backdrop { background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html.cv-ch body .who-online-panel {
  width: min(520px, calc(100vw - 32px)); max-height: min(640px, 86vh); padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}
html.cv-ch body .who-online-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 18px 14px 20px; margin: 0; border: 0; background: none;
}
html.cv-ch body .who-online-head h2,
html.cv-ch body .who-online-head h2 * { background: none; }
html.cv-ch body .who-online-head h2 {
  display: flex; align-items: center; gap: 12px; margin: 0;
  font: 800 18px/1.2 var(--font-ui); letter-spacing: -0.01em; color: var(--ch-text);
}
html.cv-ch body .who-online-head h2 i {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px;
  background: var(--ch-accent-soft); color: var(--ch-accent); font-size: 14px;
}
html.cv-ch body .who-online-close {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px;
  color: var(--ch-muted); font-size: 22px; transition: background .15s, color .15s;
}
html.cv-ch body .who-online-close:hover { background: var(--ch-chip); color: var(--ch-text); }

html.cv-ch body .who-online-tabs {
  display: flex; gap: 4px; margin: 0 20px 6px; padding: 4px;
  background: var(--ch-card-2); border: 1px solid var(--ch-line); border-radius: 13px;
}
html.cv-ch body .who-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 10px; margin: 0; border: 0; border-radius: 10px; background: transparent;
  color: var(--ch-muted); font: 600 13.5px var(--font-ui); cursor: pointer;
}
html.cv-ch body .who-tab:hover { color: var(--ch-text); background: transparent; }
html.cv-ch body .who-tab.is-active {
  background: var(--ch-card); color: var(--ch-text); border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--ch-line);
}
html.cv-ch body .who-tab-count {
  min-width: 22px; height: 20px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--ch-chip); color: var(--ch-muted); font: 700 11.5px/1 var(--font-ui);
}
html.cv-ch body .who-tab.is-active .who-tab-count { background: var(--ch-accent); color: #fff; }

html.cv-ch body .who-online-body { flex: 1; min-height: 120px; overflow-y: auto; padding: 8px 12px 10px; }
html.cv-ch body .who-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
html.cv-ch body .who-row {
  display: flex; align-items: center; gap: 12px; padding: 10px; margin: 0;
  border: 0; border-radius: 14px; background: transparent; transition: background .12s;
}
html.cv-ch body .who-row:hover { background: var(--ch-row-hover); }
html.cv-ch body .who-avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center; background: var(--ch-chip); color: var(--ch-muted); font-size: 16px;
}
html.cv-ch body img.who-avatar { box-shadow: 0 0 0 2px var(--ch-card), 0 0 0 4px rgba(74, 222, 128, 0.55); }
html.cv-ch body .who-avatar--bot { background: var(--ch-accent-soft); color: var(--ch-accent); }
html.cv-ch body .who-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
html.cv-ch body .who-line { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
html.cv-ch body .who-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ch-text); font: 700 14.5px/1.3 var(--font-ui); text-decoration: none;
}
html.cv-ch body a.who-name:hover { color: var(--ch-accent); }
html.cv-ch body .who-verified { flex: none; color: #3b82f6; font-size: 13px; }
html.cv-ch body .who-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ch-muted); font-size: 12.5px; }
html.cv-ch body .who-ip {
  flex: none; padding: 5px 10px; border-radius: 999px;
  background: var(--ch-chip); border: 1px solid var(--ch-line); color: var(--ch-muted);
  font: 600 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0;
}
html.cv-ch body .who-online-loading,
html.cv-ch body .who-empty { padding: 34px 16px; text-align: center; color: var(--ch-muted); font-size: 14px; }
html.cv-ch body .who-online-foot {
  display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 14px 20px 16px;
  border-top: 1px solid var(--ch-line-soft); background: var(--ch-card-2); color: var(--ch-muted); font-size: 12.5px; line-height: 1.45;
}
html.cv-ch body .who-online-foot:empty { display: none; }
html.cv-ch body .who-online-foot i { margin-top: 2px; color: var(--ch-accent); }


/* --------------------------------------------------------------------------
   Forum view — details (header chips, toolbar, moderation, list states)
   -------------------------------------------------------------------------- */
html.cv-ch body .fvHeader__stats li {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  background: var(--ch-card); border: 1px solid var(--ch-line); font-size: 12.5px; color: var(--ch-muted);
}
html.cv-ch body .fvHeader__stats li.fvHeader__flag { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.32); color: #f5b544; }
html.cv-ch body .fvHeader__actions .follow-btn.is-following { border-color: var(--ch-accent); color: var(--ch-accent); }
html.cv-ch body .fvRules summary { padding: 14px 18px; color: var(--ch-text); font-weight: 700; }
html.cv-ch body .fvRules summary .fa-scroll { color: var(--ch-accent); }
html.cv-ch body .fvRules__body { padding: 0 18px 16px; color: var(--ch-muted); }

html.cv-ch body .fvBar .mark-read {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px;
  background: var(--ch-card); border: 1px solid var(--ch-line); color: var(--ch-text); font: 600 13.5px var(--font-ui); cursor: pointer;
}
html.cv-ch body .fvBar .mark-read:hover { border-color: var(--ch-accent); }
html.cv-ch body .fvSelect:focus-within { border-color: var(--ch-accent); }

/* Staff moderation bar */
html.cv-ch body .fvModBar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin: 0 0 12px; padding: 8px 8px 8px 16px; border-radius: 14px;
  background: var(--ch-card); border: 1px dashed rgba(124, 92, 255, 0.4); color: var(--ch-muted);
}
html.cv-ch body .fvCheck { gap: 10px; font-size: 13px; color: var(--ch-muted); }
html.cv-ch body .fvModBar__form { gap: 8px; margin-left: auto; flex: 0 1 auto; justify-content: flex-end; }
html.cv-ch body .fvModBar select {
  height: 36px; padding: 0 14px; border-radius: 999px; background: var(--ch-card-2); border: 1px solid var(--ch-line);
  color: var(--ch-text); font: 600 13px var(--font-ui); cursor: pointer;
}
html.cv-ch body .fvModBar .btn,
html.cv-ch body .fvModBar #bulk-submit {
  height: 36px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--ch-grad); color: #fff; font: 700 13px var(--font-ui); box-shadow: none;
}

/* Checkboxes (select all + per row) */
html.cv-ch body .fvCheck input,
html.cv-ch body .fvRow__mod input {
  -webkit-appearance: none; appearance: none; flex: none; width: 18px; height: 18px; margin: 0; cursor: pointer;
  border: 1.5px solid var(--ch-faint); border-radius: 6px; background: transparent; display: inline-grid; place-items: center;
  transition: background .12s, border-color .12s;
}
html.cv-ch body .fvCheck input:checked,
html.cv-ch body .fvRow__mod input:checked { background: var(--ch-accent); border-color: var(--ch-accent); }
html.cv-ch body .fvCheck input:checked::after,
html.cv-ch body .fvRow__mod input:checked::after {
  content: ''; width: 5px; height: 9px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
html.cv-ch body .fvRow.is-selected { background: var(--ch-accent-soft); }

/* Group headers inside the list */
html.cv-ch body .fvGroup { background: var(--ch-card-2); border-bottom: 1px solid var(--ch-line-soft); }
html.cv-ch body .fvGroup__btn {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 11px 20px; border: 0; background: none;
  color: var(--ch-muted); font: 700 11.5px/1 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
}
html.cv-ch body .fvGroup__btn:hover { color: var(--ch-text); }
html.cv-ch body .fvGroup__btn .fa-thumbtack { color: #f5b544; }

/* Rows */
html.cv-ch body .fvRow__title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
html.cv-ch body .fvRow__title > a:hover { color: var(--ch-accent); text-decoration: none; }
html.cv-ch body .fvBadge { width: 22px; height: 22px; border-radius: 7px; font-size: 10px; }
html.cv-ch body .fvBadge--locked { background: var(--ch-chip); color: var(--ch-muted); }
html.cv-ch body .fvNew { border-radius: 999px; padding: 2px 8px; background: var(--ch-accent); color: #fff; font-size: 10.5px; }
html.cv-ch body .fvRow__dot { border-color: var(--ch-card); background: var(--ch-accent); }
html.cv-ch body .fvRow__meta a { color: var(--ch-text); font-weight: 600; }
html.cv-ch body .fvRow__meta .fvDot { opacity: 0.5; }
html.cv-ch body .fvRow__mstats { color: var(--ch-muted); }
html.cv-ch body .fvPages a,
html.cv-ch body .fvPages span { border-radius: 6px; border-color: var(--ch-line); color: var(--ch-muted); }
html.cv-ch body .fvRow__last { border: 0; padding: 0; min-width: 130px; }
html.cv-ch body .fvRow__last::before { display: none; }
html.cv-ch body .fvRow__lastText--none { font-style: normal; font-size: 12.5px; color: var(--ch-faint); opacity: 1; }
html.cv-ch body .fvRow__lastText--none span {
  display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--ch-chip);
}
html.cv-ch body .fvRow__mod { padding-left: 6px; }
html.cv-ch body .fvBar--bottom .pagination a,
html.cv-ch body .fvBar__pages a,
html.cv-ch body .fvBar__pages span { border-radius: 999px; }

/* --------------------------------------------------------------------------
   New discussion (new-topic.php)
   -------------------------------------------------------------------------- */
html.cv-ch body .ntc { max-width: var(--i-container); }
html.cv-ch body .ntc > .breadcrumb-nav { margin: 4px 0 14px; }
html.cv-ch body .ntc__grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
html.cv-ch body .ntc__compose {
  padding: 26px 28px 24px; background: var(--ch-card); border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius); box-shadow: var(--ch-shadow);
}
html.cv-ch body .ntc__eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  background: var(--ch-accent-soft); color: var(--ch-accent); font: 700 11px/1.3 var(--font-ui); letter-spacing: 0.1em;
}
html.cv-ch body .ntc__h1 { margin: 12px 0 4px; font: 800 30px/1.15 var(--font-ui); letter-spacing: -0.02em; color: var(--ch-text); }
html.cv-ch body .ntc__in { margin-bottom: 22px; font-size: 14px; color: var(--ch-muted); }
html.cv-ch body .ntc__in b { color: var(--ch-text); }
html.cv-ch body .ntc__label { margin-bottom: 8px; font: 700 13px var(--font-ui); color: var(--ch-text); }
html.cv-ch body .ntc .form-control,
html.cv-ch body .ntc select.form-control,
html.cv-ch body .ntc textarea.form-control {
  min-height: 44px; padding: 10px 14px; border-radius: 12px; background: var(--ch-card-2); border: 1px solid var(--ch-line);
  color: var(--ch-text); font: 500 14px var(--font-ui); box-shadow: none;
}
html.cv-ch body .ntc .form-control:focus { border-color: var(--ch-accent); outline: 0; box-shadow: 0 0 0 3px var(--ch-accent-soft); }
html.cv-ch body #title-editor.ntc__title {
  min-height: 56px; padding: 14px 16px !important; border: 1px solid var(--ch-line) !important; border-radius: 14px !important;
  background: var(--ch-card-2) !important; color: var(--ch-text); font: 700 20px/1.35 var(--font-ui); letter-spacing: -0.01em;
}
html.cv-ch body #title-editor.ntc__title:focus { border-color: var(--ch-accent) !important; box-shadow: 0 0 0 3px var(--ch-accent-soft); outline: 0; }
html.cv-ch body #title-editor.ntc__title:empty::before { color: var(--ch-faint); opacity: 1; font-weight: 600; font-family: var(--font-ui); }
html.cv-ch body .ntc__count { margin: 6px 2px 18px; color: var(--ch-faint); }

html.cv-ch body .ntc .quill-editor { border: 1px solid var(--ch-line); border-radius: 14px; background: var(--ch-card-2); }
html.cv-ch body .ntc .quill-editor:focus-within { border-color: var(--ch-accent); box-shadow: 0 0 0 3px var(--ch-accent-soft); }
html.cv-ch body .ntc .ql-toolbar.ql-snow {
  padding: 10px 12px; border: 0 !important; border-bottom: 1px solid var(--ch-line-soft) !important;
  border-radius: 14px 14px 0 0 !important; background: var(--ch-card-2);
}
html.cv-ch body .ntc .ql-container.ql-snow { border: 0 !important; border-radius: 0 0 14px 14px !important; background: transparent; color: var(--ch-text); font: 400 15.5px var(--font-ui); }
html.cv-ch body .ntc .ql-editor { padding: 16px 18px; }
html.cv-ch body .ntc .ql-editor.ql-blank::before { color: var(--ch-faint); font-style: normal; left: 18px; }
html.cv-ch body .ntc .ql-snow .ql-stroke { stroke: var(--ch-muted); }
html.cv-ch body .ntc .ql-snow .ql-fill { fill: var(--ch-muted); }
html.cv-ch body .ntc .ql-snow .ql-picker,
html.cv-ch body .ntc .ql-snow .ql-picker-label { color: var(--ch-muted); }
html.cv-ch body .ntc .ql-snow button:hover .ql-stroke,
html.cv-ch body .ntc .ql-snow .ql-active .ql-stroke { stroke: var(--ch-accent); }
html.cv-ch body .ntc .ql-snow button:hover .ql-fill,
html.cv-ch body .ntc .ql-snow .ql-active .ql-fill { fill: var(--ch-accent); }
html.cv-ch body .ntc .ql-snow .ql-picker-options { background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 10px; }
html.cv-ch body .ntc .editor-action-footer { background: transparent; border-top: 1px solid var(--ch-line-soft); }
html.cv-ch body .ntc .btn-icon-action { background: var(--ch-chip); color: var(--ch-muted); }

html.cv-ch body .ntc__poll { margin-top: 18px; padding: 2px 16px; border: 1px dashed var(--ch-line); border-radius: 14px; background: transparent; }
html.cv-ch body .ntc__poll[open] { border-style: solid; background: var(--ch-card-2); padding-bottom: 16px; }
html.cv-ch body .ntc__poll summary { padding: 12px 0; color: var(--ch-text); }
html.cv-ch body .ntc__poll summary i { color: var(--ch-accent); }
html.cv-ch body .ntc__poll summary small { padding: 2px 9px; border-radius: 999px; background: var(--ch-chip); color: var(--ch-muted); font-size: 11.5px; }

html.cv-ch body .ntc__side { gap: 14px; top: 90px; }
html.cv-ch body .ntc__card { padding: 18px; background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: var(--ch-radius); box-shadow: var(--ch-shadow); }
html.cv-ch body .ntc__card h3 { margin: 0 0 12px; font: 700 11px/1.3 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ch-muted); }
html.cv-ch body .ntc__where .ntc__ico { width: 42px; height: 42px; background: var(--ch-accent-soft); border: 1px solid rgba(124, 92, 255, 0.3); color: var(--ch-accent); }
html.cv-ch body .ntc__where b { color: var(--ch-text); }
html.cv-ch body .ntc__where a { color: var(--ch-accent); }
html.cv-ch body .ntc__opt { padding: 9px 0; color: var(--ch-text); }
html.cv-ch body .ntc__opt + .ntc__opt { border-top: 1px solid var(--ch-line-soft); }
html.cv-ch body .ntc__opt small { color: var(--ch-muted); }
html.cv-ch body .ntc__opt input {
  -webkit-appearance: none; appearance: none; flex: none; width: 20px; height: 20px; margin: 1px 0 0; cursor: pointer;
  border: 1.5px solid var(--ch-faint); border-radius: 6px; display: inline-grid; place-items: center; background: transparent;
}
html.cv-ch body .ntc__opt input:checked { background: var(--ch-accent); border-color: var(--ch-accent); }
html.cv-ch body .ntc__opt input:checked::after {
  content: ''; width: 5px; height: 10px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
html.cv-ch body .ntc__publish .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 48px;
  border: 0; border-radius: 999px; background: var(--ch-grad); color: #fff; font: 700 15px var(--font-ui);
  box-shadow: 0 10px 28px -10px rgba(124, 92, 255, 0.75);
}
html.cv-ch body .ntc__publish .btn:hover { filter: brightness(1.08); }
html.cv-ch body .ntc__publish .ntc__cancel { margin-top: 10px; color: var(--ch-muted); }
html.cv-ch body .ntc__tips { padding: 0; list-style: none; }
html.cv-ch body .ntc__tips li { position: relative; padding-left: 22px; color: var(--ch-muted); }
html.cv-ch body .ntc__tips li::before {
  content: '\f00c'; position: absolute; left: 0; top: 1px; font: 900 11px/1.6 "Font Awesome 6 Free"; color: #4ade80;
}
html.cv-ch body .ntc__tips li + li { margin-top: 8px; }


/* --------------------------------------------------------------------------
   Header pop-ups (Conversations / Notifications)
   -------------------------------------------------------------------------- */
html.cv-ch body .header-popup {
  min-width: 340px; padding: 0; background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 18px;
  -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.6);
}
html.cv-ch body .header-popup::before { background: var(--ch-card); border-color: var(--ch-line); }
html.cv-ch body .header-popup .popup-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; border-radius: 18px 18px 0 0;
  background: var(--ch-card); border-bottom: 1px solid var(--ch-line-soft); font: 800 15px/1.2 var(--font-ui); color: var(--ch-text);
}
html.cv-ch body .header-popup .popup-header i {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: var(--ch-accent-soft); color: var(--ch-accent); font-size: 13px;
}
html.cv-ch body .header-popup .popup-list { max-height: 380px; padding: 6px; }
html.cv-ch body .header-popup .popup-item {
  align-items: center; gap: 12px; padding: 10px; margin: 0; border: 0; border-radius: 12px; transition: background .12s;
}
html.cv-ch body .header-popup .popup-item:hover { background: var(--ch-row-hover); }
html.cv-ch body .header-popup .popup-item .avatar { width: 40px; height: 40px; background: var(--ch-chip); }
html.cv-ch body .header-popup .popup-item .body .title { font: 600 13.5px/1.35 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .header-popup .popup-item .body .title a { color: var(--ch-text); }
html.cv-ch body .header-popup .popup-item .body .title a:hover { color: var(--ch-accent); text-decoration: none; }
html.cv-ch body .header-popup .popup-item .body .meta {
  margin-top: 3px; font-size: 12px; color: var(--ch-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html.cv-ch body .header-popup .popup-item .unread-dot { background: var(--ch-accent); }
html.cv-ch body .header-popup .notif-inline-actions .btn { height: 30px; padding: 0 14px; border-radius: 999px; font-size: 12px; }
html.cv-ch body .header-popup .popup-empty { padding: 30px 16px; color: var(--ch-muted); font-size: 13.5px; }
html.cv-ch body .header-popup .popup-footer { padding: 10px; border-top: 1px solid var(--ch-line-soft); background: var(--ch-card-2); border-radius: 0 0 18px 18px; }
html.cv-ch body .header-popup .popup-footer a {
  display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 999px;
  background: var(--ch-card); border: 1px solid var(--ch-line); color: var(--ch-text); font: 700 13px var(--font-ui); text-decoration: none;
}
html.cv-ch body .header-popup .popup-footer a:hover { border-color: var(--ch-accent); color: var(--ch-accent); }

/* --------------------------------------------------------------------------
   Messages (messages.php)
   -------------------------------------------------------------------------- */
html.cv-ch body.messages-page .page-wrapper { padding: 0 16px; }
html.cv-ch body .messaging-container {
  margin: 14px auto; max-width: var(--i-container); border: 1px solid var(--ch-line); border-radius: 22px;
  background: var(--ch-card); box-shadow: var(--ch-shadow);
}
/* Sidebar */
html.cv-ch body .chat-sidebar { width: 340px; border: 0; border-right: 1px solid var(--ch-line); background: var(--ch-card); }
html.cv-ch body .chat-sidebar-header { padding: 18px 18px 14px; border-bottom: 0; }
html.cv-ch body .chat-sidebar-header .header-title { gap: 10px; }
html.cv-ch body .chat-sidebar-header .header-title i { color: var(--ch-accent); }
html.cv-ch body .chat-sidebar-header .header-title h2 { font: 800 20px/1.2 var(--font-ui); letter-spacing: -0.01em; color: var(--ch-text); }
html.cv-ch body .btn-new-msg { width: 36px; height: 36px; justify-content: center; align-items: center; border-radius: 999px; background: var(--ch-chip); color: var(--ch-text); }
html.cv-ch body .btn-new-msg:hover { background: var(--ch-accent); color: #fff; transform: none; }
html.cv-ch body .message-requests-banner { margin: 0 14px 8px; border-radius: 12px; }
html.cv-ch body .chat-search { padding: 0 14px 12px; border-bottom: 1px solid var(--ch-line-soft); }
html.cv-ch body .chat-search input {
  height: 40px; padding: 0 16px; border-radius: 999px; background: var(--ch-card-2); border: 1px solid var(--ch-line);
  color: var(--ch-text); font: 500 13.5px var(--font-ui);
}
html.cv-ch body .chat-search input::placeholder { color: var(--ch-faint); }
html.cv-ch body .chat-search input:focus { border-color: var(--ch-accent); box-shadow: 0 0 0 3px var(--ch-accent-soft); }
html.cv-ch body .conversation-list { padding: 6px 8px 10px; }
html.cv-ch body .conv-list-section-label { padding: 10px 10px 6px; font: 700 11px/1 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ch-faint); }
html.cv-ch body .conversation-item { margin: 0 0 2px; padding: 10px; border: 0; border-radius: 14px; color: var(--ch-text); }
html.cv-ch body .conversation-item:hover { background: var(--ch-row-hover); }
html.cv-ch body .conversation-item.active { background: var(--ch-accent-soft); border: 0; box-shadow: inset 3px 0 0 var(--ch-accent); }
html.cv-ch body .conversation-item.pinned { background: transparent; }
html.cv-ch body .conversation-item .user-avatar { width: 46px; height: 46px; border: 0; }
html.cv-ch body .conversation-item.active .user-avatar { border: 0; box-shadow: 0 0 0 2px var(--ch-card), 0 0 0 4px var(--ch-accent); }
html.cv-ch body .conversation-item .user-name { font: 700 14px/1.3 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .conversation-item .chat-time { font-size: 11.5px; color: var(--ch-faint); }
html.cv-ch body .conversation-item .chat-preview { font-size: 13px; color: var(--ch-muted); }
html.cv-ch body .conversation-item .chat-preview.unread { color: var(--ch-text); font-weight: 700; }
html.cv-ch body .conversation-item .chat-preview-wrap { min-width: 0; }
html.cv-ch body .conversation-item .chat-preview { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.cv-ch body .conversation-item .unread-badge {
  position: static; flex: none; margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border: 0;
  display: inline-grid; place-items: center; border-radius: 999px; background: var(--ch-accent); color: #fff; font: 700 11px/1 var(--font-ui);
}
html.cv-ch body .status-indicator { border-color: var(--ch-card); }
html.cv-ch body .status-indicator.online { background: #22c55e; }
html.cv-ch body .story-online-dot { border-color: var(--ch-card); }

/* Conversation */
html.cv-ch body .chat-main { background: var(--ch-card); }
html.cv-ch body .chat-header { padding: 14px 20px; border-bottom: 1px solid var(--ch-line); background: var(--ch-card); }
html.cv-ch body .chat-user-details h3 { font: 800 16px/1.25 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .user-avatar-sm { width: 40px; height: 40px; border: 0; }
html.cv-ch body .status-text { font-size: 12.5px; }
html.cv-ch body .status-text.offline { color: var(--ch-muted); }
html.cv-ch body .chat-icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 999px;
  background: transparent; border: 0; color: var(--ch-muted);
}
html.cv-ch body .chat-icon-btn:hover { background: var(--ch-chip); color: var(--ch-text); }
html.cv-ch body .chat-menu-dropdown { background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 14px; padding: 6px; }
html.cv-ch body .chat-menu-dropdown .dropdown-item { border-radius: 9px; }

/* Default chat background (a background picked for a chat is set inline and still wins). */
html.cv-ch body .chat-messages-body {
  padding: 22px 24px 28px; gap: 10px;
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(124, 92, 255, 0.07), transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(56, 189, 248, 0.05), transparent 60%),
    var(--ch-inset);
}
html.cv-ch body .day-divider span,
html.cv-ch body .system-message-notice span {
  padding: 5px 14px; border-radius: 999px; background: var(--ch-card); border: 1px solid var(--ch-line);
  color: var(--ch-muted); font: 600 11.5px var(--font-ui);
}
html.cv-ch body .message-bubble { max-width: min(68%, 620px); }
html.cv-ch body .message-bubble.received .bubble-content {
  padding: 10px 15px; border-radius: 18px 18px 18px 6px; background: var(--ch-card); border: 1px solid var(--ch-line);
  color: var(--ch-text); font: 400 14.5px/1.5 var(--font-ui); box-shadow: none;
}
html.cv-ch body .message-bubble.sent .bubble-content {
  padding: 10px 15px; border-radius: 18px 18px 6px 18px; background: var(--ch-grad); border: 0;
  color: #fff; font: 400 14.5px/1.5 var(--font-ui); box-shadow: 0 6px 18px -10px rgba(124, 92, 255, 0.8);
}
html.cv-ch body .message-bubble.sent .bubble-content a { color: #fff; text-decoration: underline; }
html.cv-ch body .bubble-sender-name { color: var(--ch-accent); }
html.cv-ch body .message-bubble .cv-ait-msg { margin-top: 4px; color: var(--ch-faint); }
html.cv-ch body .receipt-details { background: var(--ch-card); border-color: var(--ch-line); border-radius: 12px; }

/* Composer */
html.cv-ch body .chat-input-footer { padding: 12px 16px; padding-bottom: calc(12px + var(--safe-bottom, 0px)); border-top: 1px solid var(--ch-line); background: var(--ch-card); }
html.cv-ch body .chat-input-footer input[type="text"] {
  height: 44px; padding: 0 18px; border-radius: 999px; background: var(--ch-card-2); border: 1px solid var(--ch-line);
  color: var(--ch-text); font: 500 14.5px var(--font-ui);
}
html.cv-ch body .chat-input-footer input[type="text"]::placeholder { color: var(--ch-faint); }
html.cv-ch body .chat-input-footer input[type="text"]:focus { border-color: var(--ch-accent); box-shadow: 0 0 0 3px var(--ch-accent-soft); }
html.cv-ch body .btn-attach { width: 38px; height: 38px; border-radius: 999px; color: var(--ch-muted); }
html.cv-ch body .btn-attach:hover { background: var(--ch-chip); color: var(--ch-text); }
html.cv-ch body .quick-emoji-wrap .btn-quick-emoji { border-radius: 999px; background: var(--ch-chip); border: 1px solid var(--ch-line); }
html.cv-ch body .btn-send {
  min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--ch-grad); color: #fff;
  font: 700 14px var(--font-ui); box-shadow: 0 8px 22px -10px rgba(124, 92, 255, 0.8);
}
html.cv-ch body .btn-send:hover { opacity: 1; filter: brightness(1.08); transform: none; }

/* Details panel */
html.cv-ch body .chat-info-panel { background: var(--ch-card); border-left: 1px solid var(--ch-line); }
html.cv-ch body .chat-info-tab { border-radius: 999px; }
html.cv-ch body .chat-info-tab.active { background: var(--ch-accent); color: #fff; }
html.cv-ch body .chat-settings-section { border-color: var(--ch-line-soft); }
html.cv-ch body .nickname-input { border-radius: 10px; background: var(--ch-card-2); border: 1px solid var(--ch-line); color: var(--ch-text); }


/* --------------------------------------------------------------------------
   User menu (avatar dropdown)
   -------------------------------------------------------------------------- */
html.cv-ch body .ipsUserMenu__menu { min-width: 270px; padding: 6px; border-radius: 18px; }
html.cv-ch body .ipsUserMenu__head { margin: 0 0 6px; padding: 12px 12px 12px; border-bottom: 1px solid var(--ch-line-soft); }
html.cv-ch body .ipsUserMenu__head strong { font: 800 15px/1.3 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .ipsUserMenu__head span { font-size: 12.5px; color: var(--ch-muted); }
html.cv-ch body .ipsUserMenu__menu a {
  gap: 12px; padding: 9px 12px; border-radius: 10px; white-space: nowrap;
  font: 600 14px/1.3 var(--font-ui); color: var(--ch-text);
}
html.cv-ch body .ipsUserMenu__menu a i { width: 18px; color: var(--ch-muted); }
html.cv-ch body .ipsUserMenu__menu a:hover i { color: var(--ch-accent); }
html.cv-ch body .ipsUserMenu__menu a .badge { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--ch-accent); color: #fff; font-size: 11px; }
html.cv-ch body .ipsUserMenu__menu hr { margin: 6px 4px; border-top-color: var(--ch-line-soft); }
html.cv-ch body .ipsUserMenu__menu a.text-danger,
html.cv-ch body .ipsUserMenu__menu a.text-danger i { color: #f87171; }
html.cv-ch body .ipsUserMenu__menu a.text-danger:hover { background: rgba(239, 68, 68, 0.1); }

/* --------------------------------------------------------------------------
   Profile (profile.php)
   -------------------------------------------------------------------------- */
html.cv-ch body .ipb-profile-container { max-width: var(--i-container); margin: 18px auto; padding: 0; }
html.cv-ch body .ipb-header-card {
  margin-bottom: 22px; background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 22px; box-shadow: var(--ch-shadow);
}
html.cv-ch body .ipb-header-cover { height: 210px; opacity: 1; background: var(--ch-grad); }
html.cv-ch body .ipb-header-cover:not([style*="background"]) { opacity: 0.55; }
html.cv-ch body .ipb-header-cover[style*="background-image"] { opacity: 1; }
html.cv-ch body .ipb-header-cover-editable .cover-edit-hint { border-radius: 999px; }
html.cv-ch body .ipb-header-content { align-items: flex-start; gap: 22px; padding: 0 26px 24px; }
html.cv-ch body .ipb-avatar-box { margin-top: -70px; }
html.cv-ch body .ipb-avatar-box img,
html.cv-ch body .ipb-avatar-placeholder {
  width: 136px; height: 136px; border: 5px solid var(--ch-card); background: var(--ch-card-2);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
}
html.cv-ch body .avatar-edit-badge { border-color: var(--ch-card); background: var(--ch-accent); }
html.cv-ch body .ipb-user-info { min-width: 0; flex: 1; padding-top: 14px; }
html.cv-ch body .ipb-user-name-row h1 { font: 800 28px/1.15 var(--font-ui); letter-spacing: -0.02em; color: var(--ch-text); }
html.cv-ch body .ipb-group-label { padding: 3px 10px; border-radius: 999px; background: var(--ch-accent-soft); color: var(--ch-accent); font: 700 11.5px var(--font-ui); }
html.cv-ch body .ipb-bio-tagline { color: var(--ch-muted); font-size: 14.5px; line-height: 1.55; }
html.cv-ch body .ipb-meta-grid { gap: 10px; margin-top: 14px; }
html.cv-ch body .ipb-meta-col { padding: 8px 14px; border-radius: 12px; background: var(--ch-card-2); border: 1px solid var(--ch-line); }
html.cv-ch body .ipb-meta-col .meta-label { font: 700 10.5px/1.3 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ch-muted); }
html.cv-ch body .ipb-meta-col .meta-value { font: 700 14px/1.4 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .ipb-header-actions { align-self: flex-start; padding-top: 14px; gap: 8px; }
html.cv-ch body .ipb-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  font: 700 13.5px var(--font-ui); text-decoration: none; box-shadow: none;
}
html.cv-ch body .ipb-btn-secondary { background: var(--ch-card); border: 1px solid var(--ch-line); color: var(--ch-text); }
html.cv-ch body .ipb-btn-secondary:hover { border-color: var(--ch-accent); background: var(--ch-card); }
html.cv-ch body .ipb-btn-primary,
html.cv-ch body .ipb-btn.ipb-btn-primary { background: var(--ch-grad); border: 0; color: #fff; box-shadow: 0 8px 22px -10px rgba(124, 92, 255, 0.8); }
html.cv-ch body .ipb-btn-danger { border-radius: 999px; }

html.cv-ch body .ipb-profile-grid { grid-template-columns: 300px minmax(0, 1fr); gap: 22px; }
html.cv-ch body .ipb-sidebar { gap: 16px; }
html.cv-ch body .ipb-card { background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 18px; box-shadow: var(--ch-shadow); }
html.cv-ch body .ipb-card-header-badge { padding: 14px 18px; background: var(--ch-card-2); border-bottom: 1px solid var(--ch-line-soft); }
html.cv-ch body .member-ribbon { font: 700 11.5px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ch-muted); }
html.cv-ch body .stat-list-item { padding: 14px 18px; border-top: 1px solid var(--ch-line-soft); }
html.cv-ch body .stat-list-item:first-of-type { border-top: 0; }
html.cv-ch body .stat-list-item .stat-number { font: 800 17px var(--font-ui); color: var(--ch-text); }
html.cv-ch body .stat-list-item .card-subtext { color: var(--ch-muted); }
html.cv-ch body .ipb-card-divider { background: var(--ch-line-soft); margin: 0 18px; }
html.cv-ch body .info-widget { border-radius: 18px; background: var(--ch-card); border: 1px solid var(--ch-line); }

html.cv-ch body .ipb-main-content { background: none; border: 0; border-radius: 0; overflow: visible; }
html.cv-ch body .ipb-feed-tabs {
  gap: 4px; margin-bottom: 16px; padding: 5px; border: 1px solid var(--ch-line); border-radius: 14px; background: var(--ch-card);
}
html.cv-ch body .ipb-tab-btn { border: 0; border-radius: 10px; padding: 10px 14px; color: var(--ch-muted); font: 600 14px var(--font-ui); }
html.cv-ch body .ipb-tab-btn:hover { color: var(--ch-text); background: transparent; }
html.cv-ch body .ipb-tab-btn.active { border: 0; background: var(--ch-accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(124, 92, 255, 0.8); }
html.cv-ch body .ipb-tab-content { padding: 0; }
html.cv-ch body .ipb-section { padding: 20px 22px; margin-bottom: 18px; background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 18px; box-shadow: var(--ch-shadow); }
html.cv-ch body .ipb-section h3 { font: 800 16px var(--font-ui); color: var(--ch-text); }
html.cv-ch body .ipb-section h3 i { color: var(--ch-accent); }
html.cv-ch body .ipb-section h3 .section-count { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: var(--ch-chip); color: var(--ch-muted); font-size: 12px; }
html.cv-ch body .wall-item { padding: 12px 14px; border-radius: 14px; background: var(--ch-card-2); border: 1px solid var(--ch-line); }
html.cv-ch body .wall-input-wrapper { border-radius: 14px; background: var(--ch-card-2); border: 1px solid var(--ch-line); }
html.cv-ch body .wall-input-wrapper:focus-within { border-color: var(--ch-accent); box-shadow: 0 0 0 3px var(--ch-accent-soft); }
html.cv-ch body .wall-input-wrapper textarea { background: transparent; color: var(--ch-text); }
html.cv-ch body .wall-input-bottom .btn,
html.cv-ch body .wall-form .btn-primary { border-radius: 999px; background: var(--ch-grad); border: 0; color: #fff; }
html.cv-ch body .activity-item { padding: 12px 6px; border-bottom: 1px solid var(--ch-line-soft); border-radius: 0; }
html.cv-ch body .activity-icon { border-radius: 10px; background: var(--ch-accent-soft); color: var(--ch-accent); }
html.cv-ch body .activity-meta { color: var(--ch-muted); }
html.cv-ch body .stats-grid .stat-card { border-radius: 16px; background: var(--ch-card-2); border: 1px solid var(--ch-line); }

/* --------------------------------------------------------------------------
   Settings (settings.php)
   -------------------------------------------------------------------------- */
html.cv-ch body .app-layout:has(.cv-settings-tabs) .main-content { max-width: 880px; width: 100%; margin: 0 auto; }
html.cv-ch body .main-content .card {
  margin-bottom: 16px; background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 18px; box-shadow: var(--ch-shadow);
}
html.cv-ch body .main-content > .card:not(.cv-settings-head):not(.cv-settings-setup) { padding: 24px 26px; }
html.cv-ch body .cv-settings-head.card { padding: 20px 24px !important; background: var(--ch-hero); }
html.cv-ch body .cv-settings-head h2 { display: flex; align-items: center; gap: 12px; font: 800 24px/1.2 var(--font-ui); letter-spacing: -0.02em; color: var(--ch-text); }
html.cv-ch body .cv-settings-head h2 i {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: var(--ch-accent-soft); color: var(--ch-accent); font-size: 17px;
}
html.cv-ch body .cv-settings-head p { margin-top: 6px !important; color: var(--ch-muted); }
html.cv-ch body .cv-settings-setup.card { padding: 14px 20px !important; }
html.cv-ch body .cv-settings-tabs {
  gap: 4px !important; padding: 5px !important; margin-bottom: 18px !important; border: 1px solid var(--ch-line) !important;
  border-radius: 16px; background: var(--ch-card); overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none;
}
html.cv-ch body .cv-settings-tabs::-webkit-scrollbar { display: none; }
html.cv-ch body .cv-settings-tabs .btn {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border: 0; border-radius: 11px;
  background: transparent; color: var(--ch-muted); font: 600 13.5px var(--font-ui); white-space: nowrap; box-shadow: none;
}
html.cv-ch body .cv-settings-tabs .btn:hover { color: var(--ch-text); background: var(--ch-chip); }
html.cv-ch body .cv-settings-tabs .btn.btn-primary { background: var(--ch-accent); color: #fff !important; box-shadow: 0 6px 18px -8px rgba(124, 92, 255, 0.8); }
html.cv-ch body .main-content .card h3 { margin: 0 0 18px; font: 800 19px/1.25 var(--font-ui); letter-spacing: -0.01em; color: var(--ch-text); }
html.cv-ch body .main-content .form-group label { font: 700 13px var(--font-ui); color: var(--ch-text); }
html.cv-ch body .main-content .form-group input[type="text"],
html.cv-ch body .main-content .form-group input[type="email"],
html.cv-ch body .main-content .form-group input[type="password"],
html.cv-ch body .main-content .form-group input[type="url"],
html.cv-ch body .main-content .form-group input[type="date"],
html.cv-ch body .main-content .form-group input[type="number"],
html.cv-ch body .main-content .form-group select,
html.cv-ch body .main-content .form-group textarea {
  min-height: 44px; padding: 10px 14px; border-radius: 12px; background: var(--ch-card-2); border: 1px solid var(--ch-line);
  color: var(--ch-text); font: 500 14px var(--font-ui); box-shadow: none;
}
html.cv-ch body .main-content .form-group input:focus,
html.cv-ch body .main-content .form-group select:focus,
html.cv-ch body .main-content .form-group textarea:focus { border-color: var(--ch-accent); outline: 0; box-shadow: 0 0 0 3px var(--ch-accent-soft); }
html.cv-ch body .main-content .form-hint { color: var(--ch-muted); }
html.cv-ch body .main-content .card .btn-primary {
  height: 42px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ch-grad); color: #fff; font: 700 14px var(--font-ui);
  box-shadow: 0 8px 22px -10px rgba(124, 92, 255, 0.8);
}
html.cv-ch body .main-content .card.danger-zone { border-color: rgba(239, 68, 68, 0.4); }
html.cv-ch body .main-content .card .btn-danger { border-radius: 999px; }

/* --------------------------------------------------------------------------
   Marketplace (marketplace.php, marketplace-product.php)
   -------------------------------------------------------------------------- */
html.cv-ch body .mkt-head {
  padding: 22px 24px; margin-bottom: 16px; border: 1px solid var(--ch-line); border-radius: 22px; box-shadow: var(--ch-shadow);
  background: radial-gradient(120% 140% at 0% 0%, rgba(124, 92, 255, 0.18), transparent 55%),
              radial-gradient(120% 140% at 100% 100%, rgba(56, 189, 248, 0.12), transparent 55%), var(--ch-card);
}
html.cv-ch body .mkt-head__icon { width: 52px; height: 52px; border-radius: 15px; background: var(--ch-grad); }
html.cv-ch body .mkt-head h1 { font: 800 26px/1.15 var(--font-ui); letter-spacing: -0.02em; color: var(--ch-text); }
html.cv-ch body .mkt-head__sub { color: var(--ch-muted); }
html.cv-ch body .mkt-search input {
  height: 42px; min-width: 260px; padding: 0 44px 0 18px; border-radius: 999px;
  background: var(--ch-card); border: 1px solid var(--ch-line); color: var(--ch-text);
}
html.cv-ch body .mkt-search input:focus { border-color: var(--ch-accent); box-shadow: 0 0 0 3px var(--ch-accent-soft); }
html.cv-ch body .mkt-sell-btn,
html.cv-ch body .mkt-head .btn-primary {
  height: 42px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ch-grad); color: #fff; font: 700 14px var(--font-ui);
  box-shadow: 0 8px 22px -10px rgba(124, 92, 255, 0.8);
}
html.cv-ch body .mkt-chips { gap: 8px; margin-bottom: 18px; }
html.cv-ch body .mkt-chip { height: 38px; padding: 0 16px; background: var(--ch-card); border: 1px solid var(--ch-line); color: var(--ch-muted); }
html.cv-ch body .mkt-chip:hover { border-color: var(--ch-accent); color: var(--ch-text); }
html.cv-ch body .mkt-chip.active { background: var(--ch-accent); border-color: var(--ch-accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(124, 92, 255, 0.8); }
html.cv-ch body .mkt-chip.active i { color: #fff; }
html.cv-ch body .marketplace-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
html.cv-ch body .product-card { border-radius: 18px; background: var(--ch-card); border: 1px solid var(--ch-line); box-shadow: var(--ch-shadow); }
html.cv-ch body .product-card:hover { border-color: rgba(124, 92, 255, 0.5); box-shadow: 0 18px 40px -20px rgba(124, 92, 255, 0.6); }
html.cv-ch body .product-card-img { aspect-ratio: 4 / 3; background: var(--ch-card-2); }
html.cv-ch body .product-card-body { padding: 14px 16px 16px; gap: 6px; }
html.cv-ch body .product-card-title { font: 700 15px/1.35 var(--font-ui); color: var(--ch-text); }
html.cv-ch body .product-card-meta { color: var(--ch-muted); }
html.cv-ch body .product-card-foot { padding-top: 12px; border-top: 1px solid var(--ch-line-soft); align-items: center; }
html.cv-ch body .product-card-price { font: 800 18px var(--font-ui); color: var(--ch-text); }
html.cv-ch body .product-card-cta {
  padding: 6px 12px; border-radius: 999px; background: var(--ch-accent-soft); color: var(--ch-accent); font: 700 12px var(--font-ui);
}
html.cv-ch body .product-card:hover .product-card-cta { background: var(--ch-accent); color: #fff; }
html.cv-ch body .product-discount-badge { border-radius: 999px; }
html.cv-ch body .mkt-empty { border-radius: 18px; background: var(--ch-card); border-color: var(--ch-line); }
html.cv-ch body .mkt-empty i { color: var(--ch-accent); }
html.cv-ch body .mkt-sell-fab { background: var(--ch-grad); color: #fff; box-shadow: 0 12px 28px -8px rgba(124, 92, 255, 0.7); }

html.cv-ch body .mkt-product-wrap { max-width: var(--i-container); gap: 28px; }
html.cv-ch body .mkt-gallery-main { border-radius: 20px; border-color: var(--ch-line); background: var(--ch-card-2); }
html.cv-ch body .mkt-gallery-thumbs img { border-radius: 12px; }
html.cv-ch body .mkt-gallery-thumbs img.active { border-color: var(--ch-accent); }
html.cv-ch body .mkt-product-title { font: 800 28px/1.2 var(--font-ui); letter-spacing: -0.02em; color: var(--ch-text); }
html.cv-ch body .mkt-product-price { font: 800 30px var(--font-ui); color: var(--ch-text); }
html.cv-ch body .mkt-meta-row { color: var(--ch-muted); }
html.cv-ch body .mkt-seller-card,
html.cv-ch body .mkt-checkout-section { border-radius: 18px; background: var(--ch-card); border: 1px solid var(--ch-line); box-shadow: var(--ch-shadow); }
html.cv-ch body .mkt-seller-card:hover { border-color: var(--ch-accent); }
html.cv-ch body .mkt-checkout-section h4 { font: 800 15px var(--font-ui); color: var(--ch-text); }
html.cv-ch body .mkt-checkout-section h4 i { color: var(--ch-accent); }
html.cv-ch body .mkt-checkout-section .btn,
html.cv-ch body .mkt-product-wrap .btn { border-radius: 999px; }
html.cv-ch body .mkt-checkout-section .btn-primary,
html.cv-ch body .mkt-product-wrap .btn-primary { background: var(--ch-grad); border: 0; color: #fff; }
html.cv-ch body .mkt-description { color: var(--ch-text); line-height: 1.7; }
html.cv-ch body .mkt-status-banner { border-radius: 14px; background: var(--ch-card-2); border: 1px solid var(--ch-line); }

/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  html.cv-ch body .forum-row .forum-lastpost { display: flex; }
}
@media (max-width: 960px) {
  html.cv-ch body .app-layout { grid-template-columns: minmax(0, 1fr); }
  html.cv-ch body .right-sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
  html.cv-ch body .right-sidebar > * { margin: 0; }
  html.cv-ch body .topic-container {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "crumbs" "head" "hero" "op" "feed" "reply" "side";
  }
  html.cv-ch body .topic-container > .ch-topic-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  html.cv-ch body .ntc__grid { grid-template-columns: minmax(0, 1fr); }
  html.cv-ch body .ntc__side { position: static; }
  html.cv-ch body .ipb-profile-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   Phone
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  html.cv-ch body .app-container { padding-left: 14px; padding-right: 14px; }
  html.cv-ch body .ch-title,
  html.cv-ch body .fvHeader__title { font-size: 23px; }
  html.cv-ch body .ch-pagehead { align-items: flex-start; flex-direction: column; margin-bottom: 14px; }
  html.cv-ch body .ch-pagehead--crumbs { flex-direction: row; align-items: center; }
  html.cv-ch body .ch-pagehead__actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  html.cv-ch body .ch-pagehead--crumbs .ch-pagehead__actions { width: auto; }
  html.cv-ch body .ch-pagehead--crumbs .ch-pill span,
  html.cv-ch body .ch-pagehead--topic .ch-pill span { display: none; }
  html.cv-ch body .ch-pagehead--topic { flex-direction: row; align-items: center; }
  html.cv-ch body .ch-pagehead--topic .ch-pagehead__actions { width: auto; }

  html.cv-ch body .ch-hero { padding: 18px 14px; }
  html.cv-ch body .ch-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.cv-ch body .ch-stat { width: auto; }

  html.cv-ch body .cvTabs { flex-direction: column; align-items: stretch; }
  html.cv-ch body .cvTabs__list { width: 100%; }
  html.cv-ch body .cvTabs__tab { flex: 1; justify-content: center; padding: 9px 10px; }
  html.cv-ch body .cvTabs__new { width: 100%; }

  html.cv-ch body .section-banner { min-height: 120px; }
  html.cv-ch body .banner-content { padding: 14px 16px 12px; }
  html.cv-ch body .forum-row {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas: "icon info" "icon last" "icon stats";
    column-gap: 12px; padding: 14px;
  }
  html.cv-ch body .forum-icon { width: 36px; height: 36px; font-size: 14px; }
  html.cv-ch body .forum-stats { justify-content: flex-start; gap: 14px; padding-top: 4px; }
  html.cv-ch body .forum-stats > div { flex-direction: row; align-items: baseline; gap: 4px; min-width: 0; }
  html.cv-ch body .forum-stats .stat-number { font-size: 13px; }
  html.cv-ch body .forum-lastpost__title { max-width: 160px; }

  html.cv-ch body .fvHeader__body { grid-template-columns: minmax(0, 1fr); }
  html.cv-ch body .fvBar__filters { width: 100%; }
  html.cv-ch body .fvSelect { flex: 1; min-width: 0; }
  html.cv-ch body .fvSelect select { width: 100%; }
  html.cv-ch body .ch-bar-right { width: 100%; margin: 0; }
  html.cv-ch body .ch-bar-right .ch-search { flex: 1; min-width: 0; }
  html.cv-ch body .ch-bar-right .ch-cta { padding: 0 16px; }
  html.cv-ch body .fvRow { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 14px; align-items: start; }
  html.cv-ch body .fvRow__avatar img { width: 38px; height: 38px; }
  html.cv-ch body .fvRow__last { display: none; }
  html.cv-ch body .fvRow__title { font-size: 15px; }

  html.cv-ch body .topic-header { padding: 26px 16px 22px; }
  html.cv-ch body .topic-header h1 { font-size: 23px; }
  html.cv-ch body .post-card { grid-template-columns: minmax(0, 1fr); }
  html.cv-ch body .post-sidebar {
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 10px; text-align: left;
    padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--ch-line-soft); border-radius: var(--ch-radius) var(--ch-radius) 0 0;
  }
  html.cv-ch body .post-sidebar .user-avatar img { width: 40px; height: 40px; }
  html.cv-ch body .post-sidebar .username { margin: 0; }
  html.cv-ch body .post-sidebar .user-stats { display: flex; gap: 14px; width: 100%; margin: 2px 0 0; }
  html.cv-ch body .post-sidebar .user-stats > div { justify-content: flex-start; gap: 5px; }
  html.cv-ch body .post-header-compact { margin: 0 16px; padding: 12px 0; }
  html.cv-ch body .post-body { padding: 14px 16px 6px; font-size: 15px; }
  html.cv-ch body .ipsHeader__inner { min-height: 56px; }
  html.cv-ch body .ipsNavBar__inner { min-height: 0; padding-bottom: 8px; }
  html.cv-ch body .ipsNavBar__search { order: -1; flex: 1 0 100%; max-width: none; margin: 4px 0 8px; }
  html.cv-ch body .ipsNavBar__link { height: 34px; padding: 0 12px; font-size: 13px; }
  html.cv-ch body .ipsUserNav__signin,
  html.cv-ch body .ipsUserNav .btn-primary { height: 32px; padding: 0 12px; font-size: 13px; }
  html.cv-ch body .ipsFooter .footer-inner { padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px)); }
  html.cv-ch body .ipsFooter__brand { flex-direction: column; align-items: center; text-align: center; gap: 2px; }
  /* Forum view */
  html.cv-ch body .fvHeader__actions { justify-content: flex-start; }
  html.cv-ch body .fvBar .mark-read { width: 42px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  html.cv-ch body .fvBar .mark-read i { font-size: 14px; }
  html.cv-ch body .fvModBar { padding: 10px 12px; }
  html.cv-ch body .fvModBar__form { width: 100%; }
  html.cv-ch body .fvModBar select { flex: 1; min-width: 0; }
  html.cv-ch body .fvGroup__btn { padding: 10px 14px; }

  /* New discussion */
  html.cv-ch body .ntc__grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  html.cv-ch body .ntc__compose { padding: 18px 16px; }
  html.cv-ch body .ntc__h1 { font-size: 24px; }
  html.cv-ch body #title-editor.ntc__title { font-size: 18px; min-height: 52px; }
  html.cv-ch body .ntc__publish { border-radius: 999px; padding: 6px; }
  html.cv-ch body .ntc__publish .btn { min-height: 46px; }

  /* Messages: full-screen chat on phones */
  html.cv-ch body.messages-page .page-wrapper { padding: 0; }
  html.cv-ch body .messaging-container { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  html.cv-ch body .chat-sidebar { width: 100%; border-right: 0; }
  html.cv-ch body .chat-header { padding: 10px 12px; }
  html.cv-ch body .chat-messages-body { padding: 14px 12px 24px; }
  html.cv-ch body .message-bubble { max-width: 84%; }
  html.cv-ch body .chat-input-footer { padding: 8px 10px; padding-bottom: calc(8px + var(--safe-bottom, 0px)); gap: 6px; }
  html.cv-ch body .btn-send { min-height: 40px; padding: 0 14px; }
  html.cv-ch body .header-popup { min-width: 0; }

  /* Profile */
  html.cv-ch body .ipb-profile-container { margin-top: 10px; }
  html.cv-ch body .ipb-header-card { border-radius: 18px; }
  html.cv-ch body .ipb-header-cover { height: 140px; }
  html.cv-ch body .ipb-header-content { flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 0 16px 20px; }
  html.cv-ch body .ipb-avatar-box { margin-top: -58px; }
  html.cv-ch body .ipb-avatar-box img,
  html.cv-ch body .ipb-avatar-placeholder { width: 112px; height: 112px; }
  html.cv-ch body .ipb-user-info { padding-top: 0; width: 100%; }
  html.cv-ch body .ipb-user-name-row { justify-content: center; }
  html.cv-ch body .ipb-user-name-row h1 { font-size: 23px; }
  html.cv-ch body .ipb-meta-grid { justify-content: center; flex-wrap: wrap; }
  html.cv-ch body .ipb-header-actions { align-self: stretch; justify-content: center; padding-top: 0; flex-wrap: wrap; }
  html.cv-ch body .ipb-feed-tabs { overflow-x: auto; scrollbar-width: none; }
  html.cv-ch body .ipb-tab-btn { white-space: nowrap; }
  html.cv-ch body .ipb-section { padding: 16px; }

  /* Settings */
  html.cv-ch body .main-content > .card:not(.cv-settings-head):not(.cv-settings-setup) { padding: 18px 16px; }
  html.cv-ch body .cv-settings-head h2 { font-size: 21px; }

  /* Marketplace */
  html.cv-ch body .mkt-head { padding: 16px; border-radius: 18px; }
  html.cv-ch body .mkt-search input { min-width: 0; }
  html.cv-ch body .marketplace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html.cv-ch body .product-card { border-radius: 16px; }
  html.cv-ch body .product-card-body { padding: 10px 12px 12px; }
  html.cv-ch body .product-card-title { font-size: 13.5px; }
  html.cv-ch body .product-card-price { font-size: 16px; }
  html.cv-ch body .mkt-product-title { font-size: 23px; }

  /* Who is Online: bottom sheet */
  html.cv-ch body .who-online-modal { align-items: flex-end; }
  html.cv-ch body .who-online-panel {
    width: 100vw; max-height: 86vh; border-radius: 22px 22px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); position: relative;
  }
  html.cv-ch body .who-online-panel::before {
    content: ''; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px;
    border-radius: 999px; background: var(--ch-line);
  }
  html.cv-ch body .who-online-head { padding-top: 20px; }
  html.cv-ch body .who-online-tabs { margin: 0 14px 6px; }
  html.cv-ch body .who-row { flex-wrap: nowrap; }
  html.cv-ch body .who-ip { width: auto; margin: 0; font-size: 11px; padding: 4px 8px; }
  html.cv-ch body .who-online-counts .who-online-breakdown { display: none; }
  /* Phones: Reply goes back next to the "…" menu, reactions back in the flow. */
  html.cv-ch body .post-content { padding-bottom: 0; }
  html.cv-ch body .post-header-compact .post-actions { position: relative; }
  html.cv-ch body .post-header-compact .post-actions .reply-btn { position: static; }
  html.cv-ch body .post-header-compact .post-actions .dropdown-menu { top: 100%; right: 0; }
  html.cv-ch body .post-reactions { position: static; padding: 4px 16px 14px; }
  html.cv-ch body .feed-header .ch-topic-search { order: 3; width: 100%; margin: 0; }
  html.cv-ch body .ch-search { min-width: 0; }
  html.cv-ch body .quick-reply .btn-primary { width: 100%; }
}

/* --------------------------------------------------------------------------
   Topic page, phone: full-width posts and a compact author header
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  html.cv-ch body .topic-container { padding-left: 0; padding-right: 0; }
  html.cv-ch body .post-card { margin-bottom: 12px; }
  html.cv-ch body .post-sidebar {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: center;
    padding: 12px 14px;
  }
  html.cv-ch body .post-sidebar > * { grid-column: 2; min-width: 0; margin: 0; }
  html.cv-ch body .post-sidebar > .user-avatar { grid-column: 1; grid-row: 1 / span 4; align-self: start; }
  html.cv-ch body .post-sidebar .user-avatar img { width: 44px; height: 44px; }
  html.cv-ch body .post-sidebar .username { display: flex; align-items: center; gap: 6px; font-size: 15px; }
  /* The plain role line repeats the first role badge; keep just the badges */
  html.cv-ch body .post-sidebar:has(.user-role-badges .role-badge) .user-role { display: none; }
  html.cv-ch body .post-sidebar .user-role { justify-self: start; }
  html.cv-ch body .post-sidebar .user-role-badges { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  html.cv-ch body .post-sidebar .user-role-badges::-webkit-scrollbar { display: none; }
  html.cv-ch body .post-sidebar .user-role-badges .role-badge { flex: none; margin: 0 !important; font-size: 10.5px !important; padding: 1px 8px !important; }
  html.cv-ch body .post-sidebar .user-status-row { justify-self: start; max-width: 100%; }
  html.cv-ch body .post-sidebar .user-status-pill { max-width: 100%; }
  html.cv-ch body .post-sidebar .user-stats { gap: 12px; font-size: 11.5px; }
  html.cv-ch body .post-header-compact { margin: 0 14px; padding: 10px 0; }
  html.cv-ch body .post-body { padding: 12px 14px 4px; }
  /* The outline sits after every reply on a phone, where it can't help; the stats card stays */
  html.cv-ch body .ch-topic-side .ch-toc { display: none; }
}

/* --------------------------------------------------------------------------
   Other forum pages, phone
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  /* Pages that wrap their content in a second .app-container got the side
     padding twice (search, product, privacy, terms...). */
  html.cv-ch body .app-container .app-container { padding-left: 0; padding-right: 0; }
  html.cv-ch body .app-container .app-container > .card { padding: 20px 16px; }
  /* Sign in / sign up */
  html.cv-ch body .auth-wrapper { padding-left: 0; padding-right: 0; }
  html.cv-ch body .auth-card { padding: 24px 18px; }
  /* Forum filter bar: label above value so long options aren't cut off;
     search and "new topic" each get their own row */
  html.cv-ch body .fvBar__filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html.cv-ch body .fvSelect { flex-direction: column; align-items: stretch; justify-content: center; gap: 0; height: auto; min-height: 50px; padding: 6px 14px; border-radius: 14px; }
  html.cv-ch body .fvSelect__label { font-size: 11px; line-height: 1.3; }
  html.cv-ch body .fvSelect select { height: auto; padding: 1px 0 2px; text-overflow: ellipsis; }
  html.cv-ch body .ch-bar-right { flex-wrap: wrap; }
  html.cv-ch body .ch-bar-right .ch-search { flex: 1 1 100%; }
  html.cv-ch body .ch-bar-right .ch-cta { flex: 1 1 100%; justify-content: center; }
}

/* --------------------------------------------------------------------------
   Sign in / sign up (both themes)
   -------------------------------------------------------------------------- */
html.cv-ch body .auth-card {
  background: var(--ch-card); border: 1px solid var(--ch-line); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(20, 16, 40, 0.05), 0 18px 40px -20px rgba(20, 16, 40, 0.25);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
html.cv-ch[data-theme="dark"] body .auth-card { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7); }
html.cv-ch body .auth-title { color: var(--ch-text); }
html.cv-ch body .auth-subtitle { color: var(--ch-muted); }
html.cv-ch body .auth-form label { color: var(--ch-text); }
html.cv-ch body .auth-form .form-control {
  height: 46px; background: var(--ch-card-2); border: 1px solid var(--ch-line); color: var(--ch-text);
}
html.cv-ch body .auth-form .form-control::placeholder { color: var(--ch-faint, var(--ch-muted)); }
html.cv-ch body .auth-form .form-control:focus { border-color: var(--ch-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ch-accent) 20%, transparent); }
/* Browser autofill paints inputs light blue; keep them on-theme */
html.cv-ch body .auth-form .form-control:-webkit-autofill,
html.cv-ch body .auth-form .form-control:-webkit-autofill:hover,
html.cv-ch body .auth-form .form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ch-text);
  -webkit-box-shadow: 0 0 0 40px var(--ch-card-2) inset;
  caret-color: var(--ch-text);
  transition: background-color 9999s ease-out;
}
html.cv-ch body .auth-links--stack { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-top: 18px; }
html.cv-ch body .auth-forgot { align-self: center; font-size: 14px; font-weight: 600; color: var(--ch-accent); text-decoration: none; }
html.cv-ch body .auth-forgot:hover { text-decoration: underline; }
html.cv-ch body .auth-alt {
  display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 999px;
  border: 1px solid var(--ch-line); background: transparent; color: var(--ch-text); font-weight: 600; text-decoration: none;
  transition: border-color .15s, background .15s;
}
html.cv-ch body .auth-alt:hover { border-color: var(--ch-accent); background: var(--ch-card-2); text-decoration: none; }
html.cv-ch body .auth-links:not(.auth-links--stack) { color: var(--ch-muted); font-size: 14px; }
html.cv-ch body .auth-links:not(.auth-links--stack) a { color: var(--ch-accent); font-weight: 600; }
html.cv-ch body .auth-legal a { color: var(--ch-muted) !important; }
html.cv-ch body .auth-legal a:hover { color: var(--ch-accent) !important; }

/* --------------------------------------------------------------------------
   Post author card: AI assistant accounts + tidier stats
   -------------------------------------------------------------------------- */
html.cv-ch body .post-sidebar .user-stats .v { white-space: nowrap; }
html.cv-ch body .post-sidebar .user-stats:empty { display: none; }
html.cv-ch body .post-sidebar.is-bot .user-avatar img {
  box-shadow: 0 0 0 2px var(--ch-card), 0 0 0 4px #7c5cff, 0 6px 20px -6px rgba(124, 92, 255, 0.7);
}
html.cv-ch body .post-sidebar .bot-role {
  display: inline-flex; align-items: center; gap: 6px; align-self: center; width: auto; max-width: 100%; text-align: center; line-height: 1.25; margin-top: 2px; padding: 4px 11px; border-radius: 999px;
  font: 700 11.5px/1.2 var(--font-ui); color: #fff; background: linear-gradient(135deg, #7c5cff, #38bdf8);
}
html.cv-ch body .post-sidebar .bot-role i { font-size: 11px; }
html.cv-ch body .post-sidebar .bot-note { margin: 4px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--ch-muted); text-align: center; }
@media (max-width: 640px) {
  html.cv-ch body .post-sidebar .bot-role { justify-self: start; }
  html.cv-ch body .post-sidebar .bot-note { text-align: left; }
}

/* --------------------------------------------------------------------------
   Profile header: joined / last visit / currently, as one tidy row
   -------------------------------------------------------------------------- */
html.cv-ch body .ipb-facts { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
html.cv-ch body .ipb-facts li {
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%;
  padding: 7px 14px 7px 7px; border-radius: 999px; background: var(--ch-card-2); border: 1px solid var(--ch-line);
}
html.cv-ch body .ipb-facts li > span:last-child { display: flex; flex-direction: column; min-width: 0; text-align: left; }
html.cv-ch body .ipb-facts__icon {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ch-accent-soft); color: var(--ch-accent); font-size: 13px; position: relative;
}
html.cv-ch body .ipb-facts__icon.is-online { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
html.cv-ch body .ipb-facts__icon.is-online::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 2px var(--ch-card-2);
}
html.cv-ch body .ipb-facts .meta-label { font: 700 10px/1.3 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ch-muted); }
html.cv-ch body .ipb-facts .meta-value { font: 700 13.5px/1.35 var(--font-ui); color: var(--ch-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  html.cv-ch body .ipb-facts { justify-content: center; }
}
/* Facts get their own full-width line under the name + buttons */
html.cv-ch body .ipb-header-content { flex-wrap: wrap; }
html.cv-ch body .ipb-header-content > .ipb-facts { flex: 1 0 100%; margin: -8px 0 0 calc(136px + 22px); }
@media (max-width: 640px) {
  html.cv-ch body .ipb-header-content > .ipb-facts { margin: 0; order: 2; }
  html.cv-ch body .ipb-header-content > .ipb-header-actions { order: 3; }
}

/* Profile name row: online dot + coloured role badges */
html.cv-ch body .ipb-user-name-row h1 { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
html.cv-ch body .ipb-online {
  flex: none; width: 12px; height: 12px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 25%, transparent);
  animation: ipbOnlinePulse 2.4s ease-in-out infinite;
}
@keyframes ipbOnlinePulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #22c55e 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { html.cv-ch body .ipb-online { animation: none; } }
html.cv-ch body .ipb-roles { display: inline-flex; flex-wrap: wrap; gap: 6px; }
html.cv-ch body .ipb-role {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font: 700 12px/1 var(--font-ui); color: color-mix(in srgb, var(--role) 78%, var(--ch-text));
  background: color-mix(in srgb, var(--role) 14%, transparent); border: 1px solid color-mix(in srgb, var(--role) 38%, transparent);
}
html.cv-ch body .ipb-role::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--role); }
@media (max-width: 640px) { html.cv-ch body .ipb-roles { justify-content: center; } }

/* --------------------------------------------------------------------------
   Topic header, phone: compact, left-aligned, tidy staff tools
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  html.cv-ch body .topic-header { align-items: stretch; text-align: left; padding: 18px 16px 16px; margin-bottom: 14px; }
  html.cv-ch body .topic-header h1 { text-align: left; font-size: 22px; line-height: 1.25; margin: 0 0 10px; }
  html.cv-ch body .ch-topic-author { justify-content: flex-start; gap: 4px 6px; font-size: 13px; }
  html.cv-ch body .ch-topic-author .ch-av img { width: 24px; height: 24px; }
  /* Reading time on its own line instead of wrapping after a stray dot */
  html.cv-ch body .ch-topic-author .ch-dot:has(+ span[title]) { display: none; }
  html.cv-ch body .ch-topic-author > span[title] { flex-basis: 100%; padding-left: 30px; margin-top: -2px; font-size: 12.5px; }
  html.cv-ch body .topic-header .topic-meta {
    justify-content: flex-start; gap: 6px 14px; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--ch-line-soft, var(--ch-line)); font-size: 13px;
  }
  html.cv-ch body .topic-header .topic-meta .topic-stat { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
  html.cv-ch body .topic-header .topic-follow-btn { margin-left: auto; height: 32px; padding: 0 12px; font-size: 12.5px; }
  html.cv-ch body .topic-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ch-line-soft, var(--ch-line));
  }
  html.cv-ch body .topic-actions form { display: contents; }
  html.cv-ch body .topic-actions .btn-small {
    width: 100%; height: 38px; justify-content: center; gap: 7px; padding: 0 8px;
    font-size: 13px; border-radius: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html.cv-ch body .topic-actions .btn-small.danger { border-color: color-mix(in srgb, #ef4444 40%, transparent); background: color-mix(in srgb, #ef4444 8%, transparent); }
}

/* Recent activity: topics + comments */
html.cv-ch body .ch-activity__av { position: relative; flex: none; }
html.cv-ch body .ch-activity__kind {
  position: absolute; right: -4px; bottom: -4px; width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; font-size: 8.5px; color: #fff; box-shadow: 0 0 0 2px var(--ch-card);
}
html.cv-ch body .ch-activity__kind.is-topic { background: var(--ch-accent); }
html.cv-ch body .ch-activity__kind.is-comment { background: #0ea5e9; }
html.cv-ch body .ch-activity__who { font-size: 12.5px; color: var(--ch-muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.cv-ch body .ch-activity__who b { color: var(--ch-text); font-weight: 700; }
html.cv-ch body .ch-activity__snippet {
  display: block; margin-top: 4px; padding: 5px 9px; border-radius: 8px; background: var(--ch-card-2); border-left: 2px solid #0ea5e9;
  font-size: 12.5px; line-height: 1.4; color: var(--ch-muted); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html.cv-ch body .ch-activity__snippet:hover { color: var(--ch-text); }

/* Recent activity v2: timeline */
html.cv-ch body .ch-activity__head { display: flex; align-items: center; gap: 8px; }
html.cv-ch body .ch-activity__live { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); animation: chActLive 2.4s ease-out infinite; }
@keyframes chActLive { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }
@media (prefers-reduced-motion: reduce) { html.cv-ch body .ch-activity__live { animation: none; } }
html.cv-ch body .ch-activity__list { gap: 2px; margin: 0 -8px; }
html.cv-ch body .ch-activity__item { position: relative; gap: 12px; padding: 8px; border-radius: 12px; transition: background .15s ease; }
html.cv-ch body .ch-activity__item:hover { background: var(--ch-card-2); }
/* line joining the avatars */
html.cv-ch body .ch-activity__item:not(:last-child)::before {
  content: ""; position: absolute; left: 24px; top: 46px; bottom: -6px; width: 2px; border-radius: 2px; background: var(--ch-line);
}
html.cv-ch body .ch-activity__av img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 2px var(--ch-card); }
html.cv-ch body .ch-activity__item .ch-activity__kind { width: 18px; height: 18px; right: -5px; bottom: -3px; font-size: 8.5px; }
html.cv-ch body .ch-activity__item.is-topic .ch-activity__kind { background: var(--ch-accent); }
html.cv-ch body .ch-activity__item.is-comment .ch-activity__kind { background: #0ea5e9; }
html.cv-ch body .ch-activity__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; color: inherit; text-decoration: none !important; }
html.cv-ch body .ch-activity__who { font-size: 12px; color: var(--ch-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.cv-ch body .ch-activity__who b { color: var(--ch-text); font-weight: 700; }
html.cv-ch body .ch-activity__body .ch-activity__title {
  font: 700 14px/1.3 var(--font-ui); color: var(--ch-text); white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
html.cv-ch body .ch-activity__item:hover .ch-activity__title { color: var(--ch-accent); }
html.cv-ch body .ch-activity__body .ch-activity__snippet {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal;
  margin: 2px 0 1px; padding: 6px 10px 0; border-bottom: 6px solid transparent; border-radius: 10px; border-left: 0;
  background: color-mix(in srgb, #0ea5e9 8%, var(--ch-card-2)); color: var(--ch-muted); font-size: 12.5px; line-height: 1.45;
}
html.cv-ch body .ch-activity__meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 11.5px; color: var(--ch-muted); min-width: 0; }
html.cv-ch body .ch-activity__cat {
  min-width: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; font-weight: 600; color: var(--ch-accent); background: color-mix(in srgb, var(--ch-accent) 12%, transparent);
}
html.cv-ch body .ch-activity__time { white-space: nowrap; }

/* Forum home stats: newest member card */
html.cv-ch body a.ch-stat--member { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
html.cv-ch body a.ch-stat--member:hover { border-color: #f59e0b; transform: translateY(-1px); }
html.cv-ch body .ch-stat--member strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 1.6; }
html.cv-ch body .ch-stat__av { position: relative; width: 32px; height: 32px; margin-bottom: 6px; }
html.cv-ch body .ch-stat__av img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 2px var(--ch-card), 0 0 0 4px rgba(245, 158, 11, .55); }
html.cv-ch body .ch-stat__av i { position: absolute; right: -6px; top: -6px; font-size: 11px; color: #f59e0b; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
@media (max-width: 640px) {
  html.cv-ch body .ch-stats > .ch-stat--member { grid-column: 1 / -1; }
}
