/* RCAD v289 — compositor universal limpio
   Una única estructura visual para usuarios conectados e invitados.
   Esta hoja sustituye las capas v285/v286/v288 del compositor. */

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 {
  display: grid !important;
  grid-template-columns: 140px minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: none !important;
  margin: 18px 0 20px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  overflow: visible !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  clear: both !important;
  float: none !important;
}

/* Columna de identidad */
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 > .rcad-native-reply-author-v285 {
  grid-column: 1 !important;
  grid-row: 1 !important;
  position: static !important;
  float: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  min-height: 250px !important;
  margin: 0 !important;
  padding: 18px 12px !important;
  background: #f6f8fb !important;
  border: 0 !important;
  border-right: 1px solid #d9e1ec !important;
  text-align: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 > .rcad-native-reply-author-v285 img {
  position: static !important;
  float: none !important;
  display: block !important;
  width: 84px !important;
  height: 84px !important;
  min-width: 84px !important;
  max-width: 84px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 3px solid #fff !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  box-shadow: 0 3px 11px rgba(18,37,72,.13) !important;
  transform: none !important;
}

body.single-topic #bbpress-forums .rcad-native-reply-name-v285 {
  display: block !important;
  width: 100% !important;
  max-width: 112px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  color: #071b46 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body.single-topic #bbpress-forums .rcad-native-reply-role-v285 {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  max-width: 112px !important;
  min-height: 22px !important;
  margin: 0 auto !important;
  padding: 3px 8px !important;
  border: 1px solid #f1b9c1 !important;
  border-radius: 3px !important;
  background: #fff5f6 !important;
  color: #c72c41 !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

/* Invitado: misma columna, solo cambia la identidad */
body.single-topic #bbpress-forums .rcad-native-reply-author-guest-v288 .rcad-native-reply-guest-avatar-v288 {
  position: static !important;
  float: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 84px !important;
  height: 84px !important;
  min-width: 84px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #e5e7eb !important;
  color: #7d8795 !important;
  font-size: 48px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

/* Zona de edición */
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 > form {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 10px !important;
  background: #fff !important;
  box-sizing: border-box !important;
  float: none !important;
  clear: none !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 fieldset.bbp-form {
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 fieldset.bbp-form > legend,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .bbp-template-notice {
  display: none !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .bbp-the-content-wrapper,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .wp-editor-wrap,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .wp-editor-container {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

/* Barra de herramientas */
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .quicktags-toolbar,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .mce-toolbar-grp,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .mce-top-part {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 5px 12px !important;
  border: 1px solid #cfd9e6 !important;
  border-bottom: 1px solid #d9e1ec !important;
  border-radius: 4px 4px 0 0 !important;
  background: #fff !important;
  color: #082a58 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .quicktags-toolbar input,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .quicktags-toolbar button {
  position: static !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 30px !important;
  height: 30px !important;
  margin: 0 2px 0 0 !important;
  padding: 0 6px !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: transparent !important;
  color: #082a58 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .quicktags-toolbar input:hover,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .quicktags-toolbar button:hover {
  background: #f2f6fb !important;
}

/* Área de escritura */
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 textarea#bbp_reply_content,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 textarea#rcadGuestReply288,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .wp-editor-area {
  position: static !important;
  float: none !important;
  display: block !important;
  width: 100% !important;
  min-height: 190px !important;
  margin: 0 !important;
  padding: 18px !important;
  border: 1px solid #cfd9e6 !important;
  border-top: 0 !important;
  border-radius: 0 0 4px 4px !important;
  outline: 0 !important;
  resize: vertical !important;
  background: #fff !important;
  color: #17233b !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 textarea::placeholder {
  color: #8796aa !important;
}

/* Pie y botón */
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .bbp-submit-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  float: none !important;
}

body.single-topic #bbpress-forums .rcad-guest-reply-hint-v288 {
  margin-right: auto !important;
  color: #b45309 !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}
body.single-topic #bbpress-forums .rcad-guest-reply-hint-v288:empty {
  display: none !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .bbp-submit-wrapper button,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 #bbp_reply_submit,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 #rcadGuestReplySubmit288 {
  min-height: 34px !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: #1769b0 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .bbp-submit-wrapper button:hover,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 #bbp_reply_submit:hover,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 #rcadGuestReplySubmit288:hover {
  background: #115890 !important;
}

/* Evita que metadatos del formulario nativo ensanchen la columna */
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 p,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 label {
  max-width: 100% !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  box-sizing: border-box !important;
}

@media (max-width: 700px) {
  body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 {
    grid-template-columns: 1fr !important;
  }
  body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 > .rcad-native-reply-author-v285 {
    display: none !important;
  }
  body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 > form {
    grid-column: 1 !important;
    grid-row: 1 !important;
    padding: 8px !important;
  }
}

/* ============================================================
   RCAD v290 — invitados usan el MISMO compositor visual real.
   La barra manual legacy ya no existe en el markup. El textarea
   #bbp_reply_content es transformado por rcad-visual-quote-editor.js.
   ============================================================ */
body.single-topic #bbpress-forums .rcad-reply-composer-guest-v288 .wp-editor-wrap.rcad-native-editor-hidden {
  display: none !important;
}
body.single-topic #bbpress-forums .rcad-reply-composer-guest-v288 .rcad-visual-composer {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  float: none !important;
  position: static !important;
}
body.single-topic #bbpress-forums .rcad-reply-composer-guest-v288 .rcad-visual-toolbar,
body.single-topic #bbpress-forums .rcad-reply-composer-guest-v288 .rcad-visual-canvas,
body.single-topic #bbpress-forums .rcad-reply-composer-guest-v288 .rcad-visual-response {
  box-sizing: border-box !important;
}
/* Garantía: cualquier quicktags manual residual de builds anteriores no se muestra. */
body.single-topic #bbpress-forums .rcad-reply-composer-guest-v288 .rcad-guest-quicktags-v288 {
  display: none !important;
}


/* =========================================================
   RCAD v292 — toolbar única RCAD
   - elimina cualquier toolbar Quicktags/native residual
   - conserva exclusivamente la toolbar visual RCAD
   - popovers con margen/borde
   - estado activo visible
   ========================================================= */
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .quicktags-toolbar,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .mce-toolbar-grp,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .mce-top-part {
  display: none !important;
}

body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 .rcad-visual-toolbar {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  min-height: 46px !important;
  padding: 6px 12px !important;
  border: 1px solid #cfd9e6 !important;
  border-bottom-color: #d9e1ec !important;
  border-radius: 6px 6px 0 0 !important;
  background: #fff !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar > .rcad-toolbar-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: #0b3768 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar > .rcad-toolbar-button:hover {
  background: #f2f6fb !important;
  border-color: #d7e1ee !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar > .rcad-toolbar-button.is-active,
body.single-topic #bbpress-forums .rcad-visual-toolbar > .rcad-toolbar-button[aria-pressed="true"],
body.single-topic #bbpress-forums .rcad-visual-toolbar > .rcad-toolbar-button.is-open {
  color: #075eb6 !important;
  background: #eaf4ff !important;
  border-color: #b9d8f5 !important;
  box-shadow: inset 0 0 0 1px rgba(7,94,182,.04) !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-toolbar-icon,
body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-toolbar-icon svg {
  display: block !important;
  width: 19px !important;
  height: 19px !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-toolbar-icon svg {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-toolbar-popover {
  position: absolute !important;
  z-index: 10020 !important;
  width: 300px !important;
  max-width: calc(100% - 24px) !important;
  margin: 0 !important;
  padding: 10px 12px 12px !important;
  border: 1px solid #c9d7e7 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(7,27,70,.16) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-toolbar-popover[hidden],
body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-emoji-panel[hidden] {
  display: none !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-toolbar-popover > label {
  display: block !important;
  width: 100% !important;
  margin: 6px 0 10px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-toolbar-popover input {
  display: block !important;
  width: 100% !important;
  height: 38px !important;
  margin-top: 4px !important;
  padding: 7px 10px !important;
  border: 1px solid #c9d7e7 !important;
  border-radius: 6px !important;
  background: #fff !important;
  box-sizing: border-box !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-popover-title {
  display: none !important;
}

body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-popover-actions {
  display: flex !important;
  justify-content: flex-end !important;
  padding-top: 2px !important;
}

@media (max-width: 520px) {
  body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-toolbar-popover {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    left: 8px !important;
  }
}


/* RCAD v293 — popovers compactos y compositor sin doble borde */
body.single-topic #bbpress-forums .rcad-visual-toolbar .rcad-toolbar-popover > label:first-of-type {
  margin-top: 0 !important;
}

/* RCAD v294 — restaurar marco único exterior del compositor.
   El marco envuelve avatar + editor; se evita cualquier segundo marco del form/fieldset. */
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 {
  border: 1px solid #d9e1ec !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  background: #fff !important;
}
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 > form,
body.single-topic #bbpress-forums .bbp-reply-form.rcad-reply-composer-v286 fieldset.bbp-form {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}
