/* ===========================================================
   TRIVLA Ã¢â‚¬â€ Community forum + Bot page styles
   Builds on tokens.css + website.css
   =========================================================== */

:root { --teal-deep: #063b31; --teal-deep2: #052a23; --mono-green: #46e3b4; }

.nav__links a.active { color: var(--green-700); background: var(--green-50); }

/* =====================================================================
   COMMUNITY HEADER
   ===================================================================== */
.chead { position: relative; padding: 56px 0 40px; overflow: hidden;
  border-bottom: 1px solid var(--line); }
.chead__glow { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(720px 380px at 18% -20%, rgba(6,191,140,0.13), transparent 68%),
    radial-gradient(620px 360px at 92% 0%, rgba(43,214,168,0.10), transparent 70%); }
.chead__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.chead .nw-eyebrow { margin-bottom: 14px; }
.chead h1 { font-size: clamp(34px, 4.4vw, 54px); line-height: 1.03; color: var(--ink-900); letter-spacing: -0.03em; }
.chead h1 .accent { color: var(--green-600); }
.chead__sub { margin-top: 16px; font-size: 18px; line-height: 1.55; color: var(--ink-500); max-width: 32em; }
.chead__cta { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }

/* search + stats */
.csearchrow { margin-top: 30px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.csearch { flex: 1; min-width: 280px; display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 13px 20px; box-shadow: var(--sh-sm); color: var(--ink-400); }
.csearch input { border: none; outline: none; flex: 1; font-family: var(--font-ui); font-size: 15px;
  color: var(--ink-900); background: transparent; }
.csearch input::placeholder { color: var(--ink-400); }
.csearch .k { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; }
.cstats { display: flex; gap: 26px; }
.cstat { text-align: center; }
.cstat__v { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--ink-900); line-height: 1; }
.cstat__v .u { color: var(--green-600); }
.cstat__l { margin-top: 5px; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-400); }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.clayout { display: grid; grid-template-columns: 1fr 324px; gap: 44px; align-items: start;
  padding: 44px 0 88px; }
.csec__hd { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.csec__hd h2 { font-size: 22px; color: var(--ink-900); }
.csec__hd a { font-size: 13.5px; font-weight: 700; color: var(--green-700); display: inline-flex; align-items: center; gap: 6px; }

/* ---- category grid ---- */
.ccats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ccat { display: flex; gap: 15px; padding: 20px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.ccat:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--green-200); }
.ccat__ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.ccat__name { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; color: var(--ink-900);
  display: flex; align-items: center; gap: 8px; }
.ccat__desc { margin-top: 5px; font-size: 13px; line-height: 1.5; color: var(--ink-500); }
.ccat__meta { margin-top: 11px; display: flex; gap: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); }
.ccat__meta b { color: var(--ink-700); font-weight: 600; }
.ccat__new { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--green-700); background: var(--green-50);
  border: 1px solid var(--green-100); padding: 2px 7px; border-radius: var(--r-pill); }

/* ---- discussions feed ---- */
.cfeed { margin-top: 46px; }
.cfeed__tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-softer);
  border: 1px solid var(--line); border-radius: var(--r-pill); }
.cfeed__tabs button { border: none; background: transparent; font-family: var(--font-ui); font-weight: 700;
  font-size: 13px; color: var(--ink-500); padding: 8px 16px; border-radius: var(--r-pill); transition: .15s; }
.cfeed__tabs button.on { background: #fff; color: var(--ink-900); box-shadow: var(--sh-sm); }

.threads { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff; }
.thread { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft); transition: background .15s; align-items: center; }
.thread:last-child { border-bottom: none; }
.thread:hover { background: var(--bg-soft); }
.thread__votes { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 50px;
  padding: 6px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); }
.thread__votes .n { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink-900); line-height: 1; }
.thread__votes .l { font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-400); }
.thread__votes.solved { background: var(--green-50); border-color: var(--green-200); }
.thread__votes.solved .n { color: var(--green-700); }
.thread__main { min-width: 0; }
.thread__title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-900);
  line-height: 1.3; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.thread:hover .thread__title { color: var(--green-700); }
.thread__title .solvedflag { font-family: var(--font-ui); font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-200);
  padding: 2px 9px 2px 7px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 4px; }
.thread__excerpt { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--ink-500);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.thread__meta { margin-top: 11px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-400); }
.thread__tag { font-family: var(--font-mono); font-size: 11px; font-weight: 500; padding: 3px 9px;
  border-radius: var(--r-pill); }
.tg-traffic { background: var(--green-50); color: var(--green-700); }
.tg-security { background: var(--critical-soft); color: #b91c1c; }
.tg-firewall { background: var(--info-soft); color: #1d4ed8; }
.tg-voip { background: var(--voip-soft); color: #6d28d9; }
.tg-deploy { background: #fff7ed; color: #c2410c; }
.tg-api { background: var(--bg-softer); color: var(--ink-700); }
.thread__by { display: inline-flex; align-items: center; gap: 7px; }
.thread__side { display: flex; align-items: center; gap: 22px; white-space: nowrap; }
.thread__stat { text-align: center; }
.thread__stat .n { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-800); line-height: 1; }
.thread__stat .l { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-400); margin-top: 3px; }
.thread__last { display: flex; align-items: center; gap: 9px; min-width: 132px; }
.thread__last .t { font-size: 11.5px; color: var(--ink-400); line-height: 1.3; }
.thread__last .t b { display: block; color: var(--ink-700); font-weight: 600; font-size: 12.5px; }

/* avatars */
.av { border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.av--sm { width: 26px; height: 26px; font-size: 11px; }
.av--md { width: 34px; height: 34px; font-size: 13px; }
.av--lg { width: 42px; height: 42px; font-size: 15px; }
.av-g0 { background: linear-gradient(135deg, #06bf8c, #048462); }
.av-g1 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.av-g2 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.av-g3 { background: linear-gradient(135deg, #f59e0b, #c2410c); }
.av-g4 { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.av-g5 { background: linear-gradient(135deg, #14b8a6, #0f766e); }

/* =====================================================================
   SIDEBAR
   ===================================================================== */
.cside { position: sticky; top: 92px; display: grid; gap: 18px; }
.scard { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.scard h4 { font-family: var(--font-display); font-size: 15px; color: var(--ink-900);
  display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }

/* bot promo */
.botcard { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 26px 24px;
  background: linear-gradient(160deg, var(--teal-deep) 0%, var(--teal-deep2) 100%); color: #d6f3e9;
  box-shadow: var(--sh-lg); }
.botcard::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(360px 200px at 80% -10%, rgba(70,227,180,0.22), transparent 70%); }
.botcard__badge { position: relative; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mono-green); }
.botcard__badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mono-green);
  box-shadow: 0 0 0 4px rgba(70,227,180,0.2); }
.botcard__face { position: relative; width: 52px; height: 52px; border-radius: 15px; margin: 16px 0 14px;
  display: grid; place-items: center; background: rgba(70,227,180,0.16); border: 1px solid rgba(70,227,180,0.3); }
.botcard__face .dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--mono-green); }
.botcard__face .dot.l { left: 16px; top: 21px; } .botcard__face .dot.r { right: 16px; top: 21px; }
.botcard__face .mouth { position: absolute; bottom: 14px; width: 18px; height: 7px; border-radius: 0 0 9px 9px;
  border-bottom: 2px solid var(--mono-green); }
.botcard h3 { position: relative; font-size: 21px; color: #fff; line-height: 1.1; }
.botcard p { position: relative; margin-top: 9px; font-size: 13.5px; line-height: 1.55; color: rgba(255,255,255,0.74); }
.botcard__btn { position: relative; margin-top: 18px; display: inline-flex; align-items: center; gap: 10px;
  width: 100%; justify-content: center; font-family: var(--font-ui); font-weight: 700; font-size: 14.5px;
  background: var(--mono-green); color: #042b1d; border: none; border-radius: var(--r-pill); padding: 13px 18px;
  transition: transform .15s, box-shadow .2s; box-shadow: 0 10px 26px -10px rgba(70,227,180,0.6); }
.botcard__btn:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -10px rgba(70,227,180,0.7); }
.botcard__hint { position: relative; margin-top: 12px; font-family: var(--font-mono); font-size: 10.5px;
  color: rgba(255,255,255,0.5); text-align: center; }

/* contributors */
.contrib { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.contrib + .contrib { border-top: 1px solid var(--line-soft); }
.contrib__name { font-weight: 700; font-size: 14px; color: var(--ink-900); }
.contrib__role { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-400); margin-top: 1px; }
.contrib__pts { margin-left: auto; text-align: right; }
.contrib__pts .n { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--green-700); line-height: 1; }
.contrib__pts .l { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-400); }
.contrib__rank { width: 22px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink-300); text-align: center; }

/* tags cloud */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font-family: var(--font-mono); font-size: 12px; color: var(--ink-600); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 11px; transition: .15s; }
.tags a:hover { border-color: var(--green-300); color: var(--green-700); background: var(--green-50); }
.tags a .c { color: var(--ink-400); margin-left: 5px; }

/* guidelines */
.guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.guide li { display: flex; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--ink-600); }
.guide .ck { flex: none; width: 19px; height: 19px; border-radius: 6px; background: var(--green-50);
  color: var(--green-600); display: grid; place-items: center; margin-top: 1px; }

/* floating bot button */
.fab { position: fixed; right: 26px; bottom: 26px; z-index: 60; display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 20px 13px 15px; border-radius: var(--r-pill); text-decoration: none;
  background: linear-gradient(160deg, var(--teal-deep), var(--teal-deep2)); color: #fff;
  box-shadow: 0 18px 40px -12px rgba(6,59,49,0.55), 0 0 0 1px rgba(70,227,180,0.18) inset;
  transition: transform .16s ease, box-shadow .2s ease; }
.fab:hover { transform: translateY(-2px); box-shadow: 0 24px 50px -14px rgba(6,59,49,0.6), 0 0 0 1px rgba(70,227,180,0.3) inset; }
.fab__face { width: 38px; height: 38px; border-radius: 11px; position: relative; flex: none;
  background: rgba(70,227,180,0.18); border: 1px solid rgba(70,227,180,0.32); display: grid; place-items: center; }
.fab__face .d { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--mono-green); top: 15px; }
.fab__face .d.l { left: 11px; } .fab__face .d.r { right: 11px; }
.fab__face .m { position: absolute; bottom: 10px; width: 13px; height: 5px; border-bottom: 1.6px solid var(--mono-green); border-radius: 0 0 7px 7px; }
.fab__face .ping { position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--mono-green); box-shadow: 0 0 0 0 rgba(70,227,180,0.6); animation: nodepulse 2s ease-out infinite; }
.fab__txt b { display: block; font-family: var(--font-display); font-size: 14.5px; font-weight: 700; line-height: 1.1; }
.fab__txt span { font-family: var(--font-mono); font-size: 10.5px; color: rgba(255,255,255,0.6); }

/* =====================================================================
   responsive
   ===================================================================== */
@media (max-width: 980px) {
  .clayout { grid-template-columns: 1fr; gap: 36px; }
  .cside { position: static; grid-template-columns: 1fr 1fr; display: grid; }
  .botcard { grid-column: 1 / -1; }
  .chead__row { flex-direction: column; align-items: flex-start; }
  .chead__cta { align-items: flex-start; flex-direction: row; }
}
@media (max-width: 620px) {
  .ccats { grid-template-columns: 1fr; }
  .cside { grid-template-columns: 1fr; }
  .thread { grid-template-columns: auto 1fr; }
  .thread__side { display: none; }
  .thread__votes { width: 44px; }
  .fab__txt { display: none; }
}

/* ===========================================================
   TRIVLA Ã¢â‚¬â€ Bot (AI assistant) chat page
   Builds on tokens.css + website.css + community.css (avatars)
   =========================================================== */

:root { --teal-deep: #063b31; --teal-deep2: #052a23; --mono-green: #46e3b4; }

.botapp { display: grid; grid-template-columns: 290px 1fr; height: calc(100vh - 73px);
  min-height: 560px; background: var(--bg-soft); }

/* =========================== SIDEBAR =========================== */
.botside { border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column;
  overflow-y: auto; }
.botside__id { padding: 22px 20px 18px; border-bottom: 1px solid var(--line-soft); }
.botbadge { display: flex; align-items: center; gap: 13px; }
.botbadge__face { width: 46px; height: 46px; border-radius: 14px; position: relative; flex: none;
  background: linear-gradient(160deg, var(--teal-deep), var(--teal-deep2));
  display: grid; place-items: center; box-shadow: var(--sh-sm); }
.botbadge__face .d { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--mono-green); top: 18px; }
.botbadge__face .d.l { left: 13px; } .botbadge__face .d.r { right: 13px; }
.botbadge__face .m { position: absolute; bottom: 12px; width: 16px; height: 6px;
  border-bottom: 2px solid var(--mono-green); border-radius: 0 0 8px 8px; }
.botbadge__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink-900); }
.botbadge__status { margin-top: 3px; font-family: var(--font-mono); font-size: 11px; color: var(--green-700);
  display: inline-flex; align-items: center; gap: 6px; }
.botbadge__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-100); }

.botnew { margin: 16px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-ui); font-weight: 700; font-size: 14px; color: var(--ink-800);
  border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 11px 18px; transition: .15s; background: #fff; }
.botnew:hover { border-color: var(--green-300); color: var(--green-700); background: var(--green-50); }

.botside__grp { padding: 6px 12px 14px; }
.botside__grp h6 { font-family: var(--font-ui); font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-400); margin: 12px 0 6px; padding-left: 12px; }
.botside__lnk { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; color: var(--ink-600); cursor: pointer; transition: .15s; width: 100%;
  text-align: left; border: none; background: transparent; }
.botside__lnk:hover { background: var(--bg-soft); color: var(--ink-900); }
.botside__lnk .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.botside__hist { display: block; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-500);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: .15s; }
.botside__hist:hover { background: var(--bg-soft); color: var(--ink-800); }

.botside__foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 11px; line-height: 1.6; color: var(--ink-400); }
.botside__foot a { color: var(--green-700); font-weight: 600; }

/* =========================== CHAT =========================== */
.botchat { display: flex; flex-direction: column; min-width: 0; position: relative; }
.botchat__bar { display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.85); backdrop-filter: blur(10px); }
.botchat__bar .t { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink-900); }
.botchat__bar .sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); margin-left: auto; }

.botscroll { flex: 1; overflow-y: auto; padding: 30px 0 24px; }
.botthread { width: min(760px, 92%); margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }

/* empty / welcome state */
.botwelcome { text-align: center; padding: 26px 0 8px; }
.botwelcome__face { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 22px; position: relative;
  background: linear-gradient(160deg, var(--teal-deep), var(--teal-deep2)); display: grid; place-items: center;
  box-shadow: var(--sh-lg); }
.botwelcome__face .d { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--mono-green); top: 30px; }
.botwelcome__face .d.l { left: 22px; } .botwelcome__face .d.r { right: 22px; }
.botwelcome__face .d.pulse { animation: blink 2.4s infinite; }
.botwelcome__face .m { position: absolute; bottom: 19px; width: 26px; height: 11px;
  border-bottom: 3px solid var(--mono-green); border-radius: 0 0 13px 13px; }
.botwelcome h2 { font-size: 28px; color: var(--ink-900); line-height: 1.1; }
.botwelcome p { margin: 12px auto 0; font-size: 16px; line-height: 1.55; color: var(--ink-500); max-width: 30em; }

.botchips { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.botchip { display: flex; align-items: flex-start; gap: 12px; padding: 15px 16px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer; transition: .16s; }
.botchip:hover { border-color: var(--green-300); box-shadow: var(--sh-sm); transform: translateY(-2px); }
.botchip .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.botchip .q { font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--ink-800); }

/* messages */
.msg { display: flex; gap: 14px; }
.msg__av { flex: none; }
.msg__face { width: 36px; height: 36px; border-radius: 11px; position: relative;
  background: linear-gradient(160deg, var(--teal-deep), var(--teal-deep2)); display: grid; place-items: center; }
.msg__face .d { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--mono-green); top: 14px; }
.msg__face .d.l { left: 10px; } .msg__face .d.r { right: 10px; }
.msg__face .m { position: absolute; bottom: 9px; width: 12px; height: 5px; border-bottom: 1.6px solid var(--mono-green); border-radius: 0 0 7px 7px; }
.msg__body { min-width: 0; flex: 1; }
.msg__who { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--ink-900); margin-bottom: 7px; }
.msg__bubble { font-size: 15px; line-height: 1.62; color: var(--ink-700); }
.msg__bubble p { margin: 0; }
.msg__bubble p + p { margin-top: 12px; }
.msg__bubble strong { color: var(--ink-900); font-weight: 700; }
.msg__bubble code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-softer);
  border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 6px; color: var(--green-800); }
.msg__bubble ul, .msg__bubble ol { margin: 12px 0 0; padding-left: 0; list-style: none; display: grid; gap: 9px; }
.msg__bubble ul li { display: flex; gap: 11px; font-size: 14.5px; line-height: 1.5; color: var(--ink-700); }
.msg__bubble ul li .ck { flex: none; width: 20px; height: 20px; border-radius: 6px; margin-top: 1px;
  background: var(--green-50); color: var(--green-600); display: grid; place-items: center; }
.msg__bubble ol { counter-reset: s; }
.msg__bubble ol li { display: flex; gap: 12px; font-size: 14.5px; line-height: 1.5; color: var(--ink-700); counter-increment: s; }
.msg__bubble ol li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink-900); color: #fff; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  display: grid; place-items: center; margin-top: 1px; }

.codeblk { margin-top: 14px; background: var(--ink-950); border: 1px solid var(--ink-800); border-radius: var(--r-md); overflow: hidden; }
.codeblk__bar { display: flex; align-items: center; padding: 9px 13px; border-bottom: 1px solid rgba(255,255,255,0.07);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); }
.codeblk pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px;
  line-height: 1.7; color: #cdd7e3; white-space: pre; }
.codeblk .pr { color: var(--mono-green); } .codeblk .fl { color: #7cc3ff; } .codeblk .st { color: #f0b072; } .codeblk .cm { color: #5f7385; font-style: italic; }

.msg__sources { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.msg__sources .lbl { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-400); margin-bottom: 9px; }
.msg__srclist { display: flex; flex-wrap: wrap; gap: 8px; }
.msg__src { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--green-700);
  background: var(--green-50); border: 1px solid var(--green-100); border-radius: var(--r-pill); padding: 5px 12px; transition: .15s; }
.msg__src:hover { background: var(--green-100); }
.msg__fb { margin-top: 14px; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-400); }
.msg__fb button { font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-500); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 12px; display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.msg__fb button:hover { border-color: var(--green-300); color: var(--green-700); }
.msg__fb button.on { border-color: var(--green-400); color: var(--green-700); background: var(--green-50); }

/* user message */
.msg--user { justify-content: flex-end; }
.msg--user .msg__body { flex: 0 1 auto; max-width: 76%; }
.msg--user .msg__bubble { background: var(--green-500); color: #042b1d; padding: 13px 17px; border-radius: 16px 16px 4px 16px;
  font-weight: 500; box-shadow: var(--sh-sm); }
.msg--user .msg__av { order: 2; }
.msg--user .msg__uav { width: 36px; height: 36px; }

/* typing */
.typing { display: inline-flex; gap: 5px; padding: 14px 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px 16px 16px 4px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); animation: typedot 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .18s; } .typing i:nth-child(3) { animation-delay: .36s; }
@keyframes typedot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* composer */
.botcomposer { border-top: 1px solid var(--line); background: rgba(255,255,255,0.9); backdrop-filter: blur(10px);
  padding: 16px 0 18px; }
.botcomposer__in { width: min(760px, 92%); margin: 0 auto; }
.botform { display: flex; align-items: flex-end; gap: 12px; background: #fff; border: 1.5px solid var(--line);
  border-radius: var(--r-xl); padding: 8px 8px 8px 18px; box-shadow: var(--sh-sm); transition: border-color .15s; }
.botform:focus-within { border-color: var(--green-400); box-shadow: var(--sh-glow); }
.botform textarea { flex: 1; border: none; outline: none; resize: none; font-family: var(--font-ui); font-size: 15px;
  line-height: 1.5; color: var(--ink-900); background: transparent; padding: 9px 0; max-height: 140px; }
.botform textarea::placeholder { color: var(--ink-400); }
.botsend { width: 42px; height: 42px; border-radius: 50%; border: none; flex: none; display: grid; place-items: center;
  background: var(--green-500); color: #042b1d; box-shadow: var(--sh-glow); transition: .15s; }
.botsend:hover { background: var(--green-400); }
.botsend:disabled { background: var(--ink-200); color: var(--ink-400); box-shadow: none; cursor: not-allowed; }
.botcomposer__note { width: min(760px, 92%); margin: 10px auto 0; text-align: center; font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-400); }

/* quick replies under last answer */
.quickrow { width: min(760px, 92%); margin: 4px auto 0; display: flex; flex-wrap: wrap; gap: 8px; padding-left: 50px; }
.quickrow button { font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--ink-600);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 13px; transition: .15s; }
.quickrow button:hover { border-color: var(--green-300); color: var(--green-700); background: var(--green-50); }

@media (max-width: 860px) {
  .botapp { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .botside { display: none; }
  .botscroll { min-height: 60vh; }
  .botchips { grid-template-columns: 1fr; }
}


/* ---- loaders, modals, topic detail, pager ---- */
.community-page .nav__login.is-hidden { display: none; }
#community-feed { scroll-margin-top: 88px; }
#topic-start { scroll-margin-top: 88px; }
#community-threads-loading[hidden] { display: none !important; }
.nav__logout {
  font-size: 13px; font-weight: 700; color: var(--ink-600);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 8px 14px; background: #fff; transition: .15s;
}
.nav__logout:hover { border-color: var(--green-300); color: var(--green-700); background: var(--green-50); }
.cauth { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cauth__user {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-700);
  padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: var(--r-pill); background: #fff;
}
.cauth__out {
  font-size: 13px; font-weight: 700; color: var(--ink-600); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 9px 14px; cursor: pointer; transition: .15s;
}
.cauth__out:hover { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.cauth__in { font-size: 13px; font-weight: 700; color: var(--green-700); }
.cauth__in:hover { text-decoration: underline; }

.community-loader {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.78); backdrop-filter: blur(5px);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility .2s;
}
.community-loader--on { opacity: 1; visibility: visible; pointer-events: auto; }
.community-loader__card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 28px 32px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-md);
}
.community-loader__ring {
  width: 40px; height: 40px; border: 3px solid var(--green-100); border-top-color: var(--green-500);
  border-radius: 50%; animation: community-spin .75s linear infinite;
}
.community-loader__label { font-size: 14px; font-weight: 600; color: var(--ink-600); }
@keyframes community-spin { to { transform: rotate(360deg); } }

.threads-loading {
  min-height: 220px; display: grid; place-items: center; padding: 48px 24px;
  border: 1px dashed var(--line); border-radius: var(--r-lg); background: #fff;
}
.threads-loading__inner { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink-500); font-size: 14px; }

.cpager { margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cpager__nums { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cpager__num {
  display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px;
  border-radius: var(--r-sm); font-size: 14px; font-weight: 700; color: var(--ink-600); border: 1px solid transparent;
}
.cpager__num:hover { background: var(--bg-soft); color: var(--ink-900); }
.cpager__num.on { background: var(--green-50); color: var(--green-800); border-color: rgba(16,185,129,.25); }
.cpager__gap { color: var(--ink-400); padding: 0 4px; }

.community-modal-backdrop {
  position: fixed; inset: 0; z-index: 250; background: rgba(15,23,42,.45);
  display: grid; place-items: center; padding: 24px;
}
.community-modal-backdrop[hidden] { display: none; }
.community-modal { width: min(560px,100%); background: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-lg); }
.community-modal__sub { font-size: 13px; color: var(--ink-500); margin-bottom: 16px; }
.community-modal label { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-700); }
.community-modal input, .community-modal select, .community-modal textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; font-family: inherit;
}
.community-modal__actions { margin-top: 16px; display: flex; gap: 10px; }
.community-form-error { margin-top: 10px; color: #b91c1c; font-size: 13px; }
.community-banner--err { padding: 16px 18px; border-radius: var(--r-sm); background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; margin-bottom: 16px; }

.tpost { padding: 44px 0 88px; }
.tpost__op { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; margin-bottom: 16px; }
.tpost__body { font-size: 15px; line-height: 1.65; color: var(--ink-700); word-break: break-word; }
.tpost__reply { padding: 18px 20px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: #fff; margin-bottom: 10px; }
.tpost__reply-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13px; color: var(--ink-500); }
.tpost__locked { padding: 16px; background: var(--bg-soft); border-radius: var(--r-md); color: var(--ink-500); font-size: 14px; margin-top: 20px; }
.tpost__form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); font-family: inherit; min-height: 120px; }
.tpost__form-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }

.thread { text-decoration: none; color: inherit; cursor: pointer; }
.thread__title .pinflag { font-family: var(--font-ui); font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-200);
  padding: 2px 9px; border-radius: var(--r-pill); }
.thread__title .roflag { font-family: var(--font-ui); font-size: 10.5px; font-weight: 700;
  color: var(--ink-500); background: var(--bg-soft); border: 1px solid var(--line); padding: 2px 9px; border-radius: var(--r-pill); }
.pinflag { font-family: var(--font-ui); font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-200);
  padding: 2px 9px; border-radius: var(--r-pill); display: inline-block; }
.roflag { font-family: var(--font-ui); font-size: 10.5px; font-weight: 700;
  color: var(--ink-500); background: var(--bg-soft); border: 1px solid var(--line); padding: 2px 9px; border-radius: var(--r-pill); display: inline-block; }

.ccat { text-decoration: none; color: inherit; }
.ccat.on { border-color: var(--green-400); box-shadow: var(--sh-glow); background: linear-gradient(180deg, var(--green-50) 0%, #fff 28%); }

.botpage .site > main { padding: 0; }
.botpage .foot { display: none; }