.main {
  --border-color: var(--grey-200);

  border-radius: 5px;
  min-height: 36px;

  :global {
    .d2h-wrapper > div {
      margin-bottom: 0;
    }

    .d2h-file-wrapper {
      border: 0;

      .d2h-diff-tbody {
        &,
        tr {
          position: relative;

          &[data-annotated-line] {
            background-color: var(--white);

            // These cause one or two pixels mismatched
            // calculation due to table spacing gaps
            // border-top: 1px solid var(--grey-200);
            // border-bottom: 1px solid var(--grey-200);
          }

          &.selected {
            // TODO: Talk to design about these selection colors
            &.first {
              border-top: 1px solid var(--border-color);
            }

            &.last {
              border-bottom: 1px solid var(--border-color);
            }

            td {
              background-color: #e7ffab91 !important;
            }
          }
        }
      }

      &.side-by-side-file-diff {
        .d2h-code-side-linenumber.d2h-info {
          pointer-events: none;
        }
      }

      [data-annotated='true'] [data-content-for-line-number],
      [data-content-for-line-number=''],
      .d2h-emptyplaceholder[data-content-for-line-number=''] {
        &,
        :hover {
          [data-annotation-for-line] {
            pointer-events: none;
            display: none;
          }
        }
      }

      [data-content-for-line-number] {
        cursor: default;

        [data-annotation-for-line] {
          position: absolute;
          top: 1px;
          left: 60px;
          display: flex;
          height: 14px;
          width: 14px;
          font-weight: 600;
          background: var(--primary-7);
          color: var(--white);
          text-align: center;
          border-radius: 5px;
          align-items: center;
          justify-content: center;
          cursor: pointer;
          visibility: hidden;
        }

        &:hover [data-annotation-for-line] {
          visibility: visible;

          &:hover {
            transform: scale(1.3);
            transition: transform 0.75s;
          }
        }
      }

      &.line-by-line-file-diff {
        [data-annotation-for-line] {
          left: 102px;
        }
      }
    }

    .d2h-file-header {
      display: none;
    }

    .d2h-files-diff {
      .d2h-code-side-linenumber {
        border-left: 0;
      }
    }

    .d2h-file-side-diff {
      border-bottom-left-radius: 5px;
      border-bottom-right-radius: 5px;
    }

    .d2h-code-side-linenumber {
      width: 56px;
    }
  }

  &.readOnly {
    :global {
      .d2h-file-wrapper {
        [data-content-for-line-number] {
          cursor: default;

          [data-annotation-for-line] {
            display: none !important;
          }
        }
      }
    }
  }

  &.collapsed {
    .diffHeader {
      border-bottom-left-radius: 5px;
      border-bottom-right-radius: 5px;
    }

    .diffContent {
      display: none;
    }
  }

  .diffHeader {
    display: grid;
    align-items: center;
    background-color: var(--grey-100);
    position: sticky;
    top: var(--diff-viewer-sticky-top, 0);
    z-index: 1;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--border-color);
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;

    .fname {
      align-self: center;

      a {
        font-size: 13px !important;
        font-weight: 600 !important;
        color: var(--grey-900) !important;

        &:hover {
          color: var(--primary-7) !important;
        }
      }
    }
  }

  .viewLabel {
    display: flex;
    font-size: var(--font-size-small);
    color: var(--grey-600);
    border: 1px solid var(--grey-200);
    padding: 3px 6px;
    border-radius: 3px;
    cursor: pointer;

    input {
      display: inline-block;
      margin-right: var(--spacing-small);
    }
  }

  .diffContent {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);

    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;

    max-width: max(calc(100vw - 320px), 960px);
  }
}
