/* Department membership and task-assignment administration. Scoped to these screens. */
:is(.d130,.tp131),:is(.d130,.tp131) *{box-sizing:border-box}
:is(.d130,.tp131){max-width:1480px;margin:0 auto;color:var(--ink);font-size:15px;line-height:1.5;min-width:0}
.d130-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin:4px 0 24px}
.d130-heading h1{font-size:clamp(23px,2vw,30px);line-height:1.25;letter-spacing:-.5px;margin:0 0 10px;overflow-wrap:anywhere}
.d130-heading p{color:var(--muted);max-width:70ch;margin:0}
.d130-head-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
:is(.d130,.tp131) button{min-height:44px;white-space:normal;line-height:1.4}
:is(.d130,.tp131) label{display:flex;flex-direction:column;gap:7px;font-size:14px;line-height:1.45;min-width:0}
:is(.d130,.tp131) input:not([type=checkbox]),:is(.d130,.tp131) select{min-width:0;width:100%;min-height:46px;font-size:15px}
.d130-status{min-height:24px;overflow-wrap:anywhere;margin:0 0 16px}
.d130-layout{display:grid;grid-template-columns:minmax(260px,320px) minmax(0,1fr);gap:24px;align-items:start}
.d130-sidebar,.d130-content,.tp131 .card,.tp131-notice{padding:24px;border:1px solid var(--line);border-radius:18px;background:var(--surface);min-width:0}
.d130-total{display:flex;gap:9px;align-items:baseline;color:var(--muted);margin:20px 0 16px}.d130-total strong{font-size:25px;color:var(--ink)}
.d130-tree{display:flex;flex-direction:column;gap:5px;max-height:52vh;overflow:auto;overscroll-behavior:contain;padding:3px}
.d130-tree [data-filter]{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;text-align:left;border:1px solid transparent;background:transparent;padding:10px 10px 10px calc(10px + var(--depth,0)*10px);color:var(--ink);border-radius:10px}
.d130-tree [data-filter].active{background:var(--soft);border-color:var(--line);color:var(--accent)}
.d130-tree button span{overflow-wrap:anywhere;min-width:0}.d130-tree b{font-size:12px;font-variant-numeric:tabular-nums;flex-shrink:0}
.d130-node{display:flex;align-items:center;gap:3px}.d130-node [data-filter]{flex:1;min-width:0}.d130-rename,.d130-delete{flex:0 0 34px;padding:4px!important;border:0!important;background:transparent!important}.d130-delete{font-size:20px;line-height:1}
.d130-tree-actions{border-top:1px solid var(--line);margin-top:20px;padding-top:18px}.d130-tree-actions button{width:100%}
.d130-unit-form:empty{display:none}.d130-unit-form{margin-top:24px}.d130-unit-form form{display:flex;flex-direction:column;gap:14px}
.d130-field-note{font-size:13px;line-height:1.6;color:var(--muted);margin:10px 0}
.d130-content h2,.tp131-group h2{font-size:19px;line-height:1.3;margin:0 0 12px}.d130-content-head>p{color:var(--muted);margin:0 0 20px}
.d130-search{max-width:540px}.d130-bulk{padding:18px;margin:24px 0 8px;border-radius:12px;border:1px solid var(--line);background:var(--surface2,var(--surface))}
.d130-bulk form{display:grid;grid-template-columns:1fr;gap:14px}.d130-bulk strong,.d130-bulk small{display:block}.d130-bulk small{color:var(--muted);margin-top:3px}
.d130-bulk button{justify-self:start}.d130-row-count{font-size:13px;color:var(--muted);padding:12px 0}
.d130-person{display:flex!important;flex-direction:row!important;align-items:flex-start;gap:14px!important;padding:18px 12px;border-bottom:1px solid var(--line);border-radius:8px}
.d130-person.selected{background:var(--soft)}.d130-person>span{min-width:0;flex:1}.d130-person strong{display:block;font-size:16px;line-height:1.4;overflow-wrap:anywhere}.d130-person small{display:block;line-height:1.5;margin-top:5px;color:var(--muted);overflow-wrap:anywhere}
:is(.d130,.tp131) input[type=checkbox]{width:20px;height:20px;min-width:20px;flex:0 0 20px;margin:3px 0;accent-color:var(--accent)}
.d130-membership{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px;font-size:13px}.d130-membership>span{font-size:11px;color:var(--muted);padding:2px 7px;border:1px solid var(--line);border-radius:5px}
.tp131-sender{max-width:100%;margin-bottom:18px}.tp131-sender label{max-width:850px}.tp131-sender p{color:var(--muted);font-size:14px;margin:14px 0 0}.tp131 [data-status]{min-height:25px;overflow-wrap:anywhere}
.tp131-notice{background:var(--surface2,var(--surface));margin-bottom:24px}.tp131-notice strong{font-size:18px}.tp131-notice p{margin:12px 0 0;color:var(--muted);line-height:1.6;max-width:100ch}
.tp131-targets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.tp131 .tp131-group{padding:20px}
.tp131-options{display:flex;flex-direction:column;gap:4px;height:390px;overflow:auto;overscroll-behavior:contain;margin-top:18px;padding:4px}
.tp131-options>label{display:flex;flex-direction:row;gap:12px;align-items:flex-start;padding:12px 4px;border-bottom:1px solid var(--line)}.tp131-options>label>span{min-width:0;flex:1}.tp131-options strong{display:block;font-size:14px;line-height:1.5;overflow-wrap:anywhere}.tp131-options small{display:block;color:var(--muted);font-size:12px;margin-top:5px;line-height:1.5;overflow-wrap:anywhere}
.tp131-summary{padding:20px 0;line-height:1.6}.tp131-save{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:16px}
.e130-filter{display:flex;flex-wrap:wrap;align-items:end;gap:14px;margin-bottom:18px}.e130-filter label{min-width:180px;flex:1;max-width:500px}.e130-filter select{width:100%}.e130-filter .active{background:var(--soft);color:var(--accent)}
:root[data-design] body:has(#page .d130) .main>#page,:root[data-design] body:has(#page .tp131) .main>#page{width:100%!important;max-width:none!important;margin-right:0!important}
body:has(#page .d130) .server93,body:has(#page .tp131) .server93{display:none!important}
.tp131 [hidden],.d130 [hidden]{display:none!important}
@media(max-width:1200px){.tp131-targets{grid-template-columns:minmax(0,1fr)}.tp131-options{height:280px}.d130-layout{grid-template-columns:260px minmax(0,1fr);gap:18px}.d130-sidebar,.d130-content{padding:20px}.d130-heading{flex-direction:column}}
@media(max-width:760px){:is(.d130,.tp131){font-size:15px}.d130-layout{grid-template-columns:minmax(0,1fr)}.d130-sidebar,.d130-content,.tp131 .card,.tp131-notice{padding:18px}.d130-heading{gap:16px;margin-bottom:20px}.d130-heading h1{font-size:24px}.d130-head-actions{width:100%}.d130-head-actions button{flex:1;min-width:120px}.d130-tree{max-height:290px}.d130-person{padding:16px 2px}.d130-bulk{padding:14px}.d130-bulk button,.tp131-save button{width:100%}.tp131-save{display:block}.tp131-save button+button{margin-top:12px}:is(.d130,.tp131) input:not([type=checkbox]),:is(.d130,.tp131) select{font-size:16px}.e130-filter{align-items:stretch}.e130-filter label{width:100%;max-width:none}}

/* Multiple organisational memberships: explicit checkboxes and stable primary placement. */
.d133-picker{min-width:0;border:1px solid var(--line);border-radius:12px;padding:14px;margin:0;display:grid;gap:10px}
.d133-picker legend{font-weight:600;font-size:14px;padding:0 6px;line-height:1.4;color:var(--ink)}
.d133-options{max-height:280px;overflow:auto;overscroll-behavior:contain;min-width:0;display:grid;gap:4px}
.d133-option{display:flex!important;align-items:flex-start;gap:10px!important;padding:10px 6px;line-height:1.5;font-size:14px;border-bottom:1px solid var(--line);min-width:0;color:var(--ink)}
.d133-option[hidden]{display:none!important}.d133-option:last-child{border-bottom:0}
.d133-option input[type=checkbox]{width:20px!important;height:20px!important;min-height:20px!important;flex:0 0 20px;margin:2px 0!important;accent-color:var(--accent)}
.d133-option>span{min-width:0;overflow-wrap:anywhere;flex:1}.d133-option small{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.d133-bulk-form{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:14px!important;width:100%}
.d133-bulk-form>div:first-child{display:grid;gap:6px}.d133-bulk-form small{font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.d133-bulk-form button{justify-self:start;min-height:44px;white-space:normal}
.d133-membership{display:block!important;margin-top:5px;padding:5px 8px;border-radius:7px;background:var(--soft);color:var(--accent);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.d133-search input{width:100%;min-height:44px}
.d133-picker [data-d133-count]{font-size:12px;line-height:1.5;color:var(--muted)}
@media(max-width:700px){.d133-picker{padding:10px}.d133-option{font-size:14px;min-height:44px}.d133-search input,.d133-bulk-form select{font-size:16px!important}.d133-options{max-height:240px}.d133-bulk-form button{width:100%}.d133-membership{font-size:12px}}
