.tooltip {
  position: fixed;
  display: inline-block;
  overflow: hidden;
  max-width: 600px;
  padding: 8px;
  border: 1px solid #ccc;
  background-color: var(--grey-10);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  line-height: 1.4;
  pointer-events: none;
  text-align: left;
  text-overflow: ellipsis;
  transition: opacity 250ms;
}

.tooltip.clickable {
  /* Make sure that the pointer events are properly triggered if it's clickable */
  pointer-events: auto;
}

.tooltipTiming {
  padding-right: 0.5em;
  color: #666;
  font-weight: bold;
}

.tooltipOneLine {
  display: flex;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltipTitle {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
}

.tooltipSwatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid #888;
  margin-right: 3px;
}

.tooltipIcon {
  display: inline-block;
  align-self: flex-end;
  margin-right: 3px;
}

.tooltipIcon > .nodeIcon {
  width: 14px;
  padding-right: 0.5em;
  margin-left: auto;
}

.tooltipHeader {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grey-40);
  font-size: 12px;
}

.tooltipDetails {
  display: grid;
  gap: 2px 5px;

  /* Make the right column "definitely" sized (ignore its intrinsic size) by setting a min-width of 0.
   * This stops long contents from overflowing the tooltip. */
  grid-template-columns: min-content minmax(0, 1fr);
}

.tooltipHeader + .tooltipDetails {
  padding-top: 5px;
}

.tooltipDetailSeparator {
  border-top: 1px solid var(--grey-40);
  margin: 4px 0;
  grid-column: 1 / 3;
}

.tooltipDetailsUrl {
  word-break: break-all;
}

.tooltipDetailsDim {
  color: var(--grey-50);
}

.tooltipLabel {
  color: var(--grey-50);
  text-align: right;
  white-space: nowrap;
}

.tooltipBackTraceTitle {
  margin: 0;
  color: var(--grey-50);
  font-size: 100%;
  font-weight: normal;
}

.tooltipDetails + .tooltipDetailsBackTrace {
  padding-top: 5px;
  border-top: 1px solid var(--grey-40);
  margin-top: 5px;
}

.tooltipLib {
  align-self: flex-end;
  color: var(--grey-50);
  white-space: nowrap;
}

.tooltipScreenshotImg {
  padding: 0.5px;
  border: 0.5px solid rgb(0 0 0 / 0.2);
  border-radius: 5px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.2);
}

/**
 * Overwrite styles for the sidebar.
 */
.sidebar .tooltipDetails {
  /* Force the details to the max-width, even if they have long pieces of text. */
  overflow: hidden;
  gap: 2px 0;

  /* Don't let the width overflow for long pieces of text */
  grid-template-columns: minmax(0, 1fr);
}

.sidebar .tooltipLabel {
  margin-top: 8px;
  color: var(--grey-60);
  font-weight: bold;
  text-align: left;
}

.sidebar .tooltipDetailSeparator {
  display: none;
}
