/* ODE / PDE differential solver UI */
.diff-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.35rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.diff-mode-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  white-space: nowrap;
}
.diff-mode-select {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 100%;
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.diff-theme-ode .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-pde .diff-mode-select:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
}
.diff-panels-wrap {
  margin-top: 0.25rem;
}
.diff-preset-chip--applied {
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
  background: rgba(34, 197, 94, 0.08);
}
.diff-enhance-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.65rem 0 0.85rem;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.diff-enhance-label {
  width: 100%;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.15rem;
}
.diff-cat-pill {
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.74rem;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, color 0.25s, background 0.25s;
}
.diff-cat-pill:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
}
.calculus-sub-nav {
  margin-bottom: 1rem;
}

.diff-cat-pill.active.diff-theme-calc,
.diff-theme-calc .diff-cat-pill.active {
  border-color: rgba(55, 192, 255, 0.55);
  color: #7dd9ff;
  background: rgba(55, 192, 255, 0.1);
  box-shadow: 0 0 18px rgba(55, 192, 255, 0.25);
}
.diff-cat-pill.active.diff-theme-ode,
.diff-theme-ode .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-cat-pill.active.diff-theme-pde {
  border-color: rgba(168, 85, 247, 0.55);
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.12);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.28);
}
.diff-preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.35rem 0 0.5rem;
}
.diff-preset-chip {
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  cursor: pointer;
  transition: all 0.2s;
}
.diff-preset-chip:hover {
  border-color: rgba(55, 192, 255, 0.35);
  color: rgba(255, 255, 255, 0.75);
}
.diff-trial-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.diff-trial-available {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
  animation: diffBadgePulse 2.5s ease-in-out infinite;
}
.diff-trial-used {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
}
@keyframes diffBadgePulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(34, 197, 94, 0);
  }
  50% {
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
  }
}
.diff-solve-btn.loading {
  pointer-events: none;
  position: relative;
}
.diff-solve-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;
}
@keyframes diffSpin {
  to {
    transform: rotate(360deg);
  }
}
.diff-step-rail {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0;
}
.diff-rail-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.diff-theme-ode .diff-rail-dot.active {
  background: #37c0ff;
  box-shadow: 0 0 10px rgba(55, 192, 255, 0.6);
  transform: scale(1.2);
}
.diff-theme-pde .diff-rail-dot.active {
  background: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
  transform: scale(1.2);
}
.diff-steps-wrap {
  margin-top: 0.5rem;
}
.diff-step-card {
  position: relative;
}
.diff-step-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}
.diff-step-text .mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  display: block;
  margin-top: 0.35rem;
  white-space: pre-wrap;
}
.diff-katex-block {
  margin: 0.35rem 0;
  overflow-x: auto;
}
.diff-step-blurred {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  opacity: 0.55;
}
.diff-trial-cta {
  text-align: center;
  padding: 1rem;
  margin-top: 0.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(55, 192, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.diff-trial-cta p {
  margin: 0 0 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}
.diff-trial-cta-btn {
  text-decoration: none;
  display: inline-block;
}
#odeStepsHost,
#pdeStepsHost {
  margin-top: 0.65rem;
}
@media (prefers-reduced-motion: reduce) {
  .diff-step-card,
  .diff-trial-available,
  .diff-solve-btn.loading::after {
    animation: none !important;
  }
  .diff-cat-pill {
    transition: none;
  }
}
