.cms-visual-workspace,.cms-inspector { display: contents; }
.editorial-image-thumbnail { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid #e0e5eb; border-radius: 12px; background: #f2f4f7; touch-action: none; cursor: grab; }
.editorial-image-thumbnail.dragging { cursor: grabbing; }
.editorial-image-thumbnail img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.editorial-image-thumbnail span { padding: 24px; color: #7b818a; font-size: 12px; text-align: center; }
body.portal-modern .cms-visual-active .editorial-image-section { display: grid; gap: 12px; padding: 14px; border: 1px solid #e5e8ed; border-radius: 12px; background: #fafbfc; }
body.portal-modern .cms-visual-active .editorial-image-status { min-width: 0; overflow-wrap: anywhere; }
body.portal-modern .cms-visual-active .editorial-image-actions { display: flex; gap: 8px; }
body.portal-modern .cms-visual-active .editorial-image-actions button { flex: 1; padding: 8px; font-size: 10px; }
body.portal-modern .cms-visual-active .editorial-image-crop { margin: 0; padding: 12px 0 0; border: 0; border-top: 1px solid #e5e8ed; background: transparent; }
#cms-global-tools { display: none; }
body.portal-modern:has(#editorial-view:not([hidden])) .topbar { height: auto; min-height: 128px; flex-wrap: wrap; gap: 10px 16px; }
body.portal-modern:has(#editorial-view:not([hidden])) #cms-global-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; width: 100%; }
body.portal-modern:has(#editorial-view:not([hidden])) #session-nav { top: 128px; }
body.portal-modern #cms-global-tools #editorial-pages { flex: 0 1 240px; margin: 0; padding: 0; border: 0 !important; box-shadow: none !important; background: transparent; }
body.portal-modern #cms-global-tools #editorial-pages label { display: block; font-size: 0; }
body.portal-modern #cms-global-tools select { width: 100%; min-height: 34px; padding: 6px 10px; font-size: 12px; }
#cms-global-tools > header { display: flex; align-items: center; gap: 10px; }
#cms-global-tools > header > div:first-child,#cms-global-tools .editorial-header-actions small { display: none; }
body.portal-modern #cms-global-tools #editorial-preview-link { font-size: 10px; color: #65726c; white-space: nowrap; }
#cms-global-tools .cms-canvas-toolbar { display: none; padding: 0; border: 0; background: transparent; }
body:has(#editorial-view.cms-visual-active) #cms-global-tools .cms-canvas-toolbar { display: flex; }
#cms-global-tools > footer { display: flex; gap: 8px; margin-left: auto; }
body.portal-modern #cms-global-tools > footer button { font-size: 10px; min-height: 34px; padding: 8px 10px; }
body.portal-modern #editorial-view.cms-visual-active #editorial-form { gap: 0; }
body.portal-modern #editorial-view.cms-visual-active .cms-visual-workspace { grid-row: 1; height: max(440px,calc(100dvh - 164px)); }
.cms-section-sidebar,.cms-canvas,.cms-inspector-header,#editorial-pages .cms-canvas-toolbar { display: none; }
body.portal-modern #editorial-view.cms-visual-active .editorial-layout { display: block; }
body.portal-modern #editorial-view.cms-visual-active #editorial-pages { margin-bottom: 12px; padding: 10px 14px; }
body.portal-modern #editorial-view.cms-visual-active #editorial-pages label { display: flex; gap: 12px; align-items: center; }
body.portal-modern #editorial-view.cms-visual-active #editorial-page-select { max-width: 300px; }
body.portal-modern #editorial-view.cms-visual-active > .page-heading { margin-bottom: 12px; }
body.portal-modern #editorial-view.cms-visual-active > .page-heading h1 { font-size: 24px !important; }
body.portal-modern #editorial-view.cms-visual-active #editorial-form { display: grid; grid-template-columns: minmax(0,1fr) auto; width: 100%; max-width: none; padding: 0 !important; margin: 0; overflow: hidden; }
body.portal-modern #editorial-view.cms-visual-active #editorial-form > header { grid-column: 1; grid-row: 1; display: flex; align-items: center; padding: 10px 14px; margin: 0; border-bottom: 1px solid #e5e8ed; }
body.portal-modern #editorial-view.cms-visual-active #editorial-form > header > div { display: flex; align-items: center; gap: 8px; }
body.portal-modern #editorial-view.cms-visual-active #editorial-page-label { font-family: inherit; font-size: 16px; font-weight: 650; }
body.portal-modern #editorial-view.cms-visual-active #editorial-page-status { font-size: 9px; padding: 5px 7px; border-radius: 6px; }
body.portal-modern #editorial-view.cms-visual-active .editorial-header-actions small { display: none; }
body.portal-modern #editorial-view.cms-visual-active #editorial-preview-link { border: 0; box-shadow: none; background: transparent; color: #65726c; font-size: 10px; }
body.portal-modern #editorial-view.cms-visual-active #editorial-form > footer { grid-column: 2; grid-row: 1; display: flex; justify-content: flex-end; gap: 8px; padding: 8px 12px; margin: 0; border: 0; border-bottom: 1px solid #e5e8ed; background: #fff; }
.cms-visual-active .cms-visual-workspace { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 140px minmax(240px,1fr) 280px; height: max(420px,calc(100vh - 290px)); min-height: 0; }
.cms-visual-active .cms-section-sidebar { display: block; padding: 14px 10px; overflow-y: auto; border-right: 1px solid #e5e8ed; background: #fafbfc; }
.cms-visual-active :is(.cms-section-sidebar,.cms-inspector) h3 { margin: 0 0 14px; font-size: 13px !important; }
.cms-section-sidebar p { font-size: 11px; color: #7b818a; margin: 18px 4px; }
#cms-section-list { display: grid; gap: 6px; }
body.portal-modern #cms-section-list button { text-align: left; font-size: 11px; font-weight: 500; padding: 9px; overflow-wrap: anywhere; }
body.portal-modern #cms-section-list button[aria-pressed='true'] { background: #eaf8f1 !important; color: #086846 !important; border-color: #bce6d3 !important; }
.cms-visual-active .cms-canvas { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #e9edf1; }
.cms-canvas-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; background: #f8f9fb; border-bottom: 1px solid #dfe3e8; font-size: 11px; color: #68707c; }
.cms-canvas-toolbar > div { display: flex; gap: 4px; }
body.portal-modern .cms-canvas-toolbar button { font-size: 10px; padding: 6px; min-height: 30px; }
body.portal-modern .cms-canvas-toolbar button[aria-pressed='true'] { background: #e2e5ec !important; }
.cms-frame-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#cms-site-frame { position: absolute; top: 12px; left: 12px; border: 0; background: #fff; transform-origin: top left; box-shadow: 0 3px 18px #20242c18; }
#cms-preview-error { position: absolute; inset: 20px; background: #fff; padding: 20px; font-size: 13px; }
.cms-visual-active .cms-inspector { display: block; padding: 14px; min-width: 0; overflow-y: auto; border-left: 1px solid #e5e8ed; }
.cms-visual-active #cms-inspector-heading { display: block; }
body.portal-modern .cms-visual-active :is(.editorial-section,.editorial-item) { margin: 0; padding: 0; border: 0 !important; box-shadow: none !important; }
body.portal-modern #editorial-view.cms-visual-active :is(.editorial-item,.editorial-item-body,.editorial-item-grid,.editorial-section-body) { background: #fff !important; }
.cms-visual-active .editorial-image-crop > p { display: none; }
.cms-visual-active :is(.editorial-section,.editorial-item) > summary { display: none; }
.cms-visual-active .editorial-live-preview { display: none; }
body.portal-modern .cms-visual-active :is(.editorial-section-body,.editorial-item-body,.editorial-item-grid,.editorial-image-field) { display: grid; grid-template-columns: minmax(0,1fr); padding: 0; gap: 12px; }
body.portal-modern .cms-visual-active .editorial-item-grid > * { grid-column: 1 !important; }
body.portal-modern .cms-visual-active .editorial-items-heading { padding: 12px 0; margin: 0; }
.cms-visual-active .editorial-items-heading > div { display: none; }
.cms-visual-active .editorial-item-actions { justify-content: flex-end; padding-bottom: 10px; }
body.portal-modern .cms-visual-active label { font-size: 10px; }
body.portal-modern .cms-visual-active :is(input,textarea,select) { font-size: 12px; }
body.portal-modern .cms-visual-active .editorial-image-actions { flex-wrap: wrap; }
/* Give the site and its settings priority while the visual editor is open. */
body.portal-modern.portal-connected:has(#editorial-view.cms-visual-active:not([hidden])) main { margin-left: 72px; width: calc(100% - 72px); padding: 14px 18px 18px; }
body.portal-modern:has(#editorial-view.cms-visual-active:not([hidden])) #session-nav { width: 72px; padding: 18px 8px; }
body.portal-modern:has(#editorial-view.cms-visual-active:not([hidden])) #session-nav button { justify-content: center; padding: 12px; font-size: 0; gap: 0; }
body.portal-modern:has(#editorial-view.cms-visual-active:not([hidden])) #session-nav button::before { flex-shrink: 0; width: 22px; height: 22px; }
body.portal-modern:has(#editorial-view.cms-visual-active:not([hidden])) #session-email { display: none; }
body.portal-modern:has(#editorial-view.cms-visual-active:not([hidden])) #logout-button { margin-top: auto; }
body.portal-modern:has(#editorial-view.cms-visual-active:not([hidden])) #logout-button::before { display: block; content: '↪'; background: none; mask: none; font-size: 22px; }
body.portal-modern:has(#editorial-view.cms-visual-active:not([hidden])) #session-nav .nav-count-button span { display: none; }
body.portal-modern #editorial-view.cms-visual-active > .page-heading { display: none; }
body.portal-modern #editorial-view.cms-visual-active #editorial-pages { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 8px 12px; margin-bottom: 8px; }
body.portal-modern #editorial-view.cms-visual-active #editorial-pages .cms-canvas-toolbar { display: flex; flex-wrap: wrap; padding: 0; border: 0; background: transparent; }
#editorial-pages .cms-canvas-toolbar > div { flex-wrap: wrap; }
.cms-visual-active .cms-visual-workspace { position: relative; grid-template-columns: minmax(0,1fr) clamp(340px,29vw,440px); height: max(440px,calc(100dvh - 210px)); }
.cms-visual-active .cms-section-sidebar { display: none; position: absolute; z-index: 5; top: 8px; left: 8px; bottom: 12px; width: 210px; border: 1px solid #dfe3e8; border-radius: 10px; box-shadow: 0 6px 24px #17233520; }
.cms-visual-active .cms-sections-open .cms-section-sidebar { display: block; }
.cms-visual-active .cms-canvas { grid-column: 1; grid-row: 1; }
.cms-visual-active .cms-inspector { grid-column: 2; grid-row: 1; padding: 16px 20px; }
.cms-visual-active .cms-inspector-header { position: sticky; top: -16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0 12px; background: #fff; z-index: 2; }
.cms-visual-active .cms-inspector-header h3 { margin: 0; font-size: 15px !important; }
body.portal-modern .cms-visual-active #cms-close-inspector { width: 30px; height: 30px; min-height: 30px; padding: 0; font-size: 22px; border-radius: 50% !important; }
.cms-visual-active .cms-inspector-closed { grid-template-columns: minmax(0,1fr); }
.cms-visual-active .cms-inspector-closed .cms-inspector { display: none; }
body.portal-modern .cms-visual-active :is(input,textarea,select) { font-size: 13px; }
@media(max-width:800px) {
  body.portal-modern.portal-connected:has(#editorial-view.cms-visual-active:not([hidden])) main { margin-left: 0; width: 100%; padding: 10px; }
  body.portal-modern:has(#editorial-view.cms-visual-active:not([hidden])) #session-nav { width: 100%; padding: 6px; }
  body.portal-modern:has(#editorial-view.cms-visual-active:not([hidden])) #logout-button { margin-top: 0; }
  .cms-visual-active .cms-visual-workspace { grid-template-columns: minmax(0,1fr); height: max(500px,calc(100dvh - 240px)); }
  .cms-visual-active .cms-inspector { position: absolute; z-index: 4; right: 0; top: 0; bottom: 0; width: min(380px,92%); background: #fff; box-shadow: -4px 0 20px #17233520; }
  body.portal-modern #editorial-view.cms-visual-active #editorial-form { grid-template-columns: 1fr; }
  body.portal-modern #editorial-view.cms-visual-active #editorial-form > footer { grid-column: 1; grid-row: 2; }
  .cms-visual-active .cms-visual-workspace { grid-row: 3; }
}
