/* Flowchart modal: /flowcharts/*.svg links opened by docs/js/dbt-docs-custom.js */
.dbt-flowchart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.dbt-flowchart-dialog {
  position: relative;
  background: #fff;
  color: #111;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  max-width: min(96vw, 1400px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Zoom toolbar: bottom-right of dialog (above diagram scroll area) */
.dbt-flowchart-zoom-controls {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  z-index: 3;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.dbt-flowchart-control {
  min-width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0 0.45rem;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  background: #f4f4f4;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  color: #222;
}

.dbt-flowchart-control:hover {
  background: #e8e8e8;
}

.dbt-flowchart-zoom-fit {
  min-width: auto;
  padding: 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dbt-flowchart-close {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  z-index: 2;
  border: none;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: #333;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.dbt-flowchart-close:hover {
  background: rgba(0, 0, 0, 0.08);
}

.dbt-flowchart-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 2.25rem 1rem 3.25rem;
  -webkit-overflow-scrolling: touch;
}

/* Outer box = layout size after scale; inner holds natural-size SVG + scale() */
.dbt-flowchart-zoom-outer {
  position: relative;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
}

.dbt-flowchart-zoom-inner {
  transform-origin: 0 0;
  display: inline-block;
  vertical-align: top;
}

.dbt-flowchart-svg-host svg {
  display: block;
  max-width: none;
  height: auto;
}

.dbt-flowchart-error {
  margin: 0;
  padding: 1rem;
  max-width: 28rem;
}
