/* Tablets */

input[type="submit"], button {
  -webkit-appearance: none;
  appearance: none;
}

@media (max-width: 1024px) {
  /* Forms */
  label {
    font-size: 14px;
  }

  .form-row input[type=text],
  .form-row input[type=password],
  .form-row input[type=email],
  .form-row input[type=url],
  .form-row input[type=tel],
  .form-row input[type=number],
  .form-row textarea,
  .form-row select,
  .form-row .vTextField {
    box-sizing: border-box;
    margin: 0;
    padding: 6px 8px;
    min-height: 36px;
    font-size: 14px;
  }

  .form-row select {
    height: 36px;
  }

  .form-row select[multiple] {
    height: auto;
    min-height: 0;
  }

  fieldset .fieldBox {
    float: none;
    margin: 0 -10px;
    padding: 0 10px;
  }

  fieldset .fieldBox + .fieldBox {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
  }

  textarea {
    max-width: 518px;
    max-height: 120px;
  }

  .aligned label {
    padding-top: 6px;
  }

  .aligned .add-another,
  .aligned .related-lookup,
  .aligned .datetimeshortcuts,
  .aligned .related-lookup + strong {
    align-self: center;
    margin-left: 15px;
  }

  form .aligned ul.radiolist {
    margin-left: 2px;
  }

  /* Selector */
  .selector {
    display: flex;
    width: 100%;
  }

  .selector .selector-filter {
    display: flex;
    align-items: center;
  }

  .selector .selector-filter label {
    margin: 0 8px 0 0;
  }

  .selector .selector-filter input {
    width: auto;
    min-height: 0;
    flex: 1 1;
  }

  .selector-available, .selector-chosen {
    width: auto;
    flex: 1 1;
    display: flex;
    flex-direction: column;
  }

  .selector select {
    width: 100%;
    flex: 1 0 auto;
    margin-bottom: 5px;
  }

  .selector ul.selector-chooser {
    width: 26px;
    height: 52px;
    padding: 2px 0;
    margin: auto 15px;
    border-radius: 20px;
    transform: translateY(-10px);
  }

  .selector-add, .selector-remove {
    width: 20px;
    height: 20px;
    background-size: 20px auto;
  }

  .selector-add {
    background-position: 0 -120px;
  }

  .selector-remove {
    background-position: 0 -80px;
  }

  a.selector-chooseall, a.selector-clearall {
    align-self: center;
  }

  .stacked {
    flex-direction: column;
    max-width: 480px;
  }

  .stacked > * {
    flex: 0 1 auto;
  }

  .stacked select {
    margin-bottom: 0;
  }

  .stacked .selector-available, .stacked .selector-chosen {
    width: auto;
  }

  .stacked ul.selector-chooser {
    width: 52px;
    height: 26px;
    padding: 0 2px;
    margin: 15px auto;
    transform: none;
  }

  .stacked .selector-chooser li {
    padding: 3px;
  }

  .stacked .selector-add, .stacked .selector-remove {
    background-size: 20px auto;
  }

  .stacked .selector-add {
    background-position: 0 -40px;
  }

  .stacked .active.selector-add {
    background-position: 0 -60px;
  }

  .stacked .selector-remove {
    background-position: 0 0;
  }

  .stacked .active.selector-remove {
    background-position: 0 -20px;
  }

  .help-tooltip, .selector .help-icon {
    display: none;
  }
}

/* Mobile */

@media (max-width: 767px) {
  /* Forms */
  .form-row {
    padding: 15px 0;
  }

  .aligned .form-row,
  .aligned .form-row > div {
    display: flex;
    flex-wrap: wrap;
    max-width: 100vw;
  }

  .aligned .form-row > div {
    width: calc(100vw - 30px);
  }

  textarea {
    max-width: none;
  }

  .vURLField {
    width: auto;
  }

  fieldset .fieldBox + .fieldBox {
    margin-top: 15px;
    padding-top: 15px;
  }

  fieldset.collapsed .form-row {
    display: none;
  }

  .aligned label {
    width: 100%;
    padding: 0 0 10px;
  }

  .aligned label:after {
    max-height: 0;
  }

  .aligned .form-row input,
  .aligned .form-row select,
  .aligned .form-row textarea {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .aligned .checkbox-row {
    align-items: center;
  }

  .aligned .checkbox-row input {
    flex: 0 1 auto;
    margin: 0;
  }

  .aligned .vCheckboxLabel {
    flex: 1 0;
    padding: 1px 0 0 5px;
  }

  .aligned label + p,
  .aligned label + div.help,
  .aligned label + div.readonly {
    padding: 0;
    margin-left: 0;
  }

  .aligned p.file-upload {
    margin-left: 0;
    font-size: 13px;
  }

  span.clearable-file-input {
    margin-left: 15px;
  }

  span.clearable-file-input label {
    font-size: 13px;
    padding-bottom: 0;
  }

  .aligned .timezonewarning {
    flex: 1 0 100%;
    margin-top: 5px;
  }

  form .aligned .form-row div.help {
    width: 100%;
    margin: 5px 0 0;
    padding: 0;
  }

  form .aligned ul {
    margin-left: 0;
    padding-left: 0;
  }

  form .aligned ul.radiolist {
    margin-right: 15px;
    margin-bottom: -3px;
  }

  form .aligned ul.radiolist li + li {
    margin-top: 5px;
  }

  /* Selector */
  .selector {
    flex-direction: column;
  }

  .selector > * {
    float: none;
  }

  .selector-available, .selector-chosen {
    margin-bottom: 0;
    flex: 1 1 auto;
  }

  .selector select {
    max-height: 96px;
  }

  .selector ul.selector-chooser {
    display: block;
    float: none;
    width: 56px;
    height: 26px;
    padding: 0 2px;
    margin: 15px auto 20px;
    transform: none;
  }

  .selector ul.selector-chooser li {
    float: left;
  }

  .selector-remove {
    background-position: 0 0;
  }

  .selector-add {
    background-position: 0 -40px;
  }
}
