/* The Git tool window: branch tree, commit graph and commit details. */

.git {
  flex: 1;
  min-height: 0;
  display: flex;
  border-top: 1px solid var(--line);
}
.g-br {
  width: var(--g-br, 230px);
  flex: none;
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 4px 0;
}
.g-br .row {
  --d: 0;
}
.g-br h5 {
  margin: 6px 10px 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.g-log {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.g-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  flex: none;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.g-bar .in {
  height: 24px;
  width: 170px;
}
.g-bar .tbtn {
  height: 24px;
  color: var(--muted);
}
.g-bar .tbtn b {
  color: var(--fg);
  font-weight: 500;
}
.g-rows {
  flex: 1;
  overflow: auto;
  position: relative;
}
.g-rows svg {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}
.g-row {
  height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 var(--gw, 64px);
  white-space: nowrap;
  width: 100%;
  text-align: left;
}
.g-row:hover {
  background: var(--hover);
}
.g-row.on {
  background: var(--sel);
}
.g-row .msg {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 60px;
  flex: 0 1 auto;
}
.g-row .who,
.g-row .when {
  color: var(--muted);
  font-size: 12px;
  flex: none;
}
.g-row .who {
  margin-left: auto;
  padding-left: 12px;
}
.g-row .when {
  width: 92px;
  text-align: right;
}
/* the repository a commit is of, where the log has the commits of several: a stripe in the repository's colour, which
   says its name once it is clicked */
.g-row .g-root {
  flex: none;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--of);
  cursor: pointer;
}
.g-row .g-root.named {
  width: auto;
  /* about as wide as the longest of the names, so that what follows a name starts where it does in the other rows */
  min-width: calc(var(--letters, 0) * 0.6em + 14px);
  box-sizing: border-box;
  height: 17px;
  padding: 0 4px 0 6px;
  border-radius: 0;
  border-left: 4px solid var(--of);
  background: none;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}
.lbl {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: 4px;
  font: 11px var(--mono);
  border: 1px solid currentColor;
  flex: none;
}
.g-det {
  width: var(--g-det, 270px);
  flex: none;
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 10px 12px;
  font-size: 12.5px;
}
.g-det h6 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  text-wrap: balance;
}
.g-det p {
  margin: 0 0 10px;
  color: var(--muted);
}
.g-det div {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 22px;
  white-space: nowrap;
  overflow: hidden;
}
/* the rest of a commit's message, the branches that have it, and a file under the item it is of */
.g-det .g-body {
  margin: 0 0 8px;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.g-det .g-in {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-det .g-file {
  padding-left: 22px;
}
.g-det .g-file small {
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
}
/* a commit with more files than are listed says how many more, and lists more of them */
.g-det .g-more {
  margin: 4px 0 0 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  cursor: pointer;
}
/* the bar between two parts of a tool window that are side by side or one over the other: it lies over the line
   between them and is dragged to give one of them more room */
.sash {
  flex: none;
  z-index: 3;
  touch-action: none;
  width: 6px;
  margin: 0 -3px;
  cursor: col-resize;
}
.sash.row {
  width: auto;
  height: 6px;
  margin: -3px 0;
  cursor: row-resize;
}
.sash:hover {
  background: var(--accent);
  opacity: 0.5;
}
/* the small arrow of a button that opens a list under itself */
.i.drop {
  width: 12px;
  height: 12px;
  margin-left: -3px;
}
@container (max-width:900px) {
  .g-det,
  #g-sash-det {
    display: none;
  }
}
@container (max-width:560px) {
  .git {
    flex-direction: column;
  }
  #g-sash-br {
    display: none;
  }
  .g-br {
    width: auto;
    max-height: 38%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .g-row .when {
    display: none;
  }
}

/* "Push Commits": the line of the branch with the commits that go out under it, and beside them the files of what is
   selected there, folder by folder */
.push {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: min(360px, 55vh);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.push-c,
.push-f {
  overflow: auto;
  padding: 4px 0;
}
.push-f {
  border-left: 1px solid var(--line);
}
.push-l,
.push-r {
  display: block;
  width: 100%;
  height: var(--row);
  padding: 0 10px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.push-l b {
  font-weight: 500;
  color: var(--link);
}
.push-r {
  padding-left: 26px;
}
.push-l.on,
.push-r.on {
  background: var(--sel);
}
.push-new {
  margin-left: 4px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
}
.push-d {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--row);
  padding: 0 10px;
}
.push-d small {
  color: var(--dim);
}
.push-f .sf-f {
  padding-left: 30px;
}

/* "Update Info": the commits that came in, with no graph beside them, and the files that are another now */
.g-up .g-row {
  padding-left: 10px;
  cursor: default;
}
.g-uf {
  width: 42%;
  max-width: 480px;
  flex: none;
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 6px 0;
}
.g-uf h6 {
  margin: 0;
  padding: 2px 10px 6px;
  font-size: 12.5px;
  font-weight: 600;
}
.g-uf .sf-f {
  padding-left: 10px;
}
.g-tab-x {
  align-self: center;
}
/* the history of a file: its commits are chosen as those of the log are, and the one that is chosen is beside them */
.g-hist .g-row {
  cursor: pointer;
}
.g-hist .g-uf {
  padding: 8px 10px;
}
.g-hist .g-uf .g-body {
  margin: 0 0 6px;
  font: inherit;
  white-space: pre-wrap;
}
.g-hist .g-uf p {
  margin: 0;
  color: var(--muted);
}
/* a branch beside what is checked out: two lists of commits, each under what it is */
.g-cmp .g-log h6 {
  margin: 0;
  padding: 8px 10px 4px;
  font-size: 12.5px;
  font-weight: 600;
}
.g-cmp .g-log {
  overflow: auto;
}
.g-cmp .g-rows {
  flex: none;
  overflow: visible;
  padding-bottom: 6px;
}
.g-cmp .g-none {
  padding: 2px 10px;
  color: var(--dim);
}
@container (max-width:560px) {
  .g-uf {
    width: auto;
    max-width: none;
    max-height: 45%;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* The Branches popup: a field to search in over lines that scroll where they are many. What can be done with a branch
   opens beside its line, placed in the window, so that the scrolling does not cut it off. */
.menu.branches {
  width: 330px;
  max-width: calc(100vw - 12px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}
.menu.branches > .mi > .menu {
  position: fixed;
  right: auto;
}
.br-find {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.br-find input {
  flex: 1;
  min-width: 0;
  height: 24px;
  border: 0;
  outline: 0;
  background: none;
  color: inherit;
  font: inherit;
}
.br-folder.unfolded .br-turn {
  transform: rotate(90deg);
}
/* the files that are in the way of a checkout */
.br-way {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 0;
}
