/* SpectraHub V57 - reliable rich-editor save + compact preset menus */

/* Font and size menus are compact grids instead of one very tall dropdown. */
body.spectrahubForum .shXfFontMenu,
body.spectrahubAdmin .shXfFontMenu{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:3px!important;
  width:min(470px,calc(100vw - 34px))!important;
  min-width:min(470px,calc(100vw - 34px))!important;
  max-height:min(300px,44vh)!important;
  padding:6px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
body.spectrahubForum .shXfFontMenu>li,
body.spectrahubAdmin .shXfFontMenu>li{min-width:0!important}
body.spectrahubForum .shXfFontMenu .shXfFontChoice,
body.spectrahubAdmin .shXfFontMenu .shXfFontChoice{
  min-width:0!important;
  width:100%!important;
  padding:7px 8px!important;
  overflow:hidden!important;
}
body.spectrahubForum .shXfFontMenu .shXfFontChoice>span:last-child,
body.spectrahubAdmin .shXfFontMenu .shXfFontChoice>span:last-child{
  overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important
}
body.spectrahubForum .shXfSizeMenu,
body.spectrahubAdmin .shXfSizeMenu{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:3px!important;
  width:min(480px,calc(100vw - 34px))!important;
  min-width:min(480px,calc(100vw - 34px))!important;
  max-height:min(290px,42vh)!important;
  padding:6px!important;
  overflow-y:auto!important;
}
body.spectrahubForum .shXfSizeMenu>li,
body.spectrahubAdmin .shXfSizeMenu>li{min-width:0!important}

/* Never clip editor popups on Signature / About / topic forms. */
.xfBlock,.xfAccountContent,.xfForm,.shXfEditorShell,.shXfEditorShell .fr-box,.shXfEditorShell .fr-toolbar{overflow:visible!important}
body.spectrahubForum .fr-popup,body.spectrahubAdmin .fr-popup,
body.spectrahubForum .fr-dropdown-menu,body.spectrahubAdmin .fr-dropdown-menu{
  z-index:2147482000!important;
  max-width:calc(100vw - 24px)!important;
}

/* Quote preview in editor: clearly separated SpectraHub card. */
.shXfEditorShell .fr-element blockquote.shQuoteBlock,
.shXfEditorShell>.shXfVisualHost blockquote.shQuoteBlock{
  position:relative!important;
  margin:15px 0!important;
  padding:45px 16px 16px!important;
  border:1px solid #52616e!important;
  border-radius:11px!important;
  background:#293038!important;
  box-shadow:inset 4px 0 0 #42a5f5,0 8px 20px rgba(0,0,0,.12)!important;
  color:#edf3f7!important;
}
.shXfEditorShell .fr-element blockquote.shQuoteBlock::before,
.shXfEditorShell>.shXfVisualHost blockquote.shQuoteBlock::before{
  content:'IDÉZET'!important;
  position:absolute!important;left:16px!important;top:12px!important;
  color:#7fc7f7!important;font:900 14px/1.2 system-ui,sans-serif!important;letter-spacing:.13em!important;
}
.shXfEditorShell blockquote.shQuoteBlock cite{
  display:block!important;margin:-1px 0 10px!important;color:#abd4ef!important;font-style:normal!important;font-weight:800!important
}

/* Only the inline spoiler UX is used now. Old [SPOILER] is rendered/migrated to this too. */
.shXfEditorShell .shInlineSpoiler,.bb-inline-spoiler{
  position:relative!important;display:inline!important;width:auto!important;min-width:0!important;
  padding:2px 7px!important;border:1px solid #4d5862!important;border-radius:5px!important;
  background:#0c1116!important;cursor:pointer!important;
}
.shXfEditorShell .shInlineSpoiler:not(.is-revealed),
.shXfEditorShell .shInlineSpoiler:not(.is-revealed) *,
.bb-inline-spoiler:not(.is-revealed),.bb-inline-spoiler:not(.is-revealed) *{
  color:transparent!important;text-shadow:none!important;text-decoration-color:transparent!important
}
.shXfEditorShell .shInlineSpoiler:not(.is-revealed),.bb-inline-spoiler:not(.is-revealed){box-shadow:inset 0 0 0 999px #0c1116!important}
.shXfEditorShell .shInlineSpoiler.is-revealed,.bb-inline-spoiler.is-revealed{background:#2b3239!important;color:inherit!important;box-shadow:none!important}

/* CODE is block; ICODE remains a true inline token. */
.shXfEditorShell .shInlineCode,.bb-inline-code{
  display:inline!important;width:auto!important;min-width:0!important;max-width:100%!important;
  padding:2px 6px!important;margin:0 2px!important;border:1px solid #4b5863!important;border-radius:5px!important;
  background:#161c22!important;color:#dceaf4!important;font:0.94em/1.45 ui-monospace,SFMono-Regular,Consolas,monospace!important;
  white-space:pre-wrap!important;overflow-wrap:anywhere!important
}

@media(max-width:700px){
  body.spectrahubForum .shXfFontMenu,body.spectrahubAdmin .shXfFontMenu,
  body.spectrahubForum .shXfSizeMenu,body.spectrahubAdmin .shXfSizeMenu{
    grid-template-columns:1fr!important;width:calc(100vw - 28px)!important;min-width:0!important;max-width:calc(100vw - 28px)!important
  }
}
