.cw-name{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.cw-chain{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:0;border-radius:8px;background:var(--surface);color:var(--steel);cursor:pointer;flex:none}.cw-chain:hover{color:var(--red);background:var(--red-bg)}.cw-chain svg,.cw-related-toggle svg{width:17px;height:17px}.cw-edit-menu{min-width:235px}.cw-edit-menu>strong{display:block;padding:12px 14px 6px;font-size:12px;color:var(--steel)}.cw-edit-menu>label{display:flex;align-items:center;gap:10px;padding:10px 14px;cursor:pointer;font-size:14px}.cw-edit-menu input{width:16px;height:16px;accent-color:var(--red)}.cw-edit-menu .cw-menu-primary{color:var(--red);border-top:1px solid var(--line);margin-top:5px}.cw-block-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}.cw-related-toggle{display:inline-flex;align-items:center;gap:7px;color:var(--red)}.cw-related-content{animation:cw-unfold .22s ease-out}.cw-related-content .ni-linked-purchases{border:0;padding:6px 0;margin:0}.cw-linked-buyers{display:grid;gap:8px;padding-top:10px}.cw-small{font-size:12px!important;padding:7px 10px!important}.cw-unlink{font-size:11px!important;color:var(--steel)!important}.cw-dialog{margin:auto;inset:0;box-sizing:border-box;width:min(1080px,calc(100vw - 64px));max-height:90vh;border:1px solid var(--line);border-radius:18px;background:var(--bg);color:var(--text);padding:0;box-shadow:0 25px 100px #0003;font-family:inherit;overflow:auto}.cw-dialog::backdrop{background:#11182765;backdrop-filter:blur(3px)}.cw-dialog[open]{animation:cw-enter .18s ease-out}.cw-dialog h2{font-size:23px;margin:0;font-weight:650}.cw-dialog h3{font-size:16px;margin:0 0 16px;font-weight:650}.cw-dialog p{margin:8px 0;font-size:13px}.cw-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 28px;background:var(--surface);border-bottom:1px solid var(--line);position:relative}.cw-dialog-head .close{position:static;flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--steel);font-size:20px;line-height:1;font-family:inherit;cursor:pointer}.cw-dialog-head .close:hover{color:var(--red);background:var(--red-bg)}.cw-dialog-head p{color:var(--steel);margin-bottom:0}.cw-dialog-body{padding:22px 28px}.cw-dialog fieldset{border:0;margin:0;padding:0;min-width:0}.cw-dialog-foot{display:flex;justify-content:flex-end;gap:10px;padding:16px 28px;background:var(--surface);border-top:1px solid var(--line);position:sticky;bottom:0;z-index:3}.cw-edit-selection{display:flex;gap:10px 22px;flex-wrap:wrap;margin-bottom:20px}.cw-edit-selection label{display:flex;align-items:center;gap:8px;font-size:14px;cursor:pointer}.cw-edit-selection input{accent-color:var(--red);width:17px;height:17px}.cw-block{padding:22px;background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:16px}.cw-type{display:flex;gap:8px;margin-bottom:16px}.cw-type .on{color:var(--red);border-color:var(--red);background:var(--red-bg)}.cw-dialog .frm{display:grid;grid-template-columns:1fr 1fr;gap:16px}.cw-dialog .fld{display:grid;gap:7px;font-size:13px}.cw-dialog input:not([type=checkbox]),.cw-dialog select,.cw-dialog textarea{width:100%;box-sizing:border-box;border:1px solid var(--line);background:var(--surface);color:var(--text);padding:10px 12px;border-radius:8px;font:inherit;min-height:40px}.cw-dialog .tbl input{min-width:65px}.cw-paid{padding:0 14px;background:var(--green-bg);border-radius:10px;margin-bottom:18px}.cw-paid>div{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}.cw-paid>div:last-child{border:0}.cw-paid small{display:block;color:var(--steel);margin-top:4px}.cw-payment{display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:14px 0;border-bottom:1px solid var(--line);margin-bottom:12px;font-size:13px}.cw-payment>strong{align-self:center;flex:1;min-width:155px}.cw-payment label{display:grid;gap:6px;color:var(--steel);width:160px}.cw-spread{display:flex;gap:16px}.cw-error{color:var(--red);font-size:14px;line-height:1.5}.cw-error:empty{display:none}.cw-preview{padding:18px;border-radius:12px;background:var(--green-bg);margin-top:16px}.cw-preview li{margin:7px 0;font-size:13px}.cw-choices{display:flex;gap:14px;padding:32px}.cw-link-results{margin:16px 0;max-height:360px;overflow:auto;border:1px solid var(--line);border-radius:10px}.cw-link-result{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;text-align:left;padding:14px 16px;border:0;border-bottom:1px solid var(--line);background:var(--surface);color:var(--text);font:inherit;cursor:pointer}.cw-link-result:last-child{border:0}.cw-link-result small{display:block;color:var(--steel);margin-top:5px}.cw-link-result.on,.cw-link-result:hover{background:var(--red-bg)}.cw-link-result.on>span:last-child{color:var(--red)}#customerLinkDialog{max-width:680px}#customerSpecChoiceDialog{max-width:560px}.cw-order-subject{line-height:1.55;overflow-wrap:anywhere}@keyframes cw-unfold{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}@keyframes cw-enter{from{opacity:.3;transform:translateY(8px) scale(.99)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.cw-dialog[open],.cw-related-content{animation:none}}

/* Compact customer overview; order expansion preserves the existing order details. */
.cw-purchase-contents{margin-top:5px;overflow-wrap:anywhere}
.uc-panel.cw-order-card{padding:0;overflow:hidden}
.cw-order-card>summary{display:flex;align-items:center;gap:9px;list-style:none;cursor:pointer;padding:18px;min-height:62px;box-sizing:border-box;transition:background .18s}
.cw-order-card>summary::-webkit-details-marker{display:none}
.cw-order-card>summary:hover{background:var(--surface-2)}
.cw-order-card>summary:focus-visible{outline:2px solid var(--red);outline-offset:-3px;border-radius:12px}
.cw-order-card>summary h3{flex:1;min-width:0;overflow-wrap:anywhere}
.cw-order-card>summary .badge{flex:none;max-width:52%;white-space:normal;text-align:center}
.cw-order-chevron{color:var(--steel);transition:transform .2s;flex:none}
.cw-order-card[open] .cw-order-chevron{transform:rotate(180deg)}
.cw-order-details{padding:0 18px 18px;animation:cw-unfold .2s ease-out}
.cw-payment-overview{display:grid;grid-template-columns:34px minmax(0,1fr) auto;column-gap:12px;row-gap:10px}
.cw-payment-action{display:flex;justify-content:flex-end;align-items:center;gap:12px;min-width:0}
.cw-payment-action .uc-row-end{margin-left:0;white-space:nowrap}
.unified-customer .btn.cw-confirm-payment{background:var(--green,#198754);border-color:var(--green,#198754);color:#fff;padding:8px 11px;font-size:12px;white-space:nowrap;min-height:34px}
.cw-confirm-payment:hover{filter:brightness(.93)}
.cw-confirm-payment:focus-visible{outline:2px solid var(--green);outline-offset:3px}
@media(prefers-reduced-motion:reduce){.cw-order-details{animation:none}.cw-order-chevron,.cw-order-card>summary{transition:none}}

.cw-payment-action>.cw-confirm-payment,.cw-payment-received{width:150px;box-sizing:border-box;flex-shrink:0}
.cw-payment-received{color:var(--green,#198754);font-size:12px;line-height:1.5;text-align:right}
.cw-payment-received>span{display:block;font-weight:600}
.cw-payment-check{color:var(--green,#198754);background:var(--green-bg);border-color:transparent}

.cw-buyer-meta{font-size:12px;line-height:1.45;color:var(--steel);margin-top:5px;overflow-wrap:anywhere}.cw-buyer-lessee{font-size:13px;line-height:1.45;margin-top:6px;color:var(--text)}.cw-buyer-lessee strong{font-weight:600}.cw-link-result>span:first-child{min-width:0}.cw-link-result>span>strong{display:block;line-height:1.45;overflow-wrap:anywhere}.cw-linked-buyers>div{padding:6px 0}.cw-link-result:focus-visible{outline:2px solid var(--red);outline-offset:-3px}

/* Invoice purchases share the current customer-card components. */
.cw-purchase-selector{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.cw-purchase-selector .uc-filters{margin:0;display:flex;gap:8px;flex-wrap:wrap}
.cw-invoice-link{display:flex;flex-direction:column;gap:4px;padding:12px 0;margin-bottom:12px;border-bottom:1px solid var(--line)}
.cw-invoice-table{overflow-x:auto;margin:16px 0}
.cw-invoice-table td:not(:first-child){white-space:nowrap;font-variant-numeric:tabular-nums}
.cw-invoice-panel>.uc-actions{margin:16px 0}
.uc-tabs button:disabled{opacity:.45;cursor:not-allowed}
.cw-invoice-panel .uc-panel-heading{gap:16px;align-items:flex-start}

/* Customer tasks: one purchase context, compact editing choice, document provenance. */
.cw-edit-selection-summary{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px;font-size:13px;color:var(--steel)}
.cw-edit-selection-summary .uc-link{flex:none;font-size:13px}
.cw-menu-secondary{border-top:1px solid var(--line);margin-top:5px;padding-top:4px}
.cw-menu-secondary>button{width:100%;text-align:left}
.cw-menu-note{display:block;padding:10px 14px;color:var(--steel);font-size:12px;line-height:1.45}
.cw-purchase-selector .uc-filters{min-width:0}
.cw-purchase-selector button{max-width:100%;overflow-wrap:anywhere;white-space:normal}
.cw-agreement-spec{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 14px;font-size:13px;color:var(--steel)}
.cw-agreement-spec select{flex:1;min-width:220px;max-width:100%;padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);font:inherit}
.cw-history-section+.cw-history-section{margin-top:26px}
.cw-history-section h3{font-size:15px;margin:0 0 8px}
.cw-history-section>.uc-muted{font-size:13px;margin:0 0 12px}
.customer-history-row .customer-history-open{display:flex;align-items:center;gap:14px;flex:1;min-width:0;border:0;padding:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.customer-history-open .customer-history-name{flex:1;min-width:0;overflow-wrap:anywhere}
.customer-history-open .ht{flex:none}
.cw-history-open-label{color:var(--red);font-size:12px;white-space:nowrap}
.customer-history-open:focus-visible{outline:2px solid var(--red);outline-offset:5px;border-radius:3px}
