/* KBM U13d — targeted form/listing experience. Never owns form POST, nonce or approvals. */
body.kbm-u13d-form{
  --kbm-u13d-ink:#153447;
  --kbm-u13d-muted:#4a6476;
  --kbm-u13d-navy:#0b2d43;
  --kbm-u13d-gold:#ffcf35;
  --kbm-u13d-paper:#f8fafc;
  --kbm-u13d-line:#d4e0e7;
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-form,.kbm-machine-sale-recode-form,.kbm-p23r-form,.kbm-drivers-recode-form,.kbm-contractor-wizard,.kbm-demand-market-form){
  width:100%;max-width:100%;min-width:0;box-sizing:border-box;direction:rtl;
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-group,.kbm-machine-sale-recode-form__section,.kbm-p23r-card,.kbm-driver-form .kbm-box,.kbm-contractor-wizard fieldset,.kbm-demand-market-form .kbm-u5-demand-step){
  min-width:0;
  border-radius:20px;
  border-color:var(--kbm-u13d-line);
  background:#fff;
  box-shadow:0 6px 25px rgba(14,46,67,.045);
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-group,.kbm-machine-sale-recode-form__section,.kbm-p23r-card,.kbm-driver-form .kbm-box,.kbm-demand-market-form .kbm-u5-demand-step)>:is(h2,h3,legend){
  font-size:clamp(17px,1.65vw,22px);line-height:1.65;font-weight:850;color:var(--kbm-u13d-ink);
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-field,.kbm-machine-sale-recode-form__field,.kbm-p23r-field,.kbm-drivers-recode-form__field,.kbm-contractor-field,.kbm-demand-market-form .kbm-u5-demand-step>label){
  min-width:0;max-width:100%;font-size:clamp(13px,1.05vw,15px);font-weight:740;line-height:1.8;
  color:var(--kbm-u13d-ink);
}
/* Keep controls usable on Android: do not touch hidden, file, radio, checkbox or submit geometry. */
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-form,.kbm-machine-sale-recode-form,.kbm-p23r-form,.kbm-driver-form .kbm-form,.kbm-contractor-wizard,.kbm-demand-market-form) :is(input:not([type=hidden]):not([type=file]):not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=range]),select,textarea){
  max-width:100%;min-width:0;box-sizing:border-box;min-height:50px;
  border-radius:12px;border:1.5px solid #bdcfd9;background:#fff;
  padding:10px 13px;font-size:16px;line-height:1.65;color:#14354a;
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-form,.kbm-machine-sale-recode-form,.kbm-p23r-form,.kbm-driver-form .kbm-form,.kbm-contractor-wizard,.kbm-demand-market-form) textarea{
  min-height:132px;resize:vertical;line-height:1.95;
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-form,.kbm-machine-sale-recode-form,.kbm-p23r-form,.kbm-driver-form .kbm-form,.kbm-contractor-wizard,.kbm-demand-market-form) :is(input,select,textarea,button,a,summary):focus-visible{
  outline:3px solid #dfaa00;outline-offset:3px;
}
body.kbm-u13d-form .kbm-fux1977-summary{
  border:1px solid #e6a9af;border-inline-start:5px solid #b42d3c;border-radius:16px;
  padding:clamp(14px,2vw,20px);background:#fff3f3;color:#852c39;
  box-shadow:0 7px 19px rgba(157,52,54,.09);font-size:clamp(13px,1.05vw,15px);
  overflow-wrap:anywhere;scroll-margin-top:100px;
}
body.kbm-u13d-form .kbm-fux1977-summary[hidden]{display:none!important}
body.kbm-u13d-form .kbm-fux1977-summary ul{display:grid;gap:7px;margin-top:10px}
body.kbm-u13d-form .kbm-fux1977-summary li button{padding:5px 1px;min-height:35px;text-align:right;text-decoration:underline;text-underline-offset:3px}
body.kbm-u13d-form .kbm-u13d-field-error{
  display:block;grid-column:1/-1;min-width:0;max-width:100%;
  margin:6px 0 0;padding:8px 11px;border-radius:9px;
  font-size:12px;font-weight:750;line-height:1.8;color:#952735;background:#fff0f1;
}
body.kbm-u13d-form :is(input,select,textarea)[aria-invalid="true"]{
  border-color:#b83243!important;box-shadow:0 0 0 3px rgba(184,50,67,.10)!important;
}
body.kbm-u13d-form .kbm-u13d-demand-error{
  grid-column:1/-1;display:block;border:1px solid #e8aab2;
  background:#fff0f2;color:#8f2837;font-weight:800;
  padding:12px 15px;border-radius:12px;margin:0;
  font-size:13px;line-height:1.9;
}
body.kbm-u13d-form .kbm-u13d-demand-error[hidden]{display:none!important}
body.kbm-u13d-form .kbm-fux1977-assist{
  padding:10px 12px;gap:10px;border-radius:12px;
  background:#f2f7fa;border:1px solid #dce8ee;
}
body.kbm-u13d-form .kbm-fux1977-assist :is(button){min-height:42px;font-size:12px;padding:8px 12px}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-actions,.kbm-machine-sale-recode-actions,.kbm-p23r-actions,.kbm-driver-form .kbm-step-nav,.kbm-u5-demand-actions){
  min-width:0;max-width:100%;display:flex;flex-wrap:wrap;gap:10px;align-items:center;
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-submit,.kbm-machine-sale-recode-btn:not(.is-ghost),.kbm-p23r-next,.kbm-p23r-submit,.kbm-driver-form button[type=submit],.kbm-demand-market-form button[type=submit]){
  min-height:49px;max-width:100%;font-weight:850;border-radius:13px;
}
body.kbm-u13d-form :is(.kbm-gdb08-submit-note,.kbm-submit-recode-notice,.kbm-machine-sale-recode-alert,.kbm-p23r-message,.kbm-demand-market-form .kbm-u5-demand-review){
  min-width:0;max-width:100%;overflow-wrap:anywhere;
}
body.kbm-u13d-form :is(.kbm-gdb08-submit-note,.kbm-submit-recode-notice,.kbm-machine-sale-recode-alert,.kbm-p23r-message){
  border-radius:14px;padding:12px 15px;line-height:1.85;
}
/* Explicitly never show absent/hidden wizard controls. */
body.kbm-u13d-form :is([hidden],.kbm-u13d-field-error[hidden]){display:none!important}
@media(max-width:720px){
  body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-group,.kbm-machine-sale-recode-form__section,.kbm-p23r-card,.kbm-driver-form .kbm-box,.kbm-demand-market-form .kbm-u5-demand-step){padding:16px;border-radius:16px}
  body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-grid,.kbm-machine-sale-recode-form__grid,.kbm-p23r-grid2,.kbm-driver-form .kbm-grid){grid-template-columns:minmax(0,1fr)!important}
  body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-actions,.kbm-machine-sale-recode-actions,.kbm-p23r-actions,.kbm-driver-form .kbm-step-nav,.kbm-u5-demand-actions){gap:8px}
  body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-actions,.kbm-machine-sale-recode-actions,.kbm-p23r-actions,.kbm-driver-form .kbm-step-nav,.kbm-u5-demand-actions) > :is(button,a){min-height:46px;max-width:100%;flex:1 1 auto}
  body.kbm-u13d-form .kbm-fux1977-assist{align-items:stretch}
  body.kbm-u13d-form .kbm-fux1977-assist>div{width:100%}
  body.kbm-u13d-form .kbm-fux1977-assist button{flex:1 1 auto}
  body.kbm-u13d-form .kbm-fux1977-file-preview{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(prefers-reduced-motion:reduce){
  body.kbm-u13d-form :is(input,select,textarea,button,a){transition:none!important}
}

/* Keep the native wizard shells and field groups, including hidden steps. */
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-form,.kbm-machine-sale-recode-form,.kbm-p23r-form,.kbm-drivers-recode-form,.kbm-contractor-wizard,.kbm-demand-market-form) {
  max-inline-size:960px; margin-inline:auto;
}
body.kbm-u13d-form :is(fieldset,.kbm-submit-recode-section,.kbm-machine-sale-recode-section,.kbm-p23r-section,.kbm-drivers-recode-form__section) {
  min-inline-size:0; border-color:#dbe4ed; border-radius:14px;
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-section,.kbm-machine-sale-recode-section,.kbm-p23r-section,.kbm-drivers-recode-form__section) > header {
  border-inline-start:4px solid #ffcc00; background:#edf3f9; padding:12px 14px; border-radius:9px;
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-actions,.kbm-machine-sale-recode-actions,.kbm-p23r-actions,.kbm-step-nav) :is(button,a) {
  min-height:44px;
}
body.kbm-u13d-form :is(input,select,textarea)[aria-invalid="true"]:focus-visible{
  outline:3px solid #a52b3a!important; outline-offset:2px;
}

/* Match the core state palette for the native validation summary and each vertical. */
body.kbm-u13d-form :is(.kbm-fux1977-summary,.kbm-u13d-field-error,.kbm-u13d-demand-error) {
  color:var(--kbm-color-danger-text,#b3261e); background:var(--kbm-color-danger-surface,#fff0ef);
}
body.kbm-u13d-form:not(.kbm-b4-submit-route) :is(.kbm-submit-recode-group,.kbm-machine-sale-recode-form__section,.kbm-p23r-card,.kbm-driver-form .kbm-box,.kbm-contractor-wizard fieldset,.kbm-demand-market-form .kbm-u5-demand-step):focus-within {
  border-color:var(--kbm-color-focus,#1859b8);
}
