/* URBAH case CRM 116 mobile v1 — shared service form layout */
@media (max-width:767px) {
/* Text-like controls include Bitrix type=string and other custom types. */
/* Compact common layout; keep the CRM header visible if it contains text. */
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form { margin-top: 0 !important; }
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-wrapper { padding: 0 !important; min-height: 0 !important; }
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-header { padding: 0 !important; margin: 0 !important; }
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-header:empty { display: none !important; }
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-content { padding: 0 !important; margin: 0 !important; }
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-padding-side { padding-left: 0 !important; padding-right: 0 !important; }
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) { position: relative !important; padding-top: 22px !important; }
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) > .b24-form-control-label {
  display: block !important;
  position: absolute !important;
  top: 0 !important; bottom: auto !important; left: 0 !important; right: auto !important;
  transform: none !important;
  margin: 0 !important; padding: 0 !important;
  color: var(--ug-crm-label, #201d30) !important;
  font-size: 13px !important; line-height: 18px !important;
  background: transparent !important; opacity: 1 !important;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) > :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control) {
  box-sizing: border-box !important;
  padding-top: 10px !important; padding-bottom: 10px !important;
  font-size: 16px !important; line-height: 22px !important;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) > input.b24-form-control { height: 44px !important; min-height: 44px !important; }
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-control-container:has(> .b24-form-control-label):has(> :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) > textarea.b24-form-control { height: 96px !important; min-height: 96px !important; resize: vertical; }
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-field:has(.b24-form-control-container > :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control)) { margin-bottom: 12px !important; }

/* Same pill radius as .sp-button, for both inline themes. */
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-btn {
  border-radius: 999px !important;
}

/* Both published case templates. Preserve the existing loader and CRM metadata. */
body#service-template :is(#ug-case-dialog, #practice-contact) {
  width: min(620px, calc(100% - 24px)) !important;
  max-width: calc(100% - 24px) !important;
  max-height: calc(100vh - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
  position: fixed !important; inset: 0 !important; margin: auto !important;
  box-sizing: border-box !important; padding: 18px !important;
  overflow: auto !important; overscroll-behavior: contain;
  border: 0 !important; border-radius: 20px !important;
  background: #fff !important; color: #201d30 !important;
  font-family: Manrope, Arial, sans-serif !important;
  --ug-crm-label: #201d30;
}
body#service-template :is(#ug-case-dialog, #practice-contact):not([open]) {display:none!important;}
body#service-template :is(#ug-case-dialog .dialog-head, #practice-contact .dialog-top) {
  display:flex !important; align-items:center !important; justify-content:space-between !important;
  gap:10px !important; margin:0 0 16px !important; padding:0 !important;
}
body#service-template :is(#ug-case-dialog .dialog-head, #practice-contact .dialog-top) h2 {
  margin:0 !important; min-width:0; color:#201d30 !important;
  font-size:clamp(22px,6vw,28px) !important; font-weight:600 !important;
  line-height:1.16 !important; letter-spacing:-.04em !important;
}
body#service-template :is(#ug-case-dialog .dialog-head .close, #practice-contact .dialog-top .close-dialog) {
  appearance:none; position:static !important; display:grid !important; place-items:center !important;
  width:40px !important; height:40px !important; min-width:40px !important; min-height:40px !important;
  flex:0 0 40px !important; padding:0 !important; margin:0 !important;
  border:0 !important; border-radius:50% !important; background:#f2edf9 !important;
  color:#201d30 !important; box-shadow:none !important; outline:0 !important;
  font:400 27px/1 Manrope,Arial,sans-serif !important; cursor:pointer !important;
}
body#service-template :is(#ug-case-dialog .dialog-head .close, #practice-contact .dialog-top .close-dialog):focus-visible {
  outline:2px solid #6f65b1 !important; outline-offset:2px !important;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) {
  width:100% !important; max-width:100% !important; min-width:0; padding:0 !important;
  margin:0 !important; text-align:left !important;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form {
  --b24-background-color:#fff !important;
  --b24-text-color:#201d30 !important; --b24-primary-color:#201d30 !important;
  --b24-primary-text-color:#fff !important; --b24-field-color:#201d30 !important;
  --b24-field-background-color:#f7f6f9 !important; --b24-field-border-color:#d9d4e3 !important;
  --b24-field-focus-background-color:#fff !important;
  font-family:Manrope,Arial,sans-serif !important; color:#201d30 !important; color-scheme:light;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) :is(.b24-form,.b24-form-wrapper,.b24-form-content,.b24-form-header) {
  background:transparent !important; box-shadow:none !important;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-control-container > :is(input.b24-form-control:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),textarea.b24-form-control) {
  width:100% !important; border-radius:12px !important; background:#f7f6f9 !important;
  border:1px solid #d9d4e3 !important; padding-inline:12px !important; color:#201d30 !important;
  -webkit-text-fill-color:#201d30 !important; font-family:inherit !important;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-control-container > :is(input.b24-form-control,textarea.b24-form-control):focus {
  border-color:#6f65b1 !important; outline:2px solid #6f65b133 !important; outline-offset:1px;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) :is(.b24-form-field-agreement,.b24-form-control-check-label) {
  color:#514d60 !important; font-size:12px !important; line-height:1.5 !important; opacity:1 !important;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-field-agreement :is(label,span,a) {
  opacity:1 !important;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-btn {
  min-height:44px !important; font:600 16px/1.3 Manrope,Arial,sans-serif !important;
  background:#201d30 !important; color:#fff !important; border-color:#201d30 !important;
}
body#service-template :is(#ug-case-dialog #ug-case-form-host, #practice-contact #practice-form-host) .b24-form-btn:disabled {opacity:.65 !important;}

}
