
/* v88 Workshop Notes layout containment */
#workshopTab,
#workshopTab .workshop-notes-card,
#workshopTab .workshop-note-head,
#workshopTab .rich-note-toolbar,
#workshopTab .workshop-editor,
#workshopTab .workshop-foot{
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
#workshopTab .workshop-notes-card{
  width:100%!important;
  overflow:hidden!important;
}
#workshopTab .workshop-editor{
  width:100%!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
}
#workshopTab .workshop-editor table{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
  box-sizing:border-box!important;
}
#workshopTab .workshop-editor thead,
#workshopTab .workshop-editor tbody,
#workshopTab .workshop-editor tr{
  max-width:100%!important;
}
#workshopTab .workshop-editor th,
#workshopTab .workshop-editor td{
  min-width:0!important;
  max-width:none!important;
  width:auto!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  box-sizing:border-box!important;
  vertical-align:top!important;
}
#workshopTab .workshop-editor img,
#workshopTab .workshop-editor video,
#workshopTab .workshop-editor canvas,
#workshopTab .workshop-editor iframe{
  max-width:100%!important;
  height:auto!important;
}
#workshopTab .workshop-editor pre{
  max-width:100%!important;
  white-space:pre-wrap!important;
  overflow-wrap:anywhere!important;
  overflow-x:auto!important;
}
#workshopTab .workshop-editor p,
#workshopTab .workshop-editor li,
#workshopTab .workshop-editor blockquote,
#workshopTab .workshop-editor div{
  max-width:100%!important;
  overflow-wrap:anywhere!important;
}
#workshopTab .rich-note-toolbar{
  width:100%!important;
  overflow:visible!important;
}

/* v89: keep the chapter grid stable even when Workshop Notes contains rich pasted content. */
#chapterPage .chapter-layout{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  grid-template-columns:minmax(180px,210px) minmax(0,1fr)!important;
  align-items:start!important;
}
#chapterPage .chapter-main{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
#chapterPage .chapter-main > *,
#workshopTab,
#workshopTab > *{
  min-width:0!important;
  max-width:100%!important;
}
@media(max-width:760px){
  #chapterPage .chapter-layout{grid-template-columns:1fr!important}
}

/* v90: Workshop Notes scroll-stability mode.
   Avoid Chromium sticky/backdrop compositing glitches that can collapse the main grid while scrolling. */
#chapterPage.sqe-workshop-mode .chapter-layout{
  display:grid!important;
  grid-template-columns:210px minmax(0,1fr)!important;
  gap:12px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:visible!important;
  align-items:start!important;
}
#chapterPage.sqe-workshop-mode .chapter-toc{
  grid-column:1!important;
  position:relative!important;
  top:auto!important;
  align-self:start!important;
  width:auto!important;
  max-width:210px!important;
  min-width:0!important;
  max-height:none!important;
  overflow:visible!important;
  transform:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  background:rgba(255,255,255,.94)!important;
}
#chapterPage.sqe-workshop-mode .chapter-main{
  grid-column:2!important;
  grid-row:1!important;
  width:auto!important;
  max-width:none!important;
  min-width:0!important;
  overflow:visible!important;
  position:relative!important;
  transform:none!important;
}
#chapterPage.sqe-workshop-mode #workshopTab,
#chapterPage.sqe-workshop-mode .workshop-notes-card,
#chapterPage.sqe-workshop-mode .workshop-editor{
  width:auto!important;
  min-width:0!important;
  max-width:100%!important;
  position:relative!important;
  transform:none!important;
  contain:none!important;
}
#chapterPage.sqe-workshop-mode .rich-note-toolbar{
  position:relative!important;
  top:auto!important;
  transform:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
@media(max-width:760px){
  #chapterPage.sqe-workshop-mode .chapter-layout{grid-template-columns:1fr!important}
  #chapterPage.sqe-workshop-mode .chapter-toc,
  #chapterPage.sqe-workshop-mode .chapter-main{grid-column:1!important;max-width:100%!important}
}
