/* HUIDI Docs Community Local RC16.27 — Single Shell Boot + Modal Overflow Closure
   Final visual layer. The workspace is hidden only while legacy owners compose; users never see the old shell. */
html.workspace-preboot{background:#f5f5f7;color-scheme:light}
html[data-theme='dark'].workspace-preboot{background:#111113;color-scheme:dark}
body.workspace-r5.workspace-booting{overflow:hidden!important}
body.workspace-r5.workspace-booting>.app,
body.workspace-r5.workspace-booting>#appDialog,
body.workspace-r5.workspace-booting>.toast-wrap{visibility:hidden!important}
.workspace-r5-boot-screen{display:none}
body.workspace-r5.workspace-booting>.workspace-r5-boot-screen{
  position:fixed;inset:0;z-index:9999;display:grid;place-items:center;
  background:#f5f5f7;opacity:0;animation:workspaceR5BootIn .12s .12s forwards;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}
html[data-theme='dark'] body.workspace-r5.workspace-booting>.workspace-r5-boot-screen{background:#111113}
.workspace-r5-boot-card{display:flex;align-items:center;gap:10px;padding:10px 12px;color:#1d1d1f}
html[data-theme='dark'] .workspace-r5-boot-card{color:#f5f5f7}
.workspace-r5-boot-card img{width:34px;height:34px;border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.workspace-r5-boot-copy{display:grid;gap:1px}.workspace-r5-boot-copy b{font-size:13px;letter-spacing:-.01em}.workspace-r5-boot-copy small{font-size:10px;color:#86868b}
@keyframes workspaceR5BootIn{to{opacity:1}}
body.workspace-r5.workspace-ready>.app{animation:workspaceR5Ready .12s ease-out both}
@keyframes workspaceR5Ready{from{opacity:.88}to{opacity:1}}

/* The final shell owns the visible workspace. Legacy direct nav blocks are never allowed to coexist. */
body.workspace-r5 .sidebar>.nav-section-title,
body.workspace-r5 .sidebar>nav.nav{display:none!important}
body.workspace-r5 .sidebar>.workspace-nav-groups:not(.workspace-r2-nav){display:none!important}
body.workspace-r5 .version{display:none!important}
body.workspace-r5 .workspace-r2-quick{display:none!important}
body.workspace-r5 .workspace-r2-create{display:none!important}
body.workspace-r5 .workflow,body.workspace-r5 .mode-strip{display:none!important}

/* Keep the sidebar stable while composition completes and after view switches. */
body.workspace-r5 .sidebar{contain:layout paint;isolation:isolate}
body.workspace-r5 .workspace-r2-nav{min-width:0}
body.workspace-r5 .workspace-r2-more-body,body.workspace-r5 .workspace-nav-group,body.workspace-r5 .nav{min-width:0}
body.workspace-r5 .nav-btn{min-width:0;overflow:hidden}
body.workspace-r5 .nav-copy{min-width:0}.workspace-r5 .nav-copy b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* One modal geometry. Prevent the Feishu config footer/padding combination from creating x-overflow. */
body.workspace-r5 #appDialog{max-width:none;max-height:none;overflow:visible}
body.workspace-r5 #appDialog .modal{overflow-x:hidden!important;overscroll-behavior:contain;max-width:calc(100vw - 28px)}
body.workspace-r5 #appDialog .modal:has(.feishu-security-note){width:min(760px,calc(100vw - 32px));padding:0!important}
body.workspace-r5 #appDialog .modal:has(.feishu-security-note)>.form-grid{
  padding:12px 16px 0;margin:0;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 10px;min-width:0
}
body.workspace-r5 #appDialog .modal:has(.feishu-security-note)>.form-grid>.field{min-width:0}
body.workspace-r5 #appDialog .modal:has(.feishu-security-note)>.feishu-security-note{
  margin:12px 16px 0;padding:10px 11px;border-radius:11px;min-width:0
}
body.workspace-r5 #appDialog .modal:has(.feishu-security-note)>.modal-foot{
  margin:12px 0 0!important;padding:10px 16px!important;left:auto;right:auto;width:auto;max-width:100%;
}
body.workspace-r5 #appDialog .modal:has(.feishu-security-note) input{min-width:0}
body.workspace-r5 #appDialog .modal:has(.feishu-security-note) .feishu-security-note span{overflow-wrap:anywhere}

/* Dialogs use one top-layer visual hierarchy and never reveal the page's own scrollbar through the modal. */
body.workspace-r5:has(#appDialog[open]){overflow:hidden}
body.workspace-r5 #appDialog::backdrop{background:rgba(0,0,0,.26);backdrop-filter:saturate(120%) blur(10px)}
body.workspace-r5 #appDialog .modal-head{box-sizing:border-box}
body.workspace-r5 #appDialog .modal-foot{box-sizing:border-box}

@media(max-width:760px){
  body.workspace-r5 #appDialog .modal:has(.feishu-security-note)>.form-grid{grid-template-columns:1fr}
  body.workspace-r5 #appDialog .modal:has(.feishu-security-note)>.form-grid>.field.full{grid-column:auto}
}
@media(prefers-reduced-motion:reduce){
  body.workspace-r5.workspace-booting>.workspace-r5-boot-screen,body.workspace-r5.workspace-ready>.app{animation:none!important;opacity:1!important}
}
