.tenant-user-menu { width:min(340px, calc(100vw - 24px)); padding:8px 0; border:1px solid #e3e7ef; box-shadow:0 10px 30px rgba(31,45,61,.16); }
.tenant-user-menu-identity { display:flex; flex-direction:column; gap:3px; padding:12px 16px; }
.tenant-user-menu-identity strong { color:#28314a; font-size:14px; line-height:1.25; overflow-wrap:anywhere; }
.tenant-user-menu-identity span { color:#7a8398; font-size:12px; line-height:1.3; overflow-wrap:anywhere; }
.tenant-user-menu .dropdown-item { width:100%; min-height:38px; display:flex; align-items:center; gap:8px; padding:8px 16px; border:0; background:transparent; color:#343a50; text-decoration:none; text-align:left; }
.tenant-user-menu .dropdown-item:hover,.tenant-user-menu .dropdown-item:focus { background:#f1f4fb; color:#2d55c7; outline:0; }
.tenant-switch-heading { padding:8px 16px 5px; color:#6f7890; font-size:11px; font-weight:700; text-transform:uppercase; }
.tenant-switch-list { display:grid; gap:2px; padding:0 8px 6px; }
.tenant-switch-list form { margin:0; }
.tenant-switch-option { justify-content:space-between; border-radius:4px !important; }
.tenant-switch-option > span:first-child { display:flex; min-width:0; flex-direction:column; gap:2px; }
.tenant-switch-option strong,.tenant-switch-option small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tenant-switch-option.is-current { background:#edf2ff; color:#2d55c7; cursor:default; opacity:1; }

.cms-detail-actions,.cms-builder-actions,.cms-builder-languages { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cms-layout-fieldset { grid-column:1 / -1; border:0; padding:0; margin:0; min-width:0; }
.cms-layout-fieldset legend { margin-bottom:8px; font-size:13px; font-weight:600; }
.cms-layout-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:10px; }
.cms-layout-card { position:relative; display:flex; min-height:150px; flex-direction:column; gap:6px; padding:12px; border:1px solid #dce2ec; background:#fff; cursor:pointer; }
.cms-layout-card:hover { border-color:#9fb4ea; }
.cms-layout-card:has(input:checked) { border-color:#3f6ad8; box-shadow:inset 0 0 0 1px #3f6ad8; background:#f6f8ff; }
.cms-layout-card input { position:absolute; top:10px; right:10px; }
.cms-layout-card strong { padding-right:22px; font-size:13px; }
.cms-layout-card small { color:#778099; line-height:1.35; }
.cms-layout-scheme { display:grid; height:54px; grid-template-columns:1fr 1fr; gap:4px; padding:6px; border:1px solid #e1e5ed; background:#f4f6fa; }
.cms-layout-scheme i { display:block; background:#ccd5e6; }
.cms-layout-text_only .cms-layout-scheme { grid-template-columns:1fr; }
.cms-layout-text_image_below .cms-layout-scheme { grid-template-columns:1fr; grid-template-rows:1fr 12px; }
.cms-layout-text_image_below .cms-layout-scheme i:nth-child(2) { grid-column:1; }
.cms-layout-text_image_side .cms-layout-scheme { grid-template-columns:2fr 1fr; }
.cms-layout-hero_text .cms-layout-scheme { grid-template-columns:1fr; grid-template-rows:20px 1fr; }
.cms-layout-institutional_landing .cms-layout-scheme { grid-template-columns:1fr 1fr 1fr; }
.cms-layout-scheme-inherited { border-style:dashed; }

.cms-builder-header > span:nth-child(2) { display:flex; flex-direction:column; gap:2px; }
.cms-builder-header small { color:#778099; font-weight:400; }
.cms-builder-meta { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:14px; }
.cms-builder-meta > div { display:flex; flex-direction:column; gap:3px; padding:12px; border:1px solid #e2e6ee; background:#f8f9fb; }
.cms-builder-meta span,.cms-builder-meta small { color:#778099; font-size:12px; }
.cms-builder-languages { margin-bottom:16px; }
.cms-builder-language-link { min-width:124px; flex-direction:column; justify-content:center; gap:2px; text-align:center; }
.cms-builder-language-link small { color:inherit; font-size:11px; line-height:1.2; }
.cms-builder-translation-panel,.cms-create-section { margin-bottom:16px; padding:16px; border:1px solid var(--tp-border); background:var(--tp-surface); }
.cms-builder-translation-panel h3,.cms-create-section h3 { margin:0 0 14px; color:var(--tp-text); font-size:15px; }
.cms-content-create .card-header > span:nth-child(2) { display:flex; flex-direction:column; gap:2px; }
.cms-content-create .card-header small { color:var(--tp-muted); font-weight:400; }
.cms-builder-sections { display:grid; gap:12px; }
.cms-builder-section { border:1px solid #dfe4ed; background:#fff; }
.cms-builder-section > header { display:flex; align-items:center; gap:10px; padding:12px 14px; border-bottom:1px solid #e8ebf1; }
.cms-builder-section > header > span:nth-child(2) { display:flex; min-width:0; flex:1; flex-direction:column; gap:2px; }
.cms-builder-section > header small { color:#778099; }
.cms-builder-section > p,.cms-builder-section > form,.cms-builder-section > .alert { margin:14px; }
.cms-section-order { display:grid; width:28px; height:28px; place-items:center; background:#edf2ff; color:#3157c8; font-weight:700; }
.rich-text-toolbar { display:flex; align-items:center; gap:4px; flex-wrap:wrap; padding:8px; border:1px solid #ccd3df; border-bottom:0; background:#f5f7fa; }
.rich-text-toolbar button { min-width:34px; height:32px; display:inline-flex; align-items:center; justify-content:center; padding:0 8px; border:1px solid #cfd6e2; background:#fff; color:#33415f; cursor:pointer; }
.rich-text-toolbar button:hover,.rich-text-toolbar button:focus { border-color:#3f6ad8; color:#2d55c7; outline:0; }
.rich-text-editor { min-height:280px; padding:16px; border:1px solid #ccd3df; background:#fff; line-height:1.6; overflow-wrap:anywhere; }
.rich-text-editor:focus { border-color:#3f6ad8; box-shadow:0 0 0 2px rgba(63,106,216,.14); outline:0; }
.rich-text-editor h2,.rich-text-editor h3,.rich-text-editor h4,.cms-preview-rich-text h2,.cms-preview-rich-text h3,.cms-preview-rich-text h4 { margin:1em 0 .45em; }
.rich-text-editor p,.cms-preview-rich-text p { margin:.65em 0; }
.rich-text-editor ul,.rich-text-editor ol,.cms-preview-rich-text ul,.cms-preview-rich-text ol { padding-left:24px; }

@media (max-width: 767px) {
    .cms-builder-header { align-items:flex-start; flex-wrap:wrap; }
    .cms-builder-actions { width:100%; }
    .cms-builder-actions .btn { flex:1 1 auto; justify-content:center; }
    .cms-builder-meta { grid-template-columns:1fr; }
    .cms-layout-cards { grid-template-columns:1fr; }
    .rich-text-toolbar button { min-width:38px; }
}
.cms-builder-shell,.cms-builder-canvas,.cms-builder-panel,.cms-builder-block{background:var(--tp-surface)!important;color:var(--tp-text)!important;border-color:var(--tp-border)!important}.cms-builder-block:hover,.cms-builder-block.is-selected{background:var(--tp-hover)!important}.cms-builder-toolbar,.cms-builder-sidebar{background:var(--tp-surface-alt)!important;border-color:var(--tp-border)!important}
.tenant-user-menu,.cms-layout-card,.cms-builder-meta>div,.cms-builder-section,.rich-text-editor{background:var(--tp-surface)!important;color:var(--tp-text)!important;border-color:var(--tp-border)!important}
.tenant-user-menu-identity strong,.tenant-user-menu .dropdown-item,.cms-layout-card strong,.cms-builder-header,.cms-builder-section>header,.rich-text-editor{color:var(--tp-text)!important}
.tenant-user-menu-identity span,.tenant-switch-heading,.cms-layout-card small,.cms-builder-header small,.cms-builder-meta span,.cms-builder-meta small,.cms-builder-section>header small{color:var(--tp-muted)!important}
.tenant-user-menu .dropdown-item:hover,.tenant-user-menu .dropdown-item:focus,.tenant-switch-option.is-current,.cms-layout-card:has(input:checked),.cms-builder-block:hover,.cms-builder-block.is-selected{background:var(--tp-hover)!important;color:var(--tp-text)!important}
.cms-layout-card:hover,.cms-layout-card:has(input:checked),.rich-text-toolbar button:hover,.rich-text-toolbar button:focus,.rich-text-editor:focus{border-color:var(--tp-focus)!important}
.cms-layout-scheme,.rich-text-toolbar{background:var(--tp-surface-alt)!important;color:var(--tp-text)!important;border-color:var(--tp-border)!important}
.cms-layout-scheme i{background:var(--tp-border)!important}
.cms-section-order{background:var(--tp-hover)!important;color:#2d55c7!important}
.cms-layout-card:has(input:checked){background:#f6f8ff!important;border-color:var(--primary)!important;box-shadow:inset 0 0 0 1px var(--primary)!important}
[data-theme="dark"] .cms-section-order{color:var(--tp-focus)!important}
[data-theme="dark"] .cms-layout-card:has(input:checked){background:#1b304f!important;border-color:#7fa5ff!important;box-shadow:inset 0 0 0 1px #7fa5ff!important}
@media(prefers-color-scheme:dark){
  [data-theme="auto"] .cms-section-order{color:var(--tp-focus)!important}
  [data-theme="auto"] .cms-layout-card:has(input:checked){background:#1b304f!important;border-color:#7fa5ff!important;box-shadow:inset 0 0 0 1px #7fa5ff!important}
}
.rich-text-toolbar button{background:var(--tp-input)!important;color:var(--tp-text)!important;border-color:var(--tp-border)!important}
.rich-text-toolbar button:hover,.rich-text-toolbar button:focus{background:var(--tp-hover)!important;color:var(--tp-text)!important}
