/* Bootstrap 4 compatibility layer for converted pages that still contain
   legacy markup. Scoped to .ui-v2 so untouched legacy pages keep Bootstrap 4. */
body.ui-v2 .form-group { margin-bottom: 1rem; }
body.ui-v2 .form-row { display: flex; flex-wrap: wrap; margin-right: -5px; margin-left: -5px; }
body.ui-v2 .form-row > .col,
body.ui-v2 .form-row > [class*="col-"] { padding-right: 5px; padding-left: 5px; }
body.ui-v2 .no-gutters { margin-right: 0; margin-left: 0; }
body.ui-v2 .no-gutters > .col,
body.ui-v2 .no-gutters > [class*="col-"] { padding-right: 0; padding-left: 0; }

body.ui-v2 .btn-block { display: block; width: 100%; }
body.ui-v2 .btn-md { padding: .375rem .75rem; font-size: 1rem; line-height: 1.5; border-radius: var(--radius-sm); }

body.ui-v2 .custom-control { position: relative; display: block; min-height: 1.5rem; padding-left: 1.5rem; }
body.ui-v2 .custom-control-input { position: absolute; left: 0; z-index: -1; width: 1rem; height: 1.25rem; opacity: 0; }
body.ui-v2 .custom-control-label { position: relative; margin-bottom: 0; vertical-align: top; }
body.ui-v2 .custom-control-label::before {
  position: absolute; top: .25rem; left: -1.5rem; display: block; width: 1rem; height: 1rem;
  pointer-events: none; content: ""; background-color: var(--surface); border: 1px solid var(--line);
}
body.ui-v2 .custom-control-label::after {
  position: absolute; top: .25rem; left: -1.5rem; display: block; width: 1rem; height: 1rem;
  content: ""; background: no-repeat 50% / 50% 50%;
}
body.ui-v2 .custom-checkbox .custom-control-label::before { border-radius: .25rem; }
body.ui-v2 .custom-checkbox .custom-control-input:checked ~ .custom-control-label::before { background-color: var(--brand-600); border-color: var(--brand-600); }
body.ui-v2 .custom-checkbox .custom-control-input:checked ~ .custom-control-label::after { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e"); }
body.ui-v2 .custom-radio .custom-control-label::before { border-radius: 50%; }
body.ui-v2 .custom-radio .custom-control-input:checked ~ .custom-control-label::before { background-color: var(--brand-600); border-color: var(--brand-600); }
body.ui-v2 .custom-radio .custom-control-input:checked ~ .custom-control-label::after { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
body.ui-v2 .custom-switch { padding-left: 2.25rem; }
body.ui-v2 .custom-switch .custom-control-label::before { left: -2.25rem; width: 1.75rem; border-radius: .5rem; }
body.ui-v2 .custom-switch .custom-control-label::after { top: calc(.25rem + 2px); left: calc(-2.25rem + 2px); width: calc(1rem - 4px); height: calc(1rem - 4px); background-color: var(--line); border-radius: .5rem; transition: transform .15s ease-in-out, background-color .15s ease-in-out; }
body.ui-v2 .custom-switch .custom-control-input:checked ~ .custom-control-label::after { background-color: var(--surface); transform: translateX(.75rem); }

body.ui-v2 .custom-file { position: relative; display: block; width: 100%; height: calc(1.5em + .75rem + 2px); }
body.ui-v2 .custom-file-input { position: relative; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; }
body.ui-v2 .custom-file-label {
  position: absolute; top: 0; right: 0; left: 0; z-index: 1; height: 100%;
  padding: .375rem .75rem; overflow: hidden; font-weight: 400; line-height: 1.5;
  color: var(--ink-muted); background-color: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); white-space: nowrap; text-overflow: ellipsis;
}

body.ui-v2 .input-group-append,
body.ui-v2 .input-group-prepend { display: flex; }
body.ui-v2 .input-group-append .btn,
body.ui-v2 .input-group-prepend .btn { border-radius: 0; }

body.ui-v2 .close {
  float: right; padding: 0; font-size: 1.5rem; font-weight: 700; line-height: 1;
  color: #000; text-shadow: 0 1px 0 #fff; opacity: .5; background: transparent; border: 0;
}
body.ui-v2 .close:hover { opacity: .75; }

body.ui-v2 .sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important; border: 0 !important;
}

body.ui-v2 .badge { display: inline-block; padding: .25em .4em; font-size: 75%; font-weight: 700; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25rem; }
body.ui-v2 .badge-pill { padding-right: .6em; padding-left: .6em; border-radius: 10rem; }

/* Bootstrap 4 spacing/alignment utilities still used by converted views. */
body.ui-v2 .mr-0 { margin-right: 0 !important; }
body.ui-v2 .mr-1 { margin-right: .25rem !important; }
body.ui-v2 .mr-2 { margin-right: .5rem !important; }
body.ui-v2 .mr-3 { margin-right: 1rem !important; }
body.ui-v2 .mr-4 { margin-right: 1.5rem !important; }
body.ui-v2 .mr-5 { margin-right: 3rem !important; }
body.ui-v2 .ml-0 { margin-left: 0 !important; }
body.ui-v2 .ml-1 { margin-left: .25rem !important; }
body.ui-v2 .ml-2 { margin-left: .5rem !important; }
body.ui-v2 .ml-3 { margin-left: 1rem !important; }
body.ui-v2 .ml-4 { margin-left: 1.5rem !important; }
body.ui-v2 .ml-5 { margin-left: 3rem !important; }
body.ui-v2 .mr-auto { margin-right: auto !important; }
body.ui-v2 .ml-auto { margin-left: auto !important; }
body.ui-v2 .pl-0 { padding-left: 0 !important; }
body.ui-v2 .pl-1 { padding-left: .25rem !important; }
body.ui-v2 .pl-2 { padding-left: .5rem !important; }
body.ui-v2 .pl-3 { padding-left: 1rem !important; }
body.ui-v2 .pr-0 { padding-right: 0 !important; }
body.ui-v2 .pr-1 { padding-right: .25rem !important; }
body.ui-v2 .pr-2 { padding-right: .5rem !important; }
body.ui-v2 .pr-3 { padding-right: 1rem !important; }
body.ui-v2 .text-left { text-align: left !important; }
body.ui-v2 .text-right { text-align: right !important; }
body.ui-v2 .float-left { float: left !important; }
body.ui-v2 .float-right { float: right !important; }
body.ui-v2 .font-weight-bold { font-weight: 700 !important; }
body.ui-v2 .font-weight-normal { font-weight: 400 !important; }
body.ui-v2 .font-weight-light { font-weight: 300 !important; }

body.ui-v2 .custom-select {
  display: block; width: 100%; padding: .375rem 2.25rem .375rem .75rem; font-size: .9rem;
  line-height: 1.5; color: var(--ink); background-color: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235b6b78' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 16px 12px;
}
