/* Attribution is the last part of confirmation, separate from order entry.
   Scope every override to this component so other drawers keep their layout. */
.service-allocation{--allocation-error:#a73328;margin:10px 0 0;padding:10px 0 0;border-top:1px solid var(--line);font-size:13px;min-width:0;flex:none}
.service-allocation-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}
.service-allocation-toggle{display:inline-flex;align-items:center;gap:8px;min-height:30px;font-weight:500;cursor:pointer}
.service-allocation-toggle input{width:16px;height:16px;flex:none;margin:0;accent-color:var(--text)}
.service-allocation-head>span,.service-allocation-note,.service-allocation-sales-head>span{font-size:12px;color:var(--muted)}
.service-allocation-note{margin:2px 0 5px;line-height:1.5}
.service-allocation-empty{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px}
.service-allocation-empty>span{font-size:12px;color:var(--muted)}
.service-allocation .service-allocation-person-row{display:grid;grid-template-columns:minmax(120px,1fr) 115px minmax(84px,.7fr) 104px;align-items:end;gap:8px;padding:6px 0;border-bottom:1px solid var(--line)}
.service-allocation .service-allocation-person-row.has-behavior{grid-template-columns:minmax(120px,1fr) 115px 76px 68px minmax(84px,.7fr) 104px}
.service-allocation .service-allocation-person-row.has-friends.has-behavior{grid-template-columns:minmax(110px,1fr) 108px 66px 72px 64px minmax(78px,.7fr) 100px}
.service-allocation .field{margin:0;gap:3px;font-size:12px;min-width:0}
.service-allocation .field input,.service-allocation .field select{min-height:34px;height:34px;padding:5px 7px;font-size:13px;width:100%;min-width:0}
.service-allocation .field>span{white-space:nowrap}
.service-allocation .allocation-check{min-height:34px;font-size:12px;gap:5px;white-space:nowrap}
.service-allocation .allocation-check input{width:15px;height:15px;flex:none}
.service-allocation .service-allocation-number input{font-family:var(--font-number);font-variant-numeric:tabular-nums;text-align:right}
.service-allocation .service-allocation-number input[aria-invalid=true]{border-color:var(--allocation-error);box-shadow:0 0 0 1px var(--allocation-error)}
.service-allocation-sale{display:flex;flex-direction:column;gap:3px;min-height:53px;justify-content:flex-end;text-align:right;min-width:0}
.service-allocation-sale>span{font-size:11px;color:var(--muted)}
.service-allocation-sale>strong{font-family:var(--font-number);font-variant-numeric:tabular-nums;font-size:14px;font-weight:500;min-height:34px;display:flex;align-items:center;justify-content:flex-end;overflow-wrap:anywhere}
.service-allocation-row-actions{display:flex;justify-content:flex-end;align-items:center;gap:6px;min-height:34px}
.service-allocation-row-actions>.btn{min-height:34px;padding:5px 0;font-size:11px;white-space:nowrap}
.service-allocation .allocation-add{margin:7px 0;max-width:330px;align-items:end}
.service-allocation .allocation-add>.btn{min-height:34px;height:34px;padding:5px 12px}
.service-allocation-totals{display:flex;align-items:center;flex-wrap:wrap;gap:6px 18px;margin:7px 0 0;padding:7px 10px;background:var(--surface-alt,#f7f8f6);border-radius:7px}
.service-allocation-totals>div{display:flex;align-items:baseline;gap:6px;color:var(--text);font-variant-numeric:tabular-nums}
.service-allocation-totals>div>span,.service-allocation-totals small,.service-allocation-totals>span{font-size:11px;color:var(--muted)}
.service-allocation-totals strong{font-family:var(--font-number);font-size:14px;font-weight:500}
.service-allocation-totals .is-unbalanced,.service-allocation-totals .is-unbalanced>span{color:var(--allocation-error)}
.service-allocation .service-allocation-sales{margin-top:10px}
.service-allocation-sales-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0 0 3px}
.service-allocation-sales-head>b{font-size:12px;font-weight:500}
.service-allocation .service-allocation-owner-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(80px,.3fr) 150px 72px;align-items:center;gap:10px;padding:7px 0}
.service-allocation-item{border-bottom:1px solid var(--line);padding-bottom:3px}
.service-allocation-item:last-child{border-bottom:0}
.service-line-split{margin:0 0 8px;padding:4px 10px 7px;background:var(--surface-alt,#f7f8f6);border-radius:7px}
.service-line-split-row{display:grid;grid-template-columns:minmax(110px,1fr) minmax(100px,1fr) 74px;align-items:end;gap:10px;padding:4px 0}
.service-line-split-row input{text-align:right;font-variant-numeric:tabular-nums}
.service-line-split-row input[aria-invalid=true]{border-color:var(--allocation-error)}
.service-split-quantity{font-size:11px;color:var(--muted);align-self:center;text-align:center}
.service-line-split-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px;font-variant-numeric:tabular-nums}
.service-line-split-foot .is-unbalanced{color:var(--allocation-error)}
.service-allocation-item .btn{padding:5px 4px;font-size:12px}
.service-allocation .allocation-add{margin-top:0;margin-bottom:8px}
.service-allocation-line-name{min-width:0}
.service-allocation-line-name>b{display:block;font-size:13px;font-weight:500;line-height:1.4}
.service-allocation .service-allocation-line-name>small{display:block;margin:1px 0 0;font-size:11px;color:var(--muted)}
.service-allocation-line-amount{font-family:var(--font-number);font-variant-numeric:tabular-nums;font-size:13px;font-weight:500;text-align:right;overflow-wrap:anywhere}
.service-allocation-excluded{font-size:12px;color:var(--muted);text-align:right}
.service-allocation .allocation-error{margin:7px 0 0;color:var(--allocation-error);font-size:12px;line-height:1.5}
.service-allocation .allocation-error[hidden]{display:none}
.service-allocation input:focus-visible,.service-allocation select:focus-visible,.service-allocation .btn:focus-visible{outline:2px solid var(--text);outline-offset:2px}
@media(max-width:800px){
 .service-allocation .service-allocation-person-row,.service-allocation .service-allocation-person-row.has-behavior,.service-allocation .service-allocation-person-row.has-friends.has-behavior{grid-template-columns:minmax(0,1fr) repeat(2,minmax(64px,.6fr));gap:6px 8px}
 .service-allocation .allocation-person{grid-column:span 2}
 .service-allocation .allocation-check{grid-column:span 1;justify-content:flex-end}
 .service-allocation-row-actions{grid-column:1/-1;min-height:28px}
 .service-allocation-sale{min-height:53px}
}
@media(max-width:560px){
 .service-allocation-head{align-items:flex-start;flex-wrap:wrap;gap:2px 8px}
 .service-allocation-toggle{min-height:44px;font-size:14px}
 .service-allocation-head>span{margin-left:24px;font-size:11px}
 .service-allocation .field input,.service-allocation .field select{min-height:44px;height:44px;font-size:16px}
 .service-allocation .allocation-check{min-height:44px;font-size:11px;white-space:normal;text-align:right}
 .service-allocation .allocation-add{max-width:none}
 .service-allocation .allocation-add>.btn,.service-allocation-row-actions>.btn{min-height:44px;height:44px;font-size:12px}
 .service-allocation .service-allocation-owner-row{grid-template-columns:minmax(0,1fr) 88px;gap:4px 8px;padding:7px 0}
 .service-allocation .service-allocation-owner-row>.field,.service-allocation .service-allocation-owner-row>.service-allocation-excluded{grid-column:1/-1}
 .service-allocation-sales-head{align-items:flex-start;flex-wrap:wrap}
 .service-allocation-totals{gap:6px 12px}
}
