/* Graphing tab — cyan diff-theme (matches graph accent #37c0ff) */
#tab-graphing .graph-workspace-panel {
  overflow: visible;
}

.diff-cat-pill.active.diff-theme-graph,
.diff-theme-graph .diff-cat-pill.active {
  border-color: rgba(55, 192, 255, 0.55);
  color: #7dd9ff;
  background: rgba(55, 192, 255, 0.12);
  box-shadow: 0 0 18px rgba(55, 192, 255, 0.28);
}
.diff-theme-graph .diff-mode-select:focus {
  outline: none;
  border-color: rgba(55, 192, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(55, 192, 255, 0.15);
}
.diff-theme-graph .diff-preset-chip:hover {
  border-color: rgba(55, 192, 255, 0.35);
}
.diff-theme-graph .diff-rail-dot.active {
  background: #37c0ff;
  box-shadow: 0 0 10px rgba(55, 192, 255, 0.6);
}

.graph-trial-badge {
  margin-bottom: 0.5rem;
}

.graph-controls {
  margin-bottom: 1rem;
}
.fn-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.graph-fn-glass {
  border-radius: 12px;
  padding: 0.35rem;
  background: linear-gradient(145deg, rgba(55, 192, 255, 0.04), rgba(0, 0, 0, 0.28));
  border: 1px solid rgba(55, 192, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.fn-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.fn-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.fn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px dashed rgba(55, 192, 255, 0.28);
  background: rgba(55, 192, 255, 0.04);
  color: rgba(125, 217, 255, 0.88);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.fn-add::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: rgba(55, 192, 255, 0.14);
  border: 1px solid rgba(55, 192, 255, 0.35);
  font-size: 0.85rem;
  line-height: 1;
  font-weight: 700;
}
.fn-add:hover {
  border-color: rgba(55, 192, 255, 0.55);
  background: rgba(55, 192, 255, 0.1);
  color: #b8eaff;
  box-shadow: 0 0 16px rgba(55, 192, 255, 0.12);
}
.fn-add:active {
  transform: scale(0.97);
}
.fn-add:focus-visible {
  outline: none;
  border-color: rgba(55, 192, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(55, 192, 255, 0.2);
}
.fn-add[style*='display: none'] {
  display: none !important;
}

.graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}
.graph-range {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}
.graph-range input[type='number'] {
  width: 55px;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
  outline: none;
}
.graph-range input[type='number']:focus {
  border-color: rgba(55, 192, 255, 0.4);
}

.graph-opt {
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}
.graph-opt:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
}
.graph-opt.on {
  background: rgba(55, 192, 255, 0.1);
  border-color: rgba(55, 192, 255, 0.2);
  color: #37c0ff;
}

.graph-run-btn.loading {
  pointer-events: none;
  position: relative;
}
.graph-run-btn.loading::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid transparent;
  border-top-color: #37c0ff;
  animation: diffSpin 0.8s linear infinite;
}

.graph-advanced-panel[data-graph-panel-hidden='1'] {
  display: none;
}
.graph-standard-panel[data-graph-panel-hidden='1'] {
  display: none;
}

.graph-wrap {
  margin-top: 1rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}
#graph-container {
  width: 100%;
  min-height: 480px;
}

#graphStepsHost {
  margin-top: 0.65rem;
}

.graph-export {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.export-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.export-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.fn-remove {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.fn-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

@media (max-width: 640px) {
  .fn-row {
    flex-wrap: wrap;
  }
  .graph-toolbar {
    gap: 0.35rem;
  }
}
