/* Scoped to DLMS screens; native WordPress and WooCommerce forms are untouched. */
:is(.dlms-admin .wrap,.dlms-customer) form {max-width: 100%;}
:is(.dlms-admin .wrap,.dlms-customer) form p:has(>label > :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]),select,textarea)) {display:block; margin: 0 0 16px;}
:is(.dlms-admin .wrap,.dlms-customer) label:has(> :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]),select,textarea)) {display:flex; flex-direction:column; gap:6px; font-weight:600; width:100%; max-width:420px; box-sizing:border-box;}
:is(.dlms-admin .wrap,.dlms-customer) label > :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]),select,textarea) {width:100%; max-width:100%; min-height:38px; margin:0; box-sizing:border-box; font-weight:400;}
:is(.dlms-admin .wrap,.dlms-customer) label > textarea {min-height:90px; resize:vertical;}
:is(.dlms-admin .wrap,.dlms-customer) label:has(> input:is([type=checkbox],[type=radio])) {display:inline-flex; align-items:center; gap:6px; margin:4px 14px 4px 0;}
:is(.dlms-admin .wrap,.dlms-customer) label > input:is([type=checkbox],[type=radio]) {margin:0; flex-shrink:0;}
:is(.dlms-admin .wrap,.dlms-customer) details {padding:12px 0;}
:is(.dlms-admin .wrap,.dlms-customer) summary {cursor:pointer; font-weight:600; margin-bottom:12px;}
@media(max-width:600px){:is(.dlms-admin .wrap,.dlms-customer) label:has(> :is(input,select,textarea)){max-width:100%;}}
.dlms-customer .dlms-request-summary {border:1px solid #dcdcde;padding:16px;margin:16px 0;border-radius:6px;}
.dlms-customer .dlms-request-summary h4 {margin:0 0 12px;}
.dlms-customer .dlms-request-summary p {margin:4px 0;overflow-wrap:anywhere;}
.dlms-admin .widefat th {width:180px;}

.dlms-account-nav {display:flex;flex-wrap:wrap;gap:12px;margin:20px 0;padding:12px;border:1px solid #dcdcde;border-radius:6px;}
.dlms-account-nav a {padding:6px 10px;}
.dlms-customer [id] {scroll-margin-top:40px;}
/* Accounting workspaces and responsive report tables. */
.dlms-admin .dlms-finance-workspace {max-width:1260px;}
.dlms-admin .dlms-finance-panel,.dlms-admin .dlms-finance-result {background:#fff;border:1px solid #dcdcde;border-radius:6px;padding:20px;margin:18px 0;box-sizing:border-box;}
.dlms-admin .dlms-finance-panel h2,.dlms-admin .dlms-finance-result h2 {margin-top:0;}
.dlms-admin .dlms-finance-panel form {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));align-items:start;gap:12px 24px;}
.dlms-admin .dlms-finance-panel form p {margin:0 0 8px;}
.dlms-admin .dlms-finance-panel form h2,.dlms-admin .dlms-finance-panel form p.submit {grid-column:1/-1;}
.dlms-admin .dlms-finance-panel form label {max-width:none;}
.dlms-admin .dlms-table-scroll {max-width:100%;overflow:auto;margin:12px 0;}
.dlms-admin .dlms-table-scroll:focus-visible {outline:2px solid #2271b1;outline-offset:2px;}
.dlms-admin .dlms-table-scroll .widefat {min-width:540px;}
.dlms-admin .dlms-table-scroll .widefat th {width:auto;}
@media(max-width:600px){.dlms-admin .dlms-finance-panel,.dlms-admin .dlms-finance-result{padding:12px;}}

/* Legacy screens: match shared field sizing without affecting checkbox groups or table forms. */
.dlms-admin .wrap, .dlms-customer {min-width:0;overflow-wrap:anywhere;}
:is(.dlms-admin .wrap,.dlms-customer) .dlms-table-scroll {max-width:100%;overflow-x:auto;margin:12px 0;}
:is(.dlms-admin .wrap,.dlms-customer) .dlms-table-scroll:focus-visible {outline:2px solid #2271b1;outline-offset:2px;}
:is(.dlms-admin .wrap,.dlms-customer) .dlms-table-scroll table {min-width:540px;}
.dlms-admin .widefat th {width:auto;}
:is(.dlms-admin .wrap,.dlms-customer) form :is(input,select,textarea) {max-width:100%;box-sizing:border-box;}
:is(.dlms-admin .wrap,.dlms-customer) form p.submit {margin-top:16px;}
:is(.dlms-admin .wrap,.dlms-customer) label:has(> input:is([type=checkbox],[type=radio])) {max-width:100%;white-space:normal;}
:is(.dlms-admin .wrap,.dlms-customer) .dlms-table-scroll label {max-width:100%;}
@media(max-width:782px){
 .dlms-admin .wrap .button, .dlms-customer button {white-space:normal;height:auto;min-height:36px;line-height:1.4;}
 .dlms-admin .wrap .widefat td, .dlms-admin .wrap .widefat th {vertical-align:top;}
}

/* 0.133: a common vertical field rhythm, including legacy standalone labels. */
:is(.dlms-admin .wrap,.dlms-customer) form label:has(> :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=button]),select,textarea)),
:is(.dlms-admin .wrap,.dlms-customer) form label[for]:not(:has(>input:is([type=checkbox],[type=radio]))) {
 display:flex;flex-direction:column;align-items:stretch;gap:6px;font-weight:600;line-height:1.35;
}
:is(.dlms-admin .wrap,.dlms-customer) form label[for]:not(:has(>input,>select,>textarea)) {margin-bottom:6px;}
:is(.dlms-admin .wrap,.dlms-customer) form label[for] + :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {display:block;width:100%;max-width:420px;min-height:38px;margin:0;}
:is(.dlms-admin .wrap,.dlms-customer) form > label:has(> :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea)) {margin-bottom:14px;}
:is(.dlms-admin .wrap,.dlms-customer) form .dlms-field {min-width:0;max-width:100%;margin:0;}
:is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:16px 20px;align-items:end;max-width:1080px;}
:is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid > :not(.dlms-field) {grid-column:1/-1;}
:is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid .dlms-field label,
:is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid > label.dlms-field {max-width:none;width:100%;margin:0;}
:is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid .dlms-field :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {display:block;width:100%;max-width:none;min-height:38px;margin:0;box-sizing:border-box;}
:is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid > :is(button,.button,input[type=submit]) {justify-self:start;}
:is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid > input[type=hidden] {display:none;}
:is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid > p.submit {margin:0;padding:0;}
.dlms-admin .dlms-finance-panel form > :is(h2,h3,h4,table,details,p.description,p.submit,.dlms-table-scroll,fieldset,div:not(.dlms-field)) {grid-column:1/-1;}
.dlms-stripe-payment {max-width:560px;margin:24px 0;padding:20px;border:1px solid #dcdcde;border-radius:8px;}
.dlms-stripe-payment #dlms-stripe-card {padding:14px;border:1px solid #949494;border-radius:5px;background:#fff;margin:12px 0;}
.dlms-stripe-payment button {margin:6px 0;}
@media(max-width:600px){:is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid {grid-template-columns:1fr;gap:12px;}.dlms-stripe-payment{padding:12px;}}
/* 0.136: narrow screens keep inputs, actions and long file names inside the form. */
:is(.dlms-admin .wrap,.dlms-customer) form :is(input[type=file],input[type=url],input[type=email],input[type=number],select,textarea){min-width:0;max-width:100%;}
:is(.dlms-admin .wrap,.dlms-customer) form :is(button,.button):focus-visible {outline:2px solid #2271b1;outline-offset:2px;}
@media(max-width:600px){
 :is(.dlms-admin .wrap,.dlms-customer) form label[for] + :is(input:not([type=checkbox]):not([type=radio]),select,textarea){max-width:100%;}
 .dlms-admin .dlms-finance-panel form{grid-template-columns:minmax(0,1fr);}
 :is(.dlms-admin .wrap,.dlms-customer) form.dlms-form-grid{grid-template-columns:minmax(0,1fr);}
 .dlms-customer .dlms-account-nav{gap:6px;}
 .dlms-customer .dlms-account-nav a{overflow-wrap:anywhere;}
}
/* 0.144: readable record details and structured cargo */
.dlms-record-view {max-width:100%;overflow-x:auto;margin:10px 0 16px;}
.dlms-record-view table {width:100%;border-collapse:collapse;table-layout:auto;}
.dlms-record-view th,.dlms-record-view td {padding:8px 12px;vertical-align:top;text-align:left;overflow-wrap:anywhere;}
.dlms-record-view tbody th[scope=row]{width:28%;font-weight:600;}
.dlms-record-view .dlms-record-view{margin:0;}
.dlms-availability-review,.dlms-cargo{border:1px solid #c3c4c7;background:transparent;padding:16px;margin:12px 0;min-width:0;}
.dlms-cargo details{margin:6px 0;padding:8px;border:1px solid #c3c4c7;}
.dlms-cargo legend{font-weight:600;}
.dlms-availability-review form button{margin:4px 2px;}
.dlms-cargo [hidden]{display:none!important;}
/* 0.146 — team drafts and individual offers. */
.dlms-team-builder {margin:12px 0;min-width:0;}
.dlms-team-builder fieldset {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:10px 16px;padding:14px;border:1px solid #c3c4c7;margin:0 0 14px;min-width:0;}
.dlms-team-builder fieldset legend {font-weight:600;padding:0 6px;}
.dlms-team-builder fieldset p {margin:0;min-width:0;}
.dlms-team-builder fieldset label {display:block;}
.dlms-team-builder fieldset label :is(input,select) {display:block;width:100%;margin:4px 0 0;min-width:0;}
.dlms-team-builder fieldset[hidden]{display:none!important;}
.dlms-team-builder .dlms-team-preview{padding:10px;border:1px solid #c3c4c7;font-weight:600;}
/* 0.148 — conditional compensation controls. */
.dlms-team-builder [hidden]{display:none!important;}
.dlms-team-builder .dlms-comp-advanced{grid-column:1/-1;border:1px solid #c3c4c7;padding:10px;min-width:0;}
.dlms-team-builder .dlms-comp-advanced summary{cursor:pointer;font-weight:600;}
.dlms-team-builder .dlms-comp-advanced p{margin:8px 0;}
.dlms-team-builder fieldset input[type=checkbox]{display:inline-block;width:auto;margin:0 6px 0 0;}
.dlms-team-builder .dlms-comp-info,.dlms-team-builder .dlms-row-estimate{grid-column:1/-1;}
.dlms-team-builder .dlms-row-estimate{font-weight:600;}

/* 0.150.2: inline category controls, independent of product submission. */
.dlms-category-options {min-width:0;max-width:100%;border:1px solid #8b9086;border-radius:8px;padding:14px;margin:16px 0;}
.dlms-category-toolbar {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:12px;}
.dlms-category-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:4px 12px;max-height:260px;overflow:auto;padding:4px;}
.dlms-category-options .dlms-category-choice {display:flex!important;flex-direction:row;align-items:center;gap:8px;min-width:0;margin:0!important;overflow-wrap:anywhere;font-weight:400;}
.dlms-category-choice input {flex-shrink:0;}
.dlms-category-fields {display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin:12px 0;}
.dlms-category-fields label {flex:1 1 180px;min-width:0;display:flex;flex-direction:column;gap:6px;}
.dlms-category-fields button {align-self:flex-end;}
.dlms-category-options [hidden] {display:none!important;}
.dlms-category-options [data-category-status]:empty {display:none;}
.dlms-category-options [data-category-status] {font-weight:600;overflow-wrap:anywhere;}

/* Label spacing without altering checkbox layout. */
.dlms-admin form p > label:has(> input:not([type=checkbox]):not([type=radio])),.dlms-customer form p > label:has(> input:not([type=checkbox]):not([type=radio])) {display:flex;flex-direction:column;gap:7px;align-items:stretch;}
.dlms-address-check {margin:10px 0 16px;}
.dlms-order-request {border:1px solid #8b9086;border-radius:8px;padding:16px;margin:16px 0;}
.dlms-order-request label,.dlms-order-request textarea{display:block;width:100%;margin-bottom:8px;}

.dlms-department-record>summary .dlms-record-title{font-weight:700}.dlms-record-status{margin-inline:8px}.dlms-record-meta{display:block;font-size:.85em;font-weight:400;overflow-wrap:anywhere}

.dlms-admin article.dlms-department-record{border:1px solid #a8afb5;border-radius:8px;padding:16px;margin:12px 0}.dlms-product-card>a{font-weight:700}
