.tcfx-plot-wrap {
  box-sizing: border-box;
  margin: 1.25rem 0;
  width: 100%;
  color: inherit;
}

.tcfx-plot-wrap *,
.tcfx-plot-wrap *::before,
.tcfx-plot-wrap *::after {
  box-sizing: border-box;
}

.tcfx-plot-title {
  margin: 0 0 .5rem;
  font-weight: 600;
  line-height: 1.4;
}


.tcfx-grid-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--tcfx-grid-gap, 24px);
}

.tcfx-grid-group-column {
  flex-direction: column;
}

.tcfx-grid-group-row {
  flex-direction: row;
}

.tcfx-grid-item {
  flex: 1 1 320px;
  min-width: 260px;
}

.tcfx-grid-item .tcfx-plot-title {
  margin: 0 0 .5rem;
}

.tcfx-board {
  width: 100%;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(127, 127, 127, .28);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  cursor: default;
  touch-action: none;
}

.tcfx-board-interactive {
  cursor: grab;
}

.tcfx-board-interactive:active {
  cursor: grabbing;
}

.tcfx-board .JXGtext,
.tcfx-board .JXGinfobox,
.tcfx-board svg text,
.tcfx-board text {
  color: currentColor !important;
  fill: currentColor !important;
}

.tcfx-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .5rem .875rem;
  margin-top: .75rem;
}

.tcfx-controls[hidden] {
  display: none;
}

.tcfx-slider-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: .5rem;
  align-items: center;
  font-size: .925rem;
}

.tcfx-var-name {
  min-width: 1.5em;
}

.tcfx-slider-row input[type="range"] {
  width: 100%;
}

.tcfx-slider-value {
  min-width: 3.5em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tcfx-error {
  border: 1px solid #d33;
  border-radius: 8px;
  padding: .75rem .9rem;
  color: #a40000;
  background: rgba(255, 0, 0, .06);
  white-space: pre-wrap;
}

@media (prefers-color-scheme: dark) {
  .tcfx-plot-wrap {
    color: #e5e7eb;
  }

  .tcfx-board {
    background: #111827;
    border-color: rgba(255, 255, 255, .18);
  }

  .tcfx-error {
    color: #fecaca;
    background: rgba(127, 29, 29, .28);
    border-color: rgba(248, 113, 113, .55);
  }
}

html.dark .tcfx-plot-wrap,
body.dark .tcfx-plot-wrap,
body.theme-dark .tcfx-plot-wrap,
[data-theme="dark"] .tcfx-plot-wrap {
  color: #e5e7eb;
}

html.dark .tcfx-board,
body.dark .tcfx-board,
body.theme-dark .tcfx-board,
[data-theme="dark"] .tcfx-board {
  background: #111827;
  border-color: rgba(255, 255, 255, .18);
}

html.dark .tcfx-error,
body.dark .tcfx-error,
body.theme-dark .tcfx-error,
[data-theme="dark"] .tcfx-error {
  color: #fecaca;
  background: rgba(127, 29, 29, .28);
  border-color: rgba(248, 113, 113, .55);
}
