.add-device-modal {
  &__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: auto;
    max-height: calc(80vh - 200px) !important;
  }

  &__model-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-right: 8px;
  }

  &__filters {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  &__search {
    flex: 1;
    min-width: 0;
  }

  &__filter-select {
    width: 150px;
    flex: 0 0 150px;
  }

  &__model-group {
    & + & {
      margin-top: 20px;
    }
  }

  &__group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.88);
  }

  &__model-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  &__model-card {
    display: block;
    width: 100%;
    height: auto;
    padding: 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f5f6f8;
    text-align: left;
    white-space: normal;
    cursor: pointer;
    transition: all 0.18s;

    &:hover,
    &.is-selected {
      border-color: #7c3aed;
      background: #f5f0ff;
    }
  }

  &__model-name {
    font-size: 14px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.88);
  }

  &__model-desc {
    margin-top: 4px;
    font-size: 12px;
    line-height: 18px;
    color: rgba(0, 0, 0, 0.45);
  }

  &__model-brand {
    margin-top: 2px;
    font-size: 12px;
    line-height: 18px;
    color: rgba(0, 0, 0, 0.55);
  }

  &__connection-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
  }

  &__connection-tag {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    font-size: 11px;
    line-height: 16px;
    color: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    background: #fff;
  }

  &__selected-model {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f5f6f8;
  }

  &__back-icon {
    position: absolute;
    top: 18px;
    left: 16px;
  }

  &.is-peripheral {
    .add-device-modal__model-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .add-device-modal__model-card {
      min-height: 108px;
    }
  }
}
