/* SpectraHub V58 — global editor persistence + clean thread layout */

/* Thread header: title gets its own full row, actions sit below instead of crushing it. */
body.spectrahubForum .threadHead{
  display:block!important;
  padding:20px 22px!important;
  margin-bottom:18px!important;
  overflow:visible!important;
}
body.spectrahubForum .threadHead>div:first-child{min-width:0!important;width:100%!important;}
body.spectrahubForum .threadHead h1{
  margin:2px 0 0!important;
  max-width:100%!important;
  font-size:24px!important;
  line-height:1.22!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}
body.spectrahubForum .threadHead .path{margin:0 0 7px!important;}
body.spectrahubForum .threadHead .topicActions{
  display:flex!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  width:100%!important;
  margin:16px 0 0!important;
  padding:14px 0 0!important;
  border-top:1px solid rgba(255,255,255,.10)!important;
}
body.spectrahubForum .threadHead .topicActions form{display:inline-flex!important;margin:0!important;}
body.spectrahubForum .threadHead .topicActions .btn,
body.spectrahubForum .threadHead .topicActions .dangerLink{
  margin:0!important;
  min-height:38px!important;
  padding:8px 12px!important;
  line-height:1.2!important;
  white-space:nowrap!important;
}

/* Remove the old global “negative paragraph gap” rules that compressed posts. */
body.spectrahubForum .postContent{padding:18px 22px!important;margin:0!important;}
body.spectrahubForum .postContent .postTop{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  min-height:30px!important;
  margin:0 0 16px!important;
  padding:0 0 10px!important;
  line-height:1.35!important;
}
body.spectrahubForum .postContent .bodyText,
body.spectrahubForum .xfProfilePostBody,
body.spectrahubForum .message-body{
  margin:0!important;
  padding:0!important;
  color:#e5e9ed!important;
  font-size:15px!important;
  line-height:1.62!important;
  overflow-wrap:anywhere!important;
}
body.spectrahubForum .postContent .bodyText *,
body.spectrahubForum .xfProfilePostBody *,
body.spectrahubForum .message-body *{
  line-height:inherit!important;
  margin-top:0!important;
  padding-top:0!important;
  padding-bottom:0!important;
}
body.spectrahubForum .postContent .bodyText p,
body.spectrahubForum .xfProfilePostBody p,
body.spectrahubForum .message-body p{
  margin:0 0 10px!important;
}
body.spectrahubForum .postContent .bodyText p:last-child,
body.spectrahubForum .xfProfilePostBody p:last-child,
body.spectrahubForum .message-body p:last-child{margin-bottom:0!important;}
body.spectrahubForum .postContent .bodyText br,
body.spectrahubForum .xfProfilePostBody br,
body.spectrahubForum .message-body br{line-height:normal!important;}
body.spectrahubForum .postContent .bodyText blockquote,
body.spectrahubForum .postContent .bodyText .shBbQuote,
body.spectrahubForum .message-body .shBbQuote{margin:12px 0!important;padding-top:0!important;padding-bottom:0!important;}
body.spectrahubForum .postContent .bodyText pre,
body.spectrahubForum .message-body pre{margin:12px 0!important;line-height:1.5!important;}
body.spectrahubForum .signature,
body.spectrahubForum .signature *{line-height:1.45!important;}
body.spectrahubForum .signature{margin-top:20px!important;padding-top:14px!important;}

/* Formatted BBCode must visibly win over old theme inheritance. */
body.spectrahubForum :is(.bodyText,.signature,.xfProfilePostBody,.message-body) span[style*="color"]{color:var(--sh-inline-color,inherit);}

/* Editor popups stay compact and above surrounding cards on every editor page. */
body.spectrahubForum .shXfEditorShell{overflow:visible!important;position:relative!important;z-index:1;}
body.spectrahubForum .shXfEditorShell:focus-within{z-index:40!important;}
body.spectrahubForum .fr-popup,
body.spectrahubForum .fr-dropdown-menu{z-index:10050!important;max-height:min(360px,55vh)!important;}
body.spectrahubForum .shXfFontMenu,
body.spectrahubForum .shXfSizeMenu{max-height:320px!important;overflow:auto!important;overscroll-behavior:contain;}

@media (max-width:760px){
  body.spectrahubForum .threadHead{padding:16px!important;}
  body.spectrahubForum .threadHead h1{font-size:21px!important;}
  body.spectrahubForum .threadHead .topicActions{gap:7px!important;}
  body.spectrahubForum .threadHead .topicActions .btn,
  body.spectrahubForum .threadHead .topicActions .dangerLink{font-size:14px!important;}
  body.spectrahubForum .postContent{padding:15px!important;}
}

/* =========================================================
   V59 editor shell cleanup: ONE editor block, rounded corners
   everywhere (signature, about, topic, reply, PM, admin editors).
   ========================================================= */
body.spectrahubForum .shXfEditorShell,
body.spectrahubAdmin .shXfEditorShell{
  border-radius:12px!important;
  border:1px solid #59626b!important;
  background:#34393f!important;
  box-shadow:none!important;
  overflow:visible!important;
}
body.spectrahubForum .shXfEditorShell .fr-box,
body.spectrahubAdmin .shXfEditorShell .fr-box{
  border-radius:11px!important;
  border:0!important;
  background:#34393f!important;
  box-shadow:none!important;
}
body.spectrahubForum .shXfEditorShell .fr-toolbar,
body.spectrahubAdmin .shXfEditorShell .fr-toolbar,
body.spectrahubForum .shXfEditorShell.shXfFallbackMode>.shXfFallbackTools,
body.spectrahubAdmin .shXfEditorShell.shXfFallbackMode>.shXfFallbackTools{
  border-radius:11px 11px 0 0!important;
}
body.spectrahubForum .shXfEditorShell .fr-wrapper,
body.spectrahubAdmin .shXfEditorShell .fr-wrapper,
body.spectrahubForum .shXfEditorShell>.shXfBbcodeArea,
body.spectrahubAdmin .shXfEditorShell>.shXfBbcodeArea,
body.spectrahubForum .shXfEditorShell.shXfFallbackMode>.shXfVisualHost,
body.spectrahubAdmin .shXfEditorShell.shXfFallbackMode>.shXfVisualHost{
  border-radius:0!important;
}
body.spectrahubForum .shXfEditorShell .shXfAttachmentArea,
body.spectrahubAdmin .shXfEditorShell .shXfAttachmentArea{
  border-radius:0 0 11px 11px!important;
  margin:0!important;
}
/* Never allow Froala + fallback toolbar to be visible at the same time. */
body.spectrahubForum .shXfEditorShell:not(.shXfFallbackMode)>.shXfFallbackTools,
body.spectrahubAdmin .shXfEditorShell:not(.shXfFallbackMode)>.shXfFallbackTools{display:none!important;}
body.spectrahubForum .shXfEditorShell.shXfFallbackMode .fr-box,
body.spectrahubAdmin .shXfEditorShell.shXfFallbackMode .fr-box{display:none!important;}
/* Defensive: an editor shell may never contain another mounted editor shell. */
.shXfEditorShell .shXfEditorShell{display:none!important;}
