/* ═══════════════════════════════════════════════════
   DA RENDERER — Universal Dimensional Analysis Styles
   EnjoyChemistry — Domain-agnostic. Uses da- prefix.
   Loaded by every tool that uses dimensional analysis.
   Domain-specific colors (gl-c1, mc-c-mass, etc.) stay
   in their respective app CSS files.
   ═══════════════════════════════════════════════════ */

/* ── Track Layout ── */
.da-track-scroll { overflow-x: auto; margin: 8px 0; }
.da-track { display: inline-grid; grid-auto-flow: column; grid-template-rows: auto 2.5px auto; align-items: stretch; }
.da-track-cell { display: contents; }
.da-track-cell-border > .da-track-num,
.da-track-cell-border > .da-track-bar,
.da-track-cell-border > .da-track-den { border-left: 2.5px solid var(--text); }
.da-track-num, .da-track-den {
  padding: 6px 14px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}
.da-track-num sub, .da-track-den sub { font-size: 0.75em; }
.da-track-bar { background: var(--text); height: 2.5px; }
.da-track-val { white-space: nowrap; }
.da-track-uword { white-space: nowrap; }

/* ── Flanking Labels (mini-tracks, e.g. Dalton addition) ── */
.da-label { font-family: var(--font); font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.da-result { font-family: var(--font); font-size: 1rem; font-weight: 700; color: var(--secondary); margin-top: 6px; }

/* ── Cancel Toggle Button ── */
.da-cancel-toggle { margin-top: 2px; }

/* ── Mobile ── */
@media (max-width: 480px) {
  .da-track-scroll { width: 100%; }
}

/* ═══════════════════════════════════════════════════
   UNIT CANCELLATION ANIMATION
   ═══════════════════════════════════════════════════ */

/* Struck unit words: red diagonal line, faded */
.da-track-uword.da-struck {
  position: relative;
  animation: da-strike-fade 0.4s ease forwards;
}
.da-track-uword.da-struck::after {
  content: '';
  position: absolute;
  top: 50%; left: -2px; right: -2px;
  height: 2px;
  background: #E24B4A;
  transform: rotate(-15deg);
  transform-origin: center;
  border-radius: 1px;
  animation: da-strike-draw 0.35s ease forwards;
}

/* Surviving goal unit words: brief green pulse */
.da-track-uword.da-survive {
  animation: da-survive-pulse 0.6s ease forwards;
  border-radius: 3px;
}

@keyframes da-strike-fade {
  0%   { opacity: 1; }
  100% { opacity: 0.4; }
}
@keyframes da-strike-draw {
  0%   { transform: rotate(-15deg) scaleX(0); }
  100% { transform: rotate(-15deg) scaleX(1); }
}
@keyframes da-survive-pulse {
  0%   { background: transparent; }
  40%  { background: var(--success-bg, rgba(22,163,74,0.12)); }
  100% { background: var(--success-bg, rgba(22,163,74,0.08)); }
}

/* ═══════════════════════════════════════════════════
   STEP DISCLOSURE CARDS
   ═══════════════════════════════════════════════════ */
.da-step-controls { display: flex; align-items: center; gap: 6px; }
.da-step-card { background: var(--bg); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; transition: all 0.2s; }
.da-step-card.active { background: var(--surface); border-color: var(--primary-mid); box-shadow: var(--shadow-sm); }
.da-step-card.completed { opacity: 0.7; }
.da-step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.da-step-num { width: 24px; height: 24px; border-radius: 999px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.da-step-card.completed .da-step-num { background: var(--success-bg, #ecfdf5); color: var(--success, #16a34a); }
.da-step-title { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.da-step-body { font-size: 0.84rem; color: var(--text-muted); line-height: 1.6; }

/* ── Pre-step notes (temp conversion, mole sum) ── */
.da-track-prestep {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 6px 10px;
  background: var(--highlight-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--highlight);
  font-family: var(--font);
}

/* ── Execution / Result ── */
.da-exec-note { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; font-style: italic; }
.da-exec-result {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
  background: var(--secondary-light);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--secondary-muted);
  text-align: center;
}
