#dialog.staff-access-dialog{width:min(930px,calc(100% - 24px));max-width:930px;height:min(920px,calc(100dvh - 28px));max-height:calc(100dvh - 28px);overflow:hidden}
#dialog.staff-access-dialog[open]{display:flex;flex-direction:column}
.staff-access-dialog .modal-head{flex:none}
.staff-access-dialog .modal-body{padding:0;overflow:hidden;display:flex;flex-direction:column;flex:1;min-height:0;max-height:none}
:is(#staff-access-form,#staff-permission-editor)>.error:empty{display:none}
:is(#staff-access-form,#staff-permission-editor){display:flex;flex-direction:column;height:100%;min-height:0;text-align:left}
:is(#staff-access-form,#staff-permission-editor)>.error:not(:empty){padding:8px 18px;margin:0}
.staff-work{flex:1 1 auto;overflow:auto;overscroll-behavior:contain;padding:18px 24px 24px;min-height:0;scrollbar-gutter:stable}
.staff-hero{display:grid;align-items:center;grid-template-columns:48px minmax(0,1fr) auto;gap:14px;padding:18px 24px;background:linear-gradient(115deg,#28201c,#1b1b1d 70%);border-bottom:1px solid var(--line)}
.staff-hero-icon,.staff-module-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;color:#ffa16d;background:#39271e;border:1px solid #63412f}
.staff-hero h3{margin:3px 0;font-size:1.22rem;overflow-wrap:anywhere}
.staff-hero p,.staff-hero dl{margin:0;color:var(--muted);font-size:.815rem}
.staff-hero p strong{color:var(--text)}
.staff-hero dl{display:flex;gap:10px;padding:0}
.staff-hero dl div{padding:8px 10px;border:1px solid var(--line);background:#171719;border-radius:9px;min-width:95px}
.staff-hero dd{margin:3px 0 0;font-size:.95rem;font-weight:700;color:var(--text)}
.staff-section{border:0;margin:0 0 20px;padding:0;min-width:0}
.staff-section legend,.staff-section h3{font-size:1rem;font-weight:720;margin:0 0 9px}
.staff-section legend>span,.staff-section h3>span{font-size:.72rem;font-weight:800;display:inline-grid;place-items:center;width:27px;height:27px;margin-right:7px;color:#ffa16d;background:#39271e;border-radius:8px;vertical-align:middle}
.staff-mode-options,.staff-scope-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.staff-scope-options{grid-template-columns:repeat(3,minmax(0,1fr))}
.staff-option{display:flex;align-items:flex-start;gap:8px;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:10px 12px;cursor:pointer}
.staff-option:has(input:checked){border-color:var(--orange);background:#2b211d}
.staff-option input,.staff-client-choice input{flex:none;accent-color:var(--orange);margin:4px 0}
.staff-option strong,.staff-option small,.staff-module-title strong,.staff-module-title small{display:block;line-height:1.35;overflow-wrap:anywhere}
.staff-option small,.staff-module-title small{color:var(--muted);font-size:.78rem;margin-top:3px}
.staff-guide{border:1px solid #65402d;border-radius:10px;background:#291f1b;margin:8px 0 18px;padding:11px 13px;font-size:.84rem}
.staff-guide strong{color:#ffa16d}.staff-guide p,.staff-actions-help,.staff-module-hint{margin:4px 0;color:var(--muted);line-height:1.48}
.staff-dependency{margin-bottom:12px}
.staff-client-picker{margin:-9px 0 20px;border:1px solid var(--line);padding:12px;border-radius:10px}
.staff-access-client-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.staff-client-list{max-height:170px;overflow:auto;margin-top:8px}
.staff-client-choice{display:flex;gap:9px;align-items:center;padding:7px 4px;cursor:pointer;overflow-wrap:anywhere}
.staff-access-badge{margin-top:8px;color:var(--muted);overflow-wrap:anywhere}
.staff-tools{display:flex;align-items:end;gap:10px;margin-bottom:10px}.staff-tools label{flex:1;min-width:0}
.staff-filters{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.staff-chip{border:1px solid var(--line);background:var(--surface);border-radius:999px;font-size:.79rem;font-weight:700;padding:7px 10px}
.staff-chip[aria-pressed=true]{background:#38251c;border-color:#a85a36;color:#ffc3a1}
.staff-modules{display:grid;gap:8px}
.staff-module{border:1px solid var(--line);border-radius:12px;background:var(--surface);min-width:0}
.staff-module>summary{display:grid;align-items:center;grid-template-columns:36px minmax(0,1fr) auto 16px;gap:10px;padding:9px 12px;cursor:pointer;list-style:none;min-height:54px}
.staff-module>summary::-webkit-details-marker{display:none}
.staff-module[open]>summary{border-bottom:1px solid var(--line)}
.staff-module-icon{width:34px;height:34px;border-radius:9px}.staff-module-icon svg,.staff-hero-icon svg{width:18px;height:18px}
.staff-module-count{font-size:.73rem;padding:5px 7px;border-radius:6px;background:var(--raised);font-variant-numeric:tabular-nums;color:#f6ba99;white-space:nowrap}
.staff-chevron{justify-self:end;transition:transform .15s}.staff-module[open] .staff-chevron{transform:rotate(180deg)}
.staff-module-content{padding:10px 12px}
.staff-module-hint{font-size:.83rem;margin:0 0 8px}
.staff-preset{display:grid;grid-template-columns:max-content minmax(0,1fr) auto;align-items:center;gap:8px;background:#141416;padding:8px;border-radius:8px;font-size:.82rem}
.staff-preset select,.staff-right-choice select{width:100%;min-width:0;min-height:38px;border-radius:8px;border:1px solid var(--line);background:#242427;color:var(--text);padding:6px 8px}
.staff-preset .btn{font-size:.75rem;white-space:normal}
.staff-right-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,195px);gap:12px;border-bottom:1px solid var(--line);padding:10px 2px;align-items:start}
.staff-right-row:last-child{border-bottom:0}
.staff-right-row label{font-size:.89rem;font-weight:700}
.staff-right-row p{margin:4px 0 0;color:var(--muted);line-height:1.5;font-size:.8rem;overflow-wrap:anywhere}
.staff-right-choice{display:grid;justify-items:start;gap:4px}
.staff-state{font-size:.74rem;color:var(--muted)}.staff-state.is-active{color:#a4d9b5}
.staff-access-footer{flex:none;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 22px max(11px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#18181a}
.staff-access-footer p{font-size:.78rem;color:var(--muted);margin:0}
.staff-access-footer>div{display:flex;gap:8px}.staff-access-footer .btn{white-space:normal}
@media(max-width:600px){
 #dialog.staff-access-dialog{width:calc(100% - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)}

 .staff-work{padding:14px 12px 16px;scrollbar-gutter:auto}.staff-hero{grid-template-columns:40px minmax(0,1fr);gap:8px;padding:12px}
 .staff-hero dl{grid-column:1/-1;justify-content:stretch;gap:6px}.staff-hero dl div{flex:1;padding:5px 8px}.staff-hero h3{font-size:1.07rem}
 .staff-scope-options,.staff-mode-options{grid-template-columns:1fr;gap:6px}
 .staff-option{padding:8px 10px}.staff-option small{line-height:1.3}
 .staff-right-row{grid-template-columns:minmax(0,1fr);gap:6px}.staff-right-choice{grid-template-columns:minmax(0,1fr) 70px;align-items:center}
 .staff-right-choice select,.staff-preset select{min-height:44px;font-size:16px}
 .staff-preset{grid-template-columns:minmax(0,1fr) auto}.staff-preset label{grid-column:1/-1}.staff-preset .btn{padding-inline:6px}
 .staff-access-footer{flex-wrap:wrap;padding:8px 11px max(8px,env(safe-area-inset-bottom));gap:6px}.staff-access-footer>div{width:100%}.staff-access-footer .btn{flex:1;min-height:42px}
}
.staff-role-hint{display:block;color:var(--muted);font-size:.75rem;font-weight:400;line-height:1.35;margin-top:3px}
.staff-peer-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}
.staff-peer-card{border:1px solid var(--line);background:var(--surface);padding:12px;border-radius:11px;min-width:0}
.staff-peer-card .field{margin:0}.staff-peer-card select,.staff-peer-card input[type=search]{width:100%;min-width:0}
.staff-peer-card>p{margin:6px 0 0;line-height:1.4}.staff-peer-picker{border-top:1px solid var(--line);margin-top:10px;padding-top:10px}
.staff-peer-picker .staff-client-list{max-height:145px}
.staff-scope-options:has(input[value=inherit]){grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:660px){.staff-peer-grid,.staff-scope-options:has(input[value=inherit]){grid-template-columns:1fr}}
