.DiscussionListItem {
  .tooltip .tooltip-inner {
    max-width: none;
  }
}
.DiscussionListItem--hidden {
  .DiscussionListItem-content {
    opacity: 0.5;
  }
}

.DiscussionListItem a {
  text-decoration: none;
}
.DiscussionListItem-content {
  position: relative;
  color: var(--muted-color);
  display: flex;
  gap: 16px;
  padding: 12px 26px 12px 0;

  > * {
    flex-grow: 0;
    flex-shrink: 0;
  }
}
.DiscussionListItem-main {
  color: inherit;
  text-decoration: none;
  display: block;
  flex-grow: 1;
  flex-shrink: 1;
}
.DiscussionListItem-author {
  position: relative;
}
.DiscussionListItem-author-avatar {
  display: block;

  + .tooltip {
    width: max-content;
  }
}
.DiscussionListItem-badges {
  margin-top: 10px;
  text-align: right;
  white-space: nowrap;
  pointer-events: none;

  position: absolute;
  top: -14px;
  left: -2px;
}
.DiscussionListItem-title {
  margin: 0 0 3px;
  line-height: 1.3;
  color: var(--heading-color);
  font-weight: normal;
  overflow: hidden;
  text-overflow: ellipsis;

  .DiscussionList:not(.DiscussionList--searchResults) .read & {
    color: var(--discussion-title-color);
  }
  .DiscussionList:not(.DiscussionList--searchResults) .unread & {
    font-weight: 600;
  }

  mark {
    background: none;
    box-shadow: none;
    font-weight: bold;
    color: var(--text-color);
  }
}
.DiscussionListItem-info {
  list-style-type: none;
  padding: 0;
  margin: 0;
  font-size: 11px;
  color: var(--muted-more-color);

  > li {
    display: inline;
  }
  .username {
    font-weight: bold;
  }
  .item-terminalPost .icon {
    font-size: 11px;
    margin-right: -1px;
  }
  .item-excerpt {
    margin-top: 4px;
    white-space: normal;
    font-size: 12px;
    line-height: 1.5em;
    display: block;
    word-break: break-word;

    mark {
      background: none;
      box-shadow: none;
      font-weight: bold;
      color: inherit;
    }
  }
}
.DiscussionListItem-stats {
  width: 40px;
  display: flex;
  flex-direction: column;
}
.DiscussionListItem-stats-item {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;

  .unread & {
    cursor: pointer;
  }
}

.MinimalDiscussionListItem {
  .DiscussionListItem-info .item-excerpt {
    margin-right: 0;
  }

  .DiscussionListItem-badges {
    position: relative;
    padding: 0;
    margin: 0;
    inset: unset;
    width: auto;
    text-align: start;
    padding-inline-start: 8px;

    &:empty {
      display: none;
    }
  }

  .DiscussionListItem-title {
    display: flex;
    column-gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    line-height: normal;
    white-space: nowrap;

    > div {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}

@media (any-hover: none) {
  .DiscussionListItem-controls > .Dropdown-toggle {
    display: none;
  }
}

@media @phone {
  .DiscussionListItem-controls {
    display: none;
  }
  .DiscussionListItem-content {
    padding-left: 15px;

    &:active {
      background: var(--control-bg);
    }
  }
  .DiscussionListItem-author-avatar {
    .Avatar {
      .Avatar--size(32px);
    }
  }
  .DiscussionListItem-badges {
    width: 48px;
    left: -4px;
    top: -15px;

    .badge {
      .Badge--size(20px);
      margin-left: -13px;
    }
  }
  .DiscussionListItem-main {
    //
  }
  .DiscussionListItem-title {
    font-size: 14px;
    text-decoration: none !important;
  }
  .DiscussionListItem-info {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .DiscussionListItem-stats {
    align-items: end;
  }
  .DiscussionListItem-count {
    background: var(--control-bg);
    color: var(--control-color);
    border-radius: var(--border-radius);
    font-size: 12px;
    padding: 2px 6px;
    gap: 0;

    .unread & {
      background: var(--primary-color);
      color: #fff;
      font-weight: bold;

      &:active {
        opacity: 0.5;
      }
    }

    .icon {
      display: none;
    }
  }
}



@media @tablet-up {
  .DiscussionListItem {
    position: relative;
    margin-right: -15px;
    padding-right: 25px;
    padding-left: 15px;
    margin-left: -15px;
    border-radius: var(--border-radius);
    transition: background 0.2s;

    &:hover {
      background: var(--discussion-list-item-bg-hover);
    }
    &:hover .DiscussionListItem-controls,
    .DiscussionListItem-controls.open {
      opacity: 1;
    }
    .DiscussionListItem-controls.open {
      z-index: 3;
    }
  }
  .DiscussionListItem-controls {
    position: absolute;
    right: 5px;
    top: 5px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s;

    &:focus-within {
      opacity: 1;
    }

    .Dropdown-toggle {
      display: block;
    }
    .Dropdown-menu {
      right: 0;
      left: auto;
    }
  }
  .DiscussionListItem-info {
    .item-excerpt {
      margin-right: 170px;
    }
  }
  .DiscussionListItem-content {
    //
  }
  .DiscussionListItem-author-avatar {
    .Avatar {
      .Avatar--size(36px);
    }
  }
  .DiscussionListItem-badges {
    width: 48px;
  }
  .DiscussionListItem-main {
    //
  }
  .DiscussionListItem-title {
    font-size: 16px;
  }
  .DiscussionListItem-stats-item {
    color: var(--muted-color);
    font-size: 14px;
  }
  .DiscussionListItem-count {
    .unread & {
      color: var(--heading-color);
      font-weight: bold;

      ._checkmark {
        display: none;
      }

      &:hover, &:focus {
        ._checkmark {
          display: block;
        }
        ._comment {
          display: none;
        }
      }
    }
  }
}

@media @small-phone {
  .DiscussionListItem-info {
    max-width: 160px;
  }
}
