/* Online workspace, sync status, auth and migration indicators — matching both GM themes. */
html[data-theme] .login{background:var(--theme-canvas);color:var(--theme-text)}
html[data-theme] .login-card{background:var(--theme-surface);color:var(--theme-text);border:1px solid var(--theme-border);box-shadow:0 12px 36px #0002}
html[data-theme] .login-card h1{color:var(--theme-text)}
html[data-theme] .login-card p{color:var(--theme-muted)}
html[data-theme] .login-card .field{color:var(--theme-text)}
html[data-theme] .login-card .field input{background:var(--theme-elevated);color:var(--theme-text);border:1px solid var(--theme-border)}
html[data-theme] .login-card .primary{background:var(--theme-text);color:var(--theme-surface);border-color:var(--theme-text)}
html[data-theme] .bb-sync-panel{
 display:flex;align-items:center;gap:8px;flex-wrap:wrap;
 padding:9px 12px;margin:-12px 0 19px;
 font-size:11px;line-height:1.6;
 color:var(--theme-text);background:var(--theme-surface);
 border:1px solid var(--theme-border);border-left:3px solid var(--theme-brand);
 border-radius:9px
}
html[data-theme] .bb-sync-panel strong{font-size:11px;font-weight:750;letter-spacing:.1px}
html[data-theme] .bb-sync-panel span{color:var(--theme-muted)}
html[data-theme] .bb-sync-panel small{flex-basis:100%;font-size:10px;color:var(--theme-muted)}
html[data-theme] .bb-sync-panel .ghost{
 font-size:10px;padding:7px 10px;color:var(--theme-text);background:var(--theme-elevated);border-color:var(--theme-border);
}
html[data-theme] .bb-sync-panel .ghost:hover{background:var(--theme-hover)}
html[data-theme] #online-auth{display:grid;gap:12px;margin-top:18px}
html[data-theme] #online-auth .primary{width:100%;margin-top:0}
@media(max-width:760px){
 html[data-theme] .bb-sync-panel{margin:-8px 0 16px}
 html[data-theme] .bb-sync-panel strong{width:100%}
 html[data-theme] .bb-sync-panel .ghost{width:100%}
}
/* A compact status dot in place of persistent synchronization banners. */
.bb-connection-dot {display:inline-block;flex:none;width:10px;height:10px;border-radius:50%;background:#facc15;box-shadow:0 0 0 3px #facc1528;vertical-align:middle;cursor:help}
.bb-connection-dot[data-state="synced"] {background:#55b977;box-shadow:0 0 0 3px #55b97724}
.bb-connection-dot[data-state="saving"],.bb-connection-dot[data-state="connecting"],.bb-connection-dot[data-state="delayed"] {background:#facc15;box-shadow:0 0 0 3px #facc1528}
.bb-connection-dot[data-state="offline"],.bb-connection-dot[data-state="conflict"],.bb-connection-dot[data-state="error"] {background:#df6666;box-shadow:0 0 0 3px #df666628}
.bb-sync-panel[hidden] {display:none!important}
.bb-sync-panel {max-width:680px}
/* Shared responsive dialog boundaries, including marketing/staff/venue variants. */
#modal-root .form-backdrop {position:fixed!important;inset:0!important;z-index:1000!important;display:flex;align-items:center;justify-content:center;overflow-y:auto;padding:clamp(12px,3vh,26px) 12px;overscroll-behavior:contain}
#modal-root .modal {box-sizing:border-box;max-height:calc(100dvh - 32px)!important;max-width:calc(100vw - 24px)!important;overflow:hidden!important;display:flex;flex-direction:column;min-height:0}
#modal-root .modal > form {display:flex;flex-direction:column;min-height:0;max-height:100%;overflow:hidden}
#modal-root .modal > form > header,#modal-root .modal > form > h2 {flex-shrink:0}
#modal-root .modal > form > footer,#modal-root .modal > form > .modal-actions,#modal-root .modal > form > .v-modal-actions {flex-shrink:0}
#modal-root .modal > form > .fields,#modal-root .modal > form > .m-modal-fields,#modal-root .modal > form > .mp-modal-body,#modal-root .modal > form > .mm-dialog-fields,#modal-root .modal > form > .s-modal-body,#modal-root .modal > form > .v-form-fields {min-height:0;overflow:auto;overscroll-behavior:contain;flex:1 1 auto}
#modal-root .bb-wizard-stage {padding:2px 0 8px;min-width:0}
#modal-root .bb-wizard-progress {font-size:12px;letter-spacing:.03em;color:var(--theme-muted,#a99);margin:7px 0 19px}
#modal-root .bb-wizard-question {min-height:135px;max-width:100%;overflow-x:hidden}
#modal-root .bb-wizard-step {min-width:0;width:100%}
#modal-root .bb-wizard-step > label,#modal-root .bb-wizard-step > .field,#modal-root .bb-wizard-step > fieldset {display:flex;flex-direction:column;gap:9px;width:100%;min-width:0}
#modal-root .bb-wizard-step input:not([type="checkbox"]):not([type="radio"]),#modal-root .bb-wizard-step textarea,#modal-root .bb-wizard-step select {max-width:100%;width:100%;box-sizing:border-box}
#modal-root .bb-wizard-step textarea {min-height:100px;max-height:32dvh}
#modal-root .bb-wizard-back,#modal-root .bb-wizard-next {padding:10px 16px;min-height:40px;background:var(--theme-elevated,#222);color:var(--theme-text,#eee);border:1px solid var(--theme-border,#444);border-radius:10px;cursor:pointer;font:inherit}
#modal-root .bb-wizard-next {background:var(--theme-text,#eee);color:var(--theme-surface,#111)}
#modal-root .bb-wizard-back:hover,#modal-root .bb-wizard-next:hover {filter:brightness(.94)}
@media(max-width:700px) {
 #modal-root .form-backdrop {align-items:center;padding:12px 8px}
 #modal-root .modal {width:100%!important;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 24px)!important}
 #modal-root .modal footer,#modal-root .modal .modal-actions,#modal-root .modal .v-modal-actions {flex-wrap:wrap;gap:8px}
 #modal-root .bb-wizard-back,#modal-root .bb-wizard-next {min-width:75px}
}

/* Details are a dismissible popover opened from the sync dot, never a full-width banner. */
html[data-theme] .bb-sync-panel:not([hidden]){position:fixed;z-index:101;top:84px;right:18px;left:auto;max-width:min(390px,calc(100vw - 28px));max-height:60dvh;overflow:auto;padding:14px;border:1px solid var(--theme-border,#444);border-radius:12px;background:var(--theme-surface,#181818);box-shadow:0 14px 40px #0006;margin:0}
html[data-theme] .bb-connection-dot {padding:0;border:0;appearance:none;cursor:pointer}
@media(max-width:760px){html[data-theme] .bb-sync-panel:not([hidden]){top:74px;right:10px}}

/* Visible workspace status light alongside the star in every GM folder header. */
.gm-header .gm-header-copy{min-width:0;flex:1}
.gm-header .gm-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:16px;flex:0 0 auto}
.gm-header .gm-header-actions .bb-connection-dot{display:block;position:relative;width:11px;height:11px;min-width:11px;min-height:11px;flex:0 0 11px;border:0;border-radius:50%;padding:0;margin:0;outline-offset:5px}
.gm-header .gm-header-actions .bb-connection-dot:focus-visible{outline:2px solid var(--theme-text,#fff)}
@media(max-width:760px){.gm-header .gm-header-actions{gap:12px}}

/* True-black demo workspace: dimension through hairlines and maroon outlines. */
html[data-theme="dark"] #app.command-center-view .gm-shell,
html[data-theme="dark"] #app.command-center-view .gm-chat-wrap,
html[data-theme="dark"] #app.command-center-view .gm-folder-nav,
html[data-theme="dark"] #app.command-center-view .gm-work-area,
html[data-theme="dark"] #app.command-center-view .gm-header,
html[data-theme="dark"] #app.command-center-view .gm-compose,
html[data-theme="dark"] #app.command-center-view .gm-messages {background:#000;color:#f5f3f4}
html[data-theme="dark"] #app.command-center-view .gm-header,
html[data-theme="dark"] #app.command-center-view .gm-folder-nav,
html[data-theme="dark"] #app.command-center-view .gm-chat-wrap{border-color:#423039}
html[data-theme="dark"] #app.command-center-view .gm-folder-unit,
html[data-theme="dark"] #app.command-center-view .gm-board-section,
html[data-theme="dark"] #app.command-center-view .v-tile {border-color:#4b3540}
html[data-theme="dark"] .modal {background:#050505!important;border-color:#634552}
html[data-theme="dark"] .modal input,
html[data-theme="dark"] .modal select,
html[data-theme="dark"] .modal textarea {background:#0b090a;color:#f5f3f4;border-color:#5b4350}
/* Mobile dialog: one comfortable step, visible actions, never a page-wide form. */
#modal-root {position:relative;z-index:1000}
#modal-root .form-backdrop{box-sizing:border-box;width:100vw;max-width:100%;padding:12px;align-items:center;overflow:hidden}
#modal-root .modal{width:min(100%,540px)!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 32px)!important;min-width:0;min-height:0;overflow:hidden!important;flex:0 1 auto}
#modal-root .modal form{width:100%;min-width:0;max-width:100%;min-height:0;max-height:calc(100dvh - 40px);overflow:hidden}
#modal-root .modal form > :is(.fields,.m-modal-fields,.mp-modal-body,.mm-dialog-fields,.s-modal-body,.v-form-fields){width:100%;max-width:100%;min-width:0;overflow-y:auto;overflow-x:hidden;flex:1 1 auto}
#modal-root .modal form > :is(footer,.modal-actions,.m-modal-actions,.v-modal-actions){width:100%;max-width:100%;min-width:0;display:flex!important;flex-wrap:nowrap;align-items:center;justify-content:flex-end;gap:8px;overflow:visible;position:relative;z-index:2}
#modal-root .modal form > :is(footer,.modal-actions,.m-modal-actions,.v-modal-actions) button{flex:0 1 auto;white-space:nowrap;min-width:0}
#modal-root .bb-wizard-stage{width:100%;min-width:0}
#modal-root .bb-wizard-question{width:100%;min-width:0;min-height:155px;max-height:44dvh;overflow-y:auto;overflow-x:hidden}
#modal-root .bb-wizard-step, #modal-root .bb-wizard-step > label{min-width:0;max-width:100%;box-sizing:border-box}
#modal-root .bb-wizard-step > label{width:100%;display:flex;flex-direction:column}
#modal-root .s-form-grid:empty,#modal-root .s-form-warning{display:none!important}
@media(max-width:700px){
 #modal-root .form-backdrop{padding:10px!important;align-items:center!important}
 #modal-root .modal{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 28px)!important;margin:0!important;padding:0!important}
 #modal-root .modal form{max-height:calc(100dvh - 30px)}
 #modal-root .modal :is(header,.s-modal-body,.m-modal-fields,.mp-modal-body,.mm-dialog-fields,.v-form-fields){padding-left:16px;padding-right:16px}
 #modal-root .modal form > :is(footer,.modal-actions,.m-modal-actions,.v-modal-actions){padding:12px 14px calc(12px + env(safe-area-inset-bottom))!important}
 #modal-root .bb-wizard-question{min-height:130px;max-height:38dvh}
 #modal-root .bb-wizard-progress{margin:8px 0 17px}
}
html[data-theme] .bb-connection-dot[data-state="demo"]{background:#9c8b90;box-shadow:0 0 0 3px #9c8b9035}

/* Guest demo does not offer sign-out actions, because no account was opened. */
body.bb-guest-demo #desktopOut,
body.bb-guest-demo #resetDemo,
body.bb-guest-demo #mobileSignOut{display:none!important}

/* iPhone keyboard safe dialog: visible viewport, not Safari layout viewport.
   Keep header and actions fixed in the card and scroll only the active step. */
@media(max-width:700px){
 html,body{max-width:100%;overflow-x:hidden}
 #modal-root .form-backdrop{
  inset:auto!important;
  position:fixed!important;
  top:var(--bb-dialog-offset-top,0px)!important;
  left:var(--bb-dialog-offset-left,0px)!important;
  width:var(--bb-dialog-vw,100vw)!important;
  height:var(--bb-dialog-vh,100dvh)!important;
  max-width:var(--bb-dialog-vw,100vw)!important;
  max-height:var(--bb-dialog-vh,100dvh)!important;
  box-sizing:border-box!important;
  padding:10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
 }
 #modal-root .modal{
  flex:0 1 auto!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  max-height:calc(var(--bb-dialog-vh,100dvh) - 20px)!important;
  margin:0!important;
  box-sizing:border-box!important;
 }
 #modal-root .modal > form{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  max-height:calc(var(--bb-dialog-vh,100dvh) - 22px)!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
 }
 #modal-root .modal > form > :is(header,h2){
  flex:0 0 auto!important;
  width:100%;min-width:0;box-sizing:border-box;
 }
 #modal-root .modal > form > :is(.fields,.m-modal-fields,.mp-modal-body,.mm-dialog-fields,.s-modal-body,.v-form-fields){
  flex:1 1 auto!important;
  min-height:0!important;
  min-width:0!important;
  max-width:100%!important;
  width:100%!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  box-sizing:border-box!important;
 }
 #modal-root .modal > form > :is(footer,.modal-actions,.m-modal-actions,.v-modal-actions){
  flex:0 0 auto!important;
  min-width:0!important;
  max-width:100%!important;
  width:100%!important;
  box-sizing:border-box!important;
  display:flex!important;
  justify-content:flex-end!important;
  flex-wrap:nowrap!important;
  gap:8px!important;
  padding:10px 12px!important;
 }
 #modal-root .modal > form > :is(footer,.modal-actions,.m-modal-actions,.v-modal-actions) button{
  flex:0 1 auto!important;
  min-width:0!important;
  max-width:45%!important;
  padding:9px 12px!important;
  font-size:14px!important;
 }
 #modal-root .bb-wizard-stage,
 #modal-root .bb-wizard-question,
 #modal-root .bb-wizard-step,
 #modal-root .bb-wizard-step > label{
  box-sizing:border-box!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
 }
 #modal-root .bb-wizard-question{
  min-height:0!important;
  max-height:calc(var(--bb-dialog-vh,100dvh) - 158px)!important;
  overflow-y:auto!important;overflow-x:hidden!important;
 }
 #modal-root .bb-wizard-step input:not([type=checkbox]):not([type=radio]),
 #modal-root .bb-wizard-step textarea,
 #modal-root .bb-wizard-step select{
  display:block;box-sizing:border-box!important;max-width:100%!important;
  min-width:0!important;width:100%!important;
  font-size:16px!important;line-height:1.35!important;
 }
 #modal-root .s-form-grid{grid-template-columns:minmax(0,1fr)!important;min-width:0!important}
 #modal-root .bb-dialog-keyboard .modal{max-height:calc(var(--bb-dialog-vh) - 12px)!important}
 #modal-root .bb-dialog-keyboard .modal > form{max-height:calc(var(--bb-dialog-vh) - 14px)!important}
 #modal-root .bb-dialog-keyboard .modal > form > header{padding:10px 14px!important}
 #modal-root .bb-dialog-keyboard .bb-wizard-progress{margin:3px 0 10px!important}
 #modal-root .bb-dialog-keyboard .bb-wizard-question{max-height:calc(var(--bb-dialog-vh) - 138px)!important}
 #modal-root .bb-dialog-keyboard .modal > form > :is(footer,.modal-actions,.m-modal-actions,.v-modal-actions){
  padding:8px 12px!important;
 }
}

/* Prevent automatic Safari focus zoom in *all* dialogs, not only wizard steps.
   Do not disable user pinch-to-zoom. */
@media(max-width:700px){
 #modal-root :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){
  font-size:16px!important;
  line-height:1.4!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
 }
 #modal-root .modal,
 #modal-root .modal > form,
 #modal-root .modal :is(header,footer,.s-modal-body,.m-modal-fields,.mp-modal-body,.v-form-fields,.bb-wizard-stage){
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
 }
}

/* Shared file references appear in the selected department folders. */
.bb-linked-files{margin:20px 0 12px;padding:16px;border:1px solid var(--theme-border,#57404b);border-radius:12px;background:var(--theme-surface,#050505)}
.bb-linked-files h3{font-size:13px;font-weight:700;color:var(--theme-text,#fff);margin:0 0 12px}
.bb-linked-files-list{display:flex;flex-wrap:wrap;gap:8px}
.bb-linked-file{font:inherit;font-size:12px;line-height:1.4;text-align:left;color:var(--theme-text,#eee);background:var(--theme-elevated,#0d090b);border:1px solid var(--theme-border,#57404b);border-radius:8px;padding:10px 12px;cursor:pointer;max-width:100%;overflow-wrap:anywhere}
.bb-linked-file:hover{border-color:var(--theme-brand,#dfb3c3)}

/* Universal plain-language form wizard: one decision at a time across departments. */
#modal-root .bb-wizard-help{
 display:block;margin-top:10px;color:var(--theme-muted,#b8aab0);
 font-size:12px;line-height:1.6;font-weight:400;overflow-wrap:anywhere;
}
#modal-root .bb-wizard-step>label:has(input,select,textarea)>span:first-child,
#modal-root .bb-wizard-step>label>strong:first-child,
#modal-root .bb-wizard-step .mp-format-group>strong{
 display:block;font-size:15px!important;line-height:1.45;font-weight:750;
 color:var(--theme-text,#f8f2f4);
}
#modal-root .bb-wizard-step .mp-format-group{
 width:100%;max-width:100%;grid-template-columns:minmax(0,1fr);
 background:transparent;border:1px solid var(--theme-border,#523943);
 border-radius:10px;padding:14px;box-sizing:border-box;gap:10px;
}
#modal-root .bb-wizard-step .mp-format-group .mp-format-main,
#modal-root .bb-wizard-step .mp-format-group .mp-story-sub{
 min-height:30px;font-size:13px;line-height:1.4;
}
#modal-root .bb-wizard-step .s-avail-input-row{
 display:grid!important;grid-template-columns:minmax(0,1fr)!important;
 gap:10px!important;padding:4px 0!important;min-width:0!important;
}
#modal-root .bb-wizard-step .s-avail-input-row :is(select,input){
 display:block;width:100%!important;max-width:100%!important;min-height:42px;
 padding:9px 10px;box-sizing:border-box;font-size:16px;
 background:var(--theme-elevated,#0d090b);color:var(--theme-text,#f4f0f2);
 border:1px solid var(--theme-border,#573f4b);border-radius:8px;
}
#modal-root .modal>form>.l-modal-content{
 flex:1 1 auto;min-height:0;min-width:0;max-width:100%;
 overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
}
@media(max-width:700px){
 #modal-root .modal>form>.l-modal-content{
  padding:12px 15px!important;
  min-height:0!important;max-width:100%!important;
  box-sizing:border-box!important;
 }
 #modal-root .l-modal>form{
  display:flex!important;flex-direction:column!important;
  min-height:0!important;max-height:calc(var(--bb-dialog-vh,100dvh) - 22px)!important;
 }
 #modal-root .bb-wizard-step .mp-format-group{padding:12px}
}

/* Progressive forms: only the active question occupies the dialog.
   One-time form instructions are tucked into that first step, never sticky. */
#modal-root .modal :is(.mp-modal-body,.m-modal-fields,.s-modal-body,.v-form-fields,.mm-dialog-fields,.l-modal-content):has(> .bb-wizard-stage){
 display:block;
}
#modal-root .mp-modal:has(.bb-wizard-stage) .bb-wizard-question{
 min-height:0;
 max-height:min(54dvh,430px);
}
#modal-root .bb-wizard-extra-context{
 border-top:1px solid var(--theme-border,#4e3844);
 margin-top:15px;padding:10px 0 0;max-width:100%;
 color:var(--theme-muted,#ae9da6);
}
#modal-root .bb-wizard-extra-context summary{
 font-size:11px;line-height:1.4;font-weight:650;cursor:pointer;
 color:var(--theme-muted,#b4a6ad);
}
#modal-root .bb-wizard-extra-context[open]{
 display:grid;gap:10px;
}
#modal-root .bb-wizard-extra-context> :not(summary){
 font-size:11px;line-height:1.6;margin-top:10px;
 overflow-wrap:anywhere;
}
#modal-root .bb-wizard-once-warning{
 margin-top:13px;border-left:2px solid var(--theme-brand,#c999ac);
 padding:8px 10px;background:var(--theme-elevated,#100b0e);
 border-radius:0 6px 6px 0;font-size:11px;line-height:1.6;
}
#modal-root .bb-wizard-once-warning> :first-child{margin-top:0}
#modal-root .bb-wizard-once-warning> :last-child{margin-bottom:0}
@media(max-width:700px){
 #modal-root .mp-modal:has(.bb-wizard-stage) .bb-wizard-question{
  min-height:0!important;
  max-height:calc(var(--bb-dialog-vh,100dvh) - 155px)!important;
 }
}

#modal-root .bb-wizard-once-context{
 margin-top:11px;color:var(--theme-muted,#afa2ab);
 font-size:11px;line-height:1.5;
}
#modal-root .bb-wizard-once-context>*{margin:0;line-height:inherit;font-size:inherit}
