.jp-git-PlainText-diff {
  width: 100%;
  max-height: calc(100% - 23px);
}

.jp-git-PlainText-diff .CodeMirror-merge,
.jp-git-PlainText-diff .CodeMirror-merge .CodeMirror,
.jp-git-PlainText-diff .CodeMirror-merge .CodeMirror-merge-pane {
  height: 100%;
}

.jp-git-PlainText-diff .CodeMirror-merge-gap {
  z-index: 2;
  display: inline-block;
  height: 100%;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  overflow: hidden;
  border-left: var(--codemirror-border);
  border-right: var(--codemirror-border);
  position: relative;
  color: var(--jp-ui-font-color2);
  background: var(--jp-layout-color2);
}

.jp-git-PlainText-diff .CodeMirror-merge-r-inserted,
.jp-git-PlainText-diff .CodeMirror-merge-l-inserted {
  background-position: bottom left;
  background-repeat: repeat-x;
}

.jp-git-PlainText-diff .CodeMirror-merge-r-deleted,
.jp-git-PlainText-diff .CodeMirror-merge-l-deleted {
  background-position: bottom left;
  background-repeat: repeat-x;
}

.jp-git-PlainText-diff .CodeMirror-merge-left .CodeMirror-merge-l-chunk,
.jp-git-PlainText-diff .CodeMirror-merge-right .CodeMirror-merge-r-chunk {
  background-color: var(--jp-git-diff-deleted-color);
}

.jp-git-PlainText-diff .CodeMirror-merge-l-chunk,
.jp-git-PlainText-diff .CodeMirror-merge-editor .CodeMirror-merge-l-chunk,
.jp-git-PlainText-diff .CodeMirror-merge-editor .CodeMirror-merge-r-chunk {
  background-color: var(--jp-git-diff-added-color);
}

.CodeMirror-patchgutter {
  width: 0.7em;
}

.CodeMirror-patchgutter-insert::before {
  content: '+';
  color: #999;
  background-color: var(--jp-git-diff-added-color);
}

.CodeMirror-patchgutter-delete::before {
  content: '-';
  color: #999;
  background-color: var(--jp-git-diff-deleted-color);
}

/* Styles for horizontal scroll lock */
.jp-git-PlainText-diff .CodeMirror-merge-scrolllock {
  color: var(--jp--inverse-layout-color2);
}
.jp-git-PlainText-diff .CodeMirror-merge-scrolllock:after {
  content: '\21db\00a0\00a0\21da';
}
.jp-git-PlainText-diff
  .CodeMirror-merge-scrolllock.CodeMirror-merge-scrolllock-enabled:after {
  content: '\21db\21da';
}

/* Styles for revert buttons handling */

.jp-git-PlainText-diff .CodeMirror-merge-copybuttons-left,
.jp-git-PlainText-diff .CodeMirror-merge-copybuttons-right {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  line-height: 1;
}

.jp-git-PlainText-diff .CodeMirror-merge-copy {
  position: absolute;
  cursor: pointer;
  color: var(--jp-brand-color1);
  z-index: 3;
}

.jp-git-PlainText-diff .CodeMirror-merge-copy-reverse {
  position: absolute;
  cursor: pointer;
  color: var(--jp-brand-color1);
}

.jp-git-PlainText-diff
  .CodeMirror-merge-copybuttons-left
  .CodeMirror-merge-copy {
  left: 2px;
}
.jp-git-PlainText-diff
  .CodeMirror-merge-copybuttons-right
  .CodeMirror-merge-copy {
  right: 2px;
}
