/* Category navigation is global; screen commands stay beside their workspace. */
.app{grid-template-columns:minmax(0,1fr);min-width:0}
.compact-topbar{height:56px;min-height:56px;padding:0 16px;gap:16px;z-index:110;background:#fff;flex-shrink:0}
.compact-brand{font-size:14px;font-weight:750;color:#243b48;white-space:nowrap;flex-shrink:0}.compact-brand span{font-weight:500}.compact-brand small{margin-left:7px;padding:3px 5px;background:#fff0d4;border-radius:4px;font-size:10px}
.workspace-navigation{display:flex;align-items:center;gap:4px;min-width:0;flex:1;overflow-x:auto;scrollbar-width:thin;height:100%}
.nav-category{display:flex;align-items:center;flex-shrink:0;border-radius:6px;color:#526875}.nav-category.active{background:#e8f4f0;color:#166c5b}
.category-link{border:0;background:transparent;color:inherit;font:inherit;font-size:12px;font-weight:650;cursor:pointer;white-space:nowrap;padding:10px;border-radius:6px}
.category-link:hover{background:#edf4f2}.category-link:focus-visible,.header-menu summary:focus-visible{outline:2px solid #138878;outline-offset:-2px}
.header-menu{flex-shrink:0}.header-menu>summary{display:flex;align-items:center;gap:6px;height:34px;padding:0 9px;cursor:pointer;border:1px solid #d4dfe4;border-radius:6px;font-size:12px;color:#34515d;list-style:none;white-space:nowrap}.header-menu>summary::-webkit-details-marker{display:none}.header-menu>summary:hover,.header-menu[open]>summary{background:#edf6f4;border-color:#8ab9ae}.header-menu .icon{width:15px;height:15px}
.settings-menu>summary{border:0;font-weight:650;font-size:12px;padding:0 8px}
.header-menu-panel{position:fixed;top:54px;right:16px;width:296px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 116px);overflow:auto;padding:10px;background:#fff;border:1px solid #d6e1e6;border-radius:10px;box-shadow:0 12px 35px #14323c30;z-index:160}
.menu-section{display:grid;grid-template-columns:1fr;gap:3px;padding:7px 0;border-bottom:1px solid #e7edef}.menu-section:last-child{border-bottom:0}.menu-section>strong{font-size:11px;color:#7d909a;padding:0 8px 5px}.menu-section .btn{height:auto;min-height:36px;justify-content:flex-start;white-space:normal;font-size:12px;padding:8px;text-align:left}.menu-section p{font-size:11px;color:#7d909a;line-height:1.5;margin:3px 8px}
.compact-topbar .compact-actions{margin-left:auto;gap:8px;min-width:0;flex-shrink:0;flex-wrap:nowrap;padding:4px 0;overflow:visible}
.compact-select{display:flex;flex-direction:column;align-items:flex-start;gap:2px;font-size:9px;white-space:nowrap;color:#657b89;flex-shrink:0;margin:0}.compact-select select{width:120px;height:28px;padding:0 22px 0 7px;border:1px solid #d4dfe4;border-radius:5px;background:#fff;color:#29434e;font:inherit;font-size:11px;text-overflow:ellipsis}.compact-select.is-scenario select{background:#fff4dd;border-color:#dab865;color:#735119}.compact-select:has(#active-scenario) select{width:155px}
.compact-topbar .compact-save{height:32px;min-height:32px;font-size:11px;padding:0 10px;gap:5px;flex-shrink:0}
.organization-toolbar,.work-toolbar{height:48px;min-height:48px;padding:0 16px;flex-shrink:0}.organization-toolbar{z-index:100;gap:10px}.organization-toolbar .toolbar-left,.organization-toolbar .toolbar-right{gap:7px;min-width:0}.organization-toolbar .toolbar-left{flex:1}.organization-toolbar .toolbar-right{flex-shrink:0}.organization-toolbar .btn,.work-toolbar .btn{height:32px;min-height:32px;font-size:11px;padding:0 10px}.organization-toolbar .icon-button{width:30px;height:30px}.organization-toolbar .toolbar-divider{margin:0 2px;height:21px}
.compact-view{display:flex;align-items:center;flex-shrink:0;gap:2px;padding:2px;background:#edf3f5;border-radius:7px}.compact-view .btn{height:28px;min-height:28px;padding:0 8px;font-size:11px;border:0;background:transparent;gap:5px}.compact-view .active{background:#fff;color:#087b70;box-shadow:0 1px 4px #17333d16}.compact-view .icon{width:14px;height:14px}
.entity-menu>summary{height:32px}.entity-menu>summary>span{max-width:125px;overflow:hidden;text-overflow:ellipsis}.entity-menu-panel{top:102px;width:296px}.entity-menu-panel .country-tabs{display:flex;flex-direction:column;height:auto;gap:2px;align-items:stretch}.entity-menu-panel .country-tab{min-height:38px;height:auto;padding:9px 12px;border:0;border-radius:5px;justify-content:flex-start;flex-shrink:0}.entity-menu-panel .country-tab.active{background:#e9f5f1;color:#087565}.entity-menu-panel .country-tab.active:after{display:none}
.organization-toolbar .compact-search{width:230px;min-width:130px;flex-shrink:1}.compact-search input{height:32px;padding-right:8px;font-size:11px}.compact-search .search-results{position:fixed;top:102px;left:16px;right:auto;width:360px;max-width:calc(100vw - 32px);z-index:162}
@media(max-width:1250px){.compact-brand span{display:none}.compact-topbar{padding:0 12px;gap:10px}.workspace-navigation{gap:0}.compact-select select{width:105px}.compact-select:has(#active-scenario) select{width:135px}.compact-topbar .compact-actions{gap:6px}.category-link{padding:10px 8px}}
@media(max-width:1000px){.compact-brand{display:none}.compact-topbar{gap:8px;padding:0 8px}.category-link,.settings-menu>summary{font-size:11px}.compact-select select{width:95px}.compact-select:has(#active-scenario) select{width:120px}.organization-toolbar{padding:0 10px}.organization-toolbar .toolbar-left,.organization-toolbar .toolbar-right{gap:4px}.organization-toolbar .btn{padding:0 7px}.entity-menu>summary>span{max-width:90px}.organization-toolbar .compact-search{width:170px;min-width:115px}}
@media(max-width:760px){.compact-topbar{height:98px;min-height:98px;flex-wrap:wrap;gap:0;padding:0 8px}.workspace-navigation{order:2;width:100%;flex-basis:100%;height:42px}.compact-topbar .compact-actions{width:100%;justify-content:flex-end;height:52px}.compact-select{flex:1}.compact-select select,.compact-select:has(#active-scenario) select{width:100%;max-width:220px}.category-link,.settings-menu>summary{font-size:12px}.organization-toolbar{overflow-x:auto;overflow-y:hidden}.organization-toolbar .toolbar-left{flex:none}.organization-toolbar .compact-search{width:150px}.compact-search .search-results{top:146px}.header-menu-panel{max-height:calc(100dvh - 160px)}}
/* Editing continuity and readable placement. */
.assignment-buttons{display:flex;align-items:stretch;gap:10px;flex-wrap:wrap;margin-top:16px}
.assignment-buttons .btn{height:36px;font-size:12px;padding:0 12px;margin:0;display:inline-flex;align-items:center;justify-content:center}
.edit-destination{display:flex;flex-direction:column;gap:6px;font-size:13px}
.edit-destination small{line-height:1.5}
.dialog-error{padding:12px;border:1px solid #f4a5a5;background:#fff1f1;color:#9b2020;border-radius:8px}
.dialog-error[hidden]{display:none}
#reorder-marker{position:absolute;pointer-events:none;background:#187bca;border-radius:3px;z-index:8;box-shadow:0 0 0 2px #fff}
#reorder-marker[hidden]{display:none}
.card.drop-target{outline:3px dashed #25836d;outline-offset:5px}
.position-group{position:absolute;pointer-events:none;border:1px solid #c5d6dc;border-radius:10px;background:#edf4f733}
.branch-label{position:absolute;pointer-events:none;font-size:10px;line-height:16px;color:#526d79;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.organization-toolbar .layout-mode-active{background:#dff4ee;border-color:#278a75;color:#126754;box-shadow:inset 0 0 0 1px #278a75}
.position-layout-mode .position-card{cursor:move}
.position-layout-mode .org-card{cursor:default}
.card.layout-collision{outline:3px solid #c85850;outline-offset:3px}
.align-guide-x,.align-guide-y{position:absolute;pointer-events:none;z-index:30}
.align-guide-x{width:0;border-left:2px dashed #2185ca}
.align-guide-y{height:0;border-top:2px dashed #2185ca}

/* Shared-work review leaves card dimensions and organization colors intact. */
.organization-toolbar .overlap-active{background:#fff0ef;border-color:#c85c59;color:#992e2e}
.position-card.overlap-highlight{background:color-mix(in srgb,#d32727 calc(8% + var(--overlap-strength) * 8%),#fff)!important;border-color:#c54848!important;box-shadow:inset 0 0 0 1px #c54848}
.position-card.overlap-highlight.selected{outline:3px solid #a62323;outline-offset:2px}
.overlap-controls{position:absolute;z-index:25;left:16px;bottom:64px;width:270px;max-height:42%;overflow:auto;padding:10px 12px;border:1px solid #e3b8b4;border-radius:8px;background:#fff;box-shadow:0 4px 18px #2222;font-size:11px;color:#573838}
.overlap-controls[hidden]{display:none}.overlap-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.overlap-controls label{display:flex;flex-direction:column;gap:3px;margin-top:5px}.overlap-controls select{width:100%;height:30px;border:1px solid #d9c4c4;border-radius:5px;background:#fff}.overlap-controls p{margin:5px 0}.overlap-controls small{display:block;line-height:1.4;color:#765c5c}.overlap-controls details{margin-top:6px}.overlap-controls summary{cursor:pointer;font-weight:600}

/* Company and Entity stay adjacent beside the save controls. */
.scope-switchers{display:flex;align-items:flex-end;gap:8px;flex-shrink:0;min-width:0}
.scope-switchers .compact-select{font-size:10px;font-weight:500;color:#657b89}
.scope-switchers .compact-select select,.scope-switchers .entity-menu>summary{height:30px;min-height:30px;width:138px;margin:0;border:1px solid #d4dfe4;border-radius:6px;background:#fff;color:#29434e;font-family:inherit;font-size:12px;font-weight:500;line-height:1.2}
.scope-switchers .compact-select select{padding:0 24px 0 9px}
.scope-switchers .entity-menu{width:138px}
.scope-switchers .entity-menu>summary{padding:0 8px 0 9px;justify-content:space-between}
.scope-switchers .entity-menu>summary>span{max-width:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scope-switchers .entity-menu>summary .icon{width:14px;height:14px;flex-shrink:0}
.scope-switchers .entity-menu>summary:hover,.scope-switchers .entity-menu[open]>summary{background:#edf6f4;border-color:#8ab9ae}
.view-tools-menu>summary{height:32px;background:#eff6f4;color:#2e8172;border-color:#d2e8e1;font-size:11px}
.view-tools-panel{width:220px}
.company-management-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:14px 0}
@media(max-width:1250px){.scope-switchers .compact-select select,.scope-switchers .entity-menu,.scope-switchers .entity-menu>summary{width:120px}}
@media(max-width:1000px){.scope-switchers .compact-select select,.scope-switchers .entity-menu,.scope-switchers .entity-menu>summary{width:110px}}
@media(max-width:760px){
 .compact-topbar .scope-switchers{order:1;flex:1 1 auto;height:52px;align-items:center;gap:6px;min-width:0}
 .compact-topbar .compact-actions{order:2;width:auto;flex:0 0 auto;height:52px;justify-content:flex-end}
 .compact-topbar .workspace-navigation{order:3}
 .scope-switchers .compact-select{flex:1 1 0;min-width:0}
 .scope-switchers .compact-select select,.scope-switchers .entity-menu,.scope-switchers .entity-menu>summary{width:100%;max-width:220px;min-width:0}
}

/* Keep the organization type legend aligned at the top of the canvas. */
.canvas-heading .hierarchy-key{margin-top:0}

/* Keep the selected scope's summary between navigation and chart actions. */
.organization-toolbar .toolbar-left{flex:0 1 auto}
.organization-toolbar .scope-summary-slot{display:flex;align-items:center;justify-content:center;flex:1 1 0;min-width:0;container-name:summary-slot;container-type:inline-size}
.organization-toolbar .scope-summary-full{width:max-content;max-width:none;margin:0;padding:3px 8px;min-height:38px;flex-wrap:nowrap;gap:7px}
.summary-count-group{display:inline-flex;flex-direction:column;justify-content:center;gap:1px;min-width:max-content}
.scope-summary .summary-scope-name{display:block;max-width:190px;overflow:hidden;text-overflow:ellipsis;color:#456676;font-size:9px;font-weight:650;line-height:1.2}
.summary-count-values{display:flex;align-items:center;gap:7px}
.organization-toolbar .scope-summary-full .summary-execution{flex-shrink:0;gap:4px;padding-left:7px}
.scope-summary-menu{display:none}
.scope-summary-menu>summary{height:32px;gap:5px;font-size:11px}
.scope-summary-panel{width:296px}
.organization-toolbar .scope-summary-detail{width:100%;max-width:none;margin:0;padding:8px;gap:8px}
.scope-summary-detail .summary-count-group{flex-basis:100%;min-width:0}
.scope-summary-detail .summary-count-values{flex-wrap:wrap}
.scope-summary-detail .summary-scope-name{max-width:100%}
@container summary-slot (max-width:540px){.organization-toolbar .scope-summary-full{display:none}.scope-summary-menu{display:block}}
@container summary-slot (max-width:650px){html[lang="en"] .organization-toolbar .scope-summary-full{display:none}html[lang="en"] .scope-summary-menu{display:block}}
@media(min-width:761px) and (max-width:1500px){.organization-toolbar .compact-search{width:120px;min-width:100px}}
@media(max-width:760px){
 .organization-toolbar{height:auto;min-height:0;flex-wrap:wrap;overflow:visible;gap:6px;padding:6px 8px}
 .organization-toolbar .toolbar-left{order:1;flex:1 1 180px;min-width:0}
 .organization-toolbar .compact-search{width:auto;min-width:65px;flex:1 1 65px}
 .organization-toolbar .scope-summary-slot{order:2;flex:0 0 150px;width:150px}
 .organization-toolbar .toolbar-right{order:3;flex:0 0 100%;width:100%;overflow-x:auto;overflow-y:hidden;padding-bottom:2px}
 .organization-toolbar .scope-summary-full{display:none}.scope-summary-menu{display:block}
 html[lang="en"] .organization-toolbar .scope-summary-slot{flex-basis:136px;width:136px}
 html[lang="en"] .organization-toolbar .compact-search{min-width:55px;flex-basis:55px}
 html[lang="en"] .scope-summary-menu .summary-menu-label{display:none}
}
