.girafe {
  margin-left: auto;
  margin-right: auto;
}
/* fill mode (e.g. in bslib::page_fillable()): auto margins would prevent
   the widget from stretching to the size of its container */
.html-fill-container > .girafe.html-fill-item {
  margin-left: 0;
  margin-right: 0;
}
.girafe_container_fill {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.girafe_container_fill > svg {
  flex: 1 1 0;
  min-height: 0;
}
.girafe_container_std {
  margin-left: auto;
  margin-right: auto;
  position: relative;
  text-align: center;
}

.girafe_container_ie {
  height: 0;
}
.girafe_svg_ie {
  position: absolute;
  top: 0;
  left: 0;
}

/* toolbar colors can be customised with these CSS variables, set by
   opts_toolbar() or by a stylesheet */
.ggiraph-toolbar {
  background-color: rgb(255, 255, 255);
  background-color: var(--ggiraph-toolbar-bg, rgba(255, 255, 255, 0.3));
  border-radius: 5px;
  padding: 2px;
}
.ggiraph-toolbar-floating {
  position: absolute;
  opacity: 0;
}
.ggiraph-toolbar-top,
.ggiraph-toolbar-bottom {
  text-align: center;
}
.ggiraph-toolbar-topleft,
.ggiraph-toolbar-bottomleft {
  text-align: left;
}
.ggiraph-toolbar-topright,
.ggiraph-toolbar-bottomright {
  text-align: right;
}
.ggiraph-toolbar-floating-top {
  top: 3px;
  right: 0;
  left: 0;
}
.ggiraph-toolbar-floating-topleft {
  top: 3px;
  left: 3px;
}
.ggiraph-toolbar-floating-topright {
  top: 3px;
  right: 3px;
}
.ggiraph-toolbar-floating-bottom {
  bottom: 3px;
  right: 0;
  left: 0;
}
.ggiraph-toolbar-floating-bottomleft {
  left: 3px;
  bottom: 3px;
}
.ggiraph-toolbar-floating-bottomright {
  right: 3px;
  bottom: 3px;
}

.ggiraph-toolbar-block {
  display: inline-block;
}
.ggiraph-toolbar-block:not(:last-child) {
  margin-right: 10px;
}

.ggiraph-toolbar-icon {
  display: inline-block;
  cursor: pointer;
  border: 0;
  padding: 0;
  margin: 0;
  width: 15pt;
  height: 15pt;
}
.ggiraph-toolbar-icon:not(:last-child) {
  margin-right: 3px;
}

.ggiraph-toolbar-icon svg {
  pointer-events: none;
}

.ggiraph-toolbar-icon.drop {
  stroke: var(--ggiraph-toolbar-icon-active-color, #e30c37);
  fill: var(--ggiraph-toolbar-icon-active-color, #e30c37);
}
.ggiraph-toolbar-icon.drop:hover {
  stroke: var(--ggiraph-toolbar-icon-hover-color, #333);
  fill: var(--ggiraph-toolbar-icon-hover-color, #333);
}
.ggiraph-toolbar-icon.neutral {
  stroke: var(--ggiraph-toolbar-icon-color, #069);
  fill: var(--ggiraph-toolbar-icon-color, #069);
}
.ggiraph-toolbar-icon.neutral:hover {
  stroke: var(--ggiraph-toolbar-icon-hover-color, #333);
  fill: var(--ggiraph-toolbar-icon-hover-color, #333);
}

.ggiraph-svg .lasso path {
  stroke: rgb(80, 80, 80);
  stroke-width: 1px;
}

.ggiraph-svg .lasso .drawn {
  fill-opacity: 0.05;
}

.ggiraph-svg .lasso .loop_close {
  fill: none;
  stroke-dasharray: 4, 4;
}

.ggiraph-svg .lasso .origin {
  fill: #333;
  fill-opacity: 0.5;
}

.ggiraph-svg .dragrect rect {
  stroke: rgb(80, 80, 80);
  stroke-width: 1px;
  fill-opacity: 0.05;
}

/* disable pointer events for non-interactive elements */
.ggiraph-svg .ggiraph-svg-rootg circle:not([id]),
.ggiraph-svg .ggiraph-svg-rootg image:not([id]),
.ggiraph-svg .ggiraph-svg-rootg line:not([id]),
.ggiraph-svg .ggiraph-svg-rootg path:not([id]),
.ggiraph-svg .ggiraph-svg-rootg polygon:not([id]),
.ggiraph-svg .ggiraph-svg-rootg polyline:not([id]),
.ggiraph-svg .ggiraph-svg-rootg rect:not([id]):not(.ggiraph-svg-bg),
.ggiraph-svg .ggiraph-svg-rootg text:not([id]) {
  pointer-events: none;
}

/* default pointer events for interactive elements */
.ggiraph-svg .ggiraph-svg-rootg [id] {
  pointer-events: all;
}

/* fullscreen modal styles */
.ggiraph-fullscreen-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ggiraph-fullscreen-content {
  position: relative;
  /* sizes below are those of the content box, padding excluded, so that
     the aspect ratio set inline by the fullscreen handler applies to the
     svg itself; width and height are overridden there too */
  box-sizing: content-box;
  width: calc(92vw - 40px);
  height: calc(92vh - 40px);
  max-width: calc(92vw - 40px);
  max-height: calc(92vh - 40px);
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ggiraph-fullscreen-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ggiraph-fullscreen-close:hover {
  background-color: #e30c37;
  color: white;
}
