/* V90.2: chat temático en lugar de las tarjetas de tendencias/seguimiento.
   Aislado bajo #comunidad y #braisjoTopicChat. No cambia el resto del sitio. */
#comunidad .social-sidebar{align-content:start}
#comunidad .topic-chat-card{position:relative;overflow:hidden;border-radius:23px;border:1px solid rgba(101,181,248,.3);background:radial-gradient(circle at 95% 0%,rgba(44,156,238,.19),transparent 36%),linear-gradient(175deg,#0f3564 0%,#082346 40%,#061b37 100%);box-shadow:0 16px 38px rgba(0,0,0,.22);color:#f2f8ff;display:flex;flex-direction:column;min-height:590px;max-height:740px}
#comunidad .topic-chat-card:before{content:"";height:3px;position:absolute;top:0;left:0;right:0;background:linear-gradient(90deg,#f8d983 0%,#28ccef 45%,#4485fb 100%)}
#comunidad .topic-chat-heading{padding:21px 18px 15px;display:flex;gap:12px;align-items:flex-start;border-bottom:1px solid rgba(116,182,242,.13)}
#comunidad .topic-chat-icon{width:42px;height:42px;display:grid;place-items:center;flex:0 0 auto;border-radius:15px;background:linear-gradient(135deg,#ffdf84,#efb94d);font-size:21px;box-shadow:0 8px 17px rgba(234,176,59,.22)}
#comunidad .topic-chat-kicker{display:block;color:#ffd679;font-size:9px;letter-spacing:.1em;font-weight:900;line-height:1.5;margin:0 0 5px}
#comunidad .topic-chat-heading h4{font-size:23px;line-height:1.07;margin:0 0 5px;letter-spacing:-.025em;color:#fff}
#comunidad .topic-chat-heading p{font-size:11px;color:#c5d9ed;line-height:1.5;margin:0}
#comunidad .topic-chat-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:14px 14px 12px}
#comunidad .topic-chat-nav button{border-radius:999px;border:1px solid rgba(116,184,252,.24);background:#103c6b;color:#dfedfc;min-height:37px;padding:7px 10px;font-weight:850;font-size:11px;cursor:pointer;white-space:nowrap;transition:background .2s,transform .2s}
#comunidad .topic-chat-nav button:hover{background:#1b5589;transform:translateY(-1px)}
#comunidad .topic-chat-nav button.active{background:linear-gradient(135deg,#ffe49a,#f0be50);border-color:#f2ca69;color:#122642;box-shadow:0 7px 18px rgba(244,199,89,.16)}
#comunidad .topic-chat-room-title{padding:10px 16px 12px;display:flex;align-items:baseline;justify-content:space-between;gap:8px;border-top:1px solid rgba(109,182,245,.1);border-bottom:1px solid rgba(109,182,245,.13)}
#comunidad .topic-chat-room-title strong{font-size:12px;color:#eff7ff}
#comunidad .topic-chat-room-title span{font-size:10px;color:#a5c9df;white-space:nowrap}
#comunidad .topic-chat-stream{flex:1;min-height:175px;max-height:390px;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#2c5a8b transparent;scrollbar-width:thin;display:flex;flex-direction:column;gap:13px;padding:14px 15px}
#comunidad .topic-chat-empty{background:rgba(30,83,130,.24);border:1px dashed rgba(115,188,247,.22);padding:17px 12px;border-radius:15px;text-align:center;color:#c6dbed;font-size:12px;line-height:1.6;margin:auto 0}
#comunidad .topic-chat-message{display:flex;gap:8px;align-items:flex-start}
#comunidad .topic-chat-message.own{flex-direction:row-reverse}
#comunidad .topic-chat-msg-avatar{width:29px;height:29px;border-radius:50%;flex:0 0 auto;display:grid;place-items:center;background:linear-gradient(140deg,#1f9cd4,#3868cb);color:#fff;font-size:12px;font-weight:900;border:1px solid rgba(255,255,255,.17)}
#comunidad .topic-chat-message.own .topic-chat-msg-avatar{background:linear-gradient(140deg,#f9d77d,#dcb148);color:#08223e}
#comunidad .topic-chat-msg-body{min-width:0;max-width:calc(100% - 37px)}
#comunidad .topic-chat-msg-meta{display:flex;gap:5px;align-items:center;flex-wrap:wrap;font-size:10px;color:#bad4ee;margin-bottom:4px;overflow-wrap:anywhere}
#comunidad .topic-chat-message.own .topic-chat-msg-meta{justify-content:flex-end}
#comunidad .topic-chat-msg-meta strong{font-size:10px;color:#ecf5ff}
#comunidad .topic-chat-msg-meta time{opacity:.8}
#comunidad .topic-chat-msg-bubble{margin:0;font-size:12px;line-height:1.52;white-space:pre-wrap;overflow-wrap:anywhere;border:1px solid rgba(123,183,247,.24);border-radius:3px 13px 13px 13px;background:linear-gradient(145deg,#204e81,#163962);padding:10px 12px;color:#f5faff}
#comunidad .topic-chat-message.own .topic-chat-msg-bubble{background:linear-gradient(145deg,#b7863b,#926722);color:#fffdf5;border-color:rgba(255,209,110,.32);border-radius:13px 3px 13px 13px}
#comunidad .topic-chat-composer{padding:12px 13px 10px;background:rgba(4,21,43,.58);border-top:1px solid rgba(106,169,229,.17)}
#comunidad .topic-chat-composer textarea{width:100%;box-sizing:border-box;resize:vertical;min-height:68px;max-height:140px;outline:0;border:1px solid rgba(110,177,241,.28);border-radius:14px;background:#0a2b50;color:#f4f9ff;font-size:12px;padding:11px 12px;font-family:inherit;line-height:1.45}
#comunidad .topic-chat-composer textarea:focus{border-color:#ecca79;box-shadow:0 0 0 3px rgba(241,202,111,.13)}
#comunidad .topic-chat-composer textarea:disabled{opacity:.6;cursor:not-allowed}
#comunidad .topic-chat-composer textarea::placeholder{color:#9db9d9}
#comunidad .topic-chat-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px}
#comunidad .topic-chat-actions span{font-size:10px;line-height:1.4;color:#a7c1db;flex:1}
#comunidad .topic-chat-actions button{flex:0 0 auto;border:0;border-radius:11px;padding:10px 12px;min-width:80px;background:linear-gradient(135deg,#ffe18b,#edb949);color:#10243b;font-weight:900;font-size:11px;cursor:pointer}
#comunidad .topic-chat-actions button:disabled{cursor:not-allowed;opacity:.5;filter:grayscale(.3)}
#comunidad .topic-chat-login{margin:0 13px 10px;padding:11px 12px;width:calc(100% - 26px);border:1px solid rgba(237,195,93,.42);border-radius:12px;background:rgba(244,198,91,.12);color:#ffe4a0;font-weight:850;font-size:11px;cursor:pointer}
#comunidad .topic-chat-notice{font-size:10px;line-height:1.4;color:#9fc2dd;margin:0;padding:0 14px 14px}
#comunidad .topic-chat-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#comunidad #braisjoTopicChat [hidden]{display:none!important}
@media(max-width:1000px){#comunidad .topic-chat-card{min-height:480px;max-height:none}#comunidad .topic-chat-stream{max-height:320px}}
@media(prefers-reduced-motion:reduce){#comunidad .topic-chat-nav button{transition:none}}

/* V90.3: panel temático compacto al lado de Braisjo-Conversation.
   Solo presentación. Conserva IDs, botones, eventos y cliente Supabase existentes. */
@media (min-width:1001px){
  #comunidad .social-layout{grid-template-columns:minmax(0,1fr) minmax(285px,328px)!important;align-items:start}
  #comunidad .social-sidebar{display:flex!important;flex-direction:column!important;position:sticky;top:92px;gap:12px}
  #comunidad #braisjoTopicChat{order:-1;min-height:405px;max-height:480px;align-self:stretch}
  #comunidad .social-sidebar>.join-card{order:1}
}
#comunidad #braisjoTopicChat .topic-chat-heading{padding:14px 13px 11px;gap:9px}
#comunidad #braisjoTopicChat .topic-chat-icon{width:34px;height:34px;border-radius:12px;font-size:17px}
#comunidad #braisjoTopicChat .topic-chat-heading h4{font-size:19px}
#comunidad #braisjoTopicChat .topic-chat-heading p{font-size:10px}
#comunidad #braisjoTopicChat .topic-chat-kicker{font-size:8px;letter-spacing:.07em}
#comunidad #braisjoTopicChat .topic-chat-nav{padding:10px 11px 9px;gap:6px}
#comunidad #braisjoTopicChat .topic-chat-nav button{min-height:32px;padding:6px 7px;font-size:10px}
#comunidad #braisjoTopicChat .topic-chat-room-title{padding:8px 12px}
#comunidad #braisjoTopicChat .topic-chat-stream{min-height:125px;max-height:215px;padding:10px 12px;gap:9px}
#comunidad #braisjoTopicChat .topic-chat-composer{padding:9px 10px 8px}
#comunidad #braisjoTopicChat .topic-chat-composer textarea{min-height:50px;max-height:85px;padding:9px 10px}
#comunidad #braisjoTopicChat .topic-chat-actions{margin-top:5px}
#comunidad #braisjoTopicChat .topic-chat-actions button{padding:8px 10px;min-width:69px}
#comunidad #braisjoTopicChat .topic-chat-login{margin:0 10px 7px;width:calc(100% - 20px);padding:8px 10px}
#comunidad #braisjoTopicChat .topic-chat-notice{padding:0 11px 10px;font-size:9px}
@media(max-width:1000px){
  #comunidad .social-sidebar{display:flex!important;flex-direction:column!important;gap:12px}
  #comunidad #braisjoTopicChat{order:-1;min-height:380px;max-height:460px}
  #comunidad .social-sidebar>.join-card{order:1;grid-row:auto}
}
/* V90.4: only supplemental visual changes to the existing compact panel. */
#comunidad .topic-news-picker{padding:0 11px 9px;display:flex;flex-direction:column;gap:5px}
#comunidad .topic-news-picker label{font-size:10px;color:#cbdff3;font-weight:750}
#comunidad .topic-news-picker select{width:100%;background:#0d315b;color:#f5f9ff;border:1px solid rgba(120,185,243,.35);border-radius:10px;padding:8px;font:inherit;font-size:11px;min-width:0;text-overflow:ellipsis}
#comunidad .topic-chat-quoted{font-size:10px;line-height:1.4;color:#e4d5a6;border-left:2px solid #f0c65d;padding-left:7px;margin:3px 0 7px;overflow-wrap:anywhere}
#comunidad .topic-chat-reply{border:0;background:transparent;color:#a9d9ff;font-size:10px;cursor:pointer;padding:3px 0;margin-top:3px}
#comunidad .topic-chat-reply:hover{text-decoration:underline}
#comunidad .topic-reply-bar{display:flex;align-items:center;gap:5px;background:#173c62;padding:7px 11px;color:#ffe3a2;font-size:10px}
#comunidad .topic-reply-bar[hidden]{display:none!important}
#comunidad .topic-reply-bar span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#comunidad .topic-reply-bar button{border:0;background:transparent;color:#fff;cursor:pointer}
#comunidad .topic-open-news{border:1px solid rgba(42,113,183,.3);background:#10365c;color:#e9f4ff;border-radius:9px;padding:7px 9px;margin:8px 0;font-size:12px;cursor:pointer;font-weight:700}
#comunidad .topic-open-news:hover{background:#225b90}

/* V90.4.1 — Ajuste visual exclusivamente: más altura para que el botón Enviar sea visible.
   Mantiene intactos los identificadores, los eventos y las conexiones Supabase. */
@media (min-width:1001px){
  #comunidad #braisjoTopicChat{height:620px;min-height:620px;max-height:none}
  #comunidad #braisjoTopicChat .topic-chat-stream{flex:1 1 auto;min-height:130px;max-height:none;overflow-y:auto}
  #comunidad #braisjoTopicChat .topic-chat-composer{flex:0 0 auto}
  #comunidad #braisjoTopicChat .topic-chat-notice{flex:0 0 auto}
}
@media (max-width:1000px){
  #comunidad #braisjoTopicChat{min-height:590px;max-height:none}
  #comunidad #braisjoTopicChat .topic-chat-stream{min-height:175px;max-height:330px}
}

/* V90.5.1 — panel temático visible completo y contador repetido en la barra lateral.
   Solo CSS; no modifica eventos, mensajes ni conexión realtime. */
#comunidad .topic-chat-heading-copy{min-width:0;flex:1}
#comunidad .topic-visit-mini{display:inline-flex;align-items:center;gap:5px;margin-top:7px;padding:4px 8px;border:1px solid rgba(247,199,102,.3);border-radius:999px;background:rgba(247,199,102,.10);color:#f8da8f;font-size:10px;line-height:1.2}
#comunidad .topic-visit-mini strong{font-size:12px;font-variant-numeric:tabular-nums}
@media(min-width:1001px){
  #comunidad .social-sidebar{top:12px!important}
  #comunidad #braisjoTopicChat{height:min(540px,calc(100dvh - 94px));min-height:450px;max-height:none}
  #comunidad #braisjoTopicChat .topic-chat-stream{flex:1 1 auto;min-height:90px;max-height:none}
  #comunidad #braisjoTopicChat .topic-chat-composer,
  #comunidad #braisjoTopicChat .topic-chat-notice{flex-shrink:0}
}
@media(max-width:1000px){
  #comunidad #braisjoTopicChat{height:auto;min-height:0;max-height:none}
  #comunidad #braisjoTopicChat .topic-chat-stream{min-height:155px;max-height:260px}
}
