/* Math tool dedicated runtime extras — Percentage-parallel. Percentage does NOT load this. */

/* Card titles */
body.layout-family-math .ui-card__title,
body.layout-family-math .math-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ds-color-text);
}

/* Hint text below title */
body.layout-family-math .math-card__hint {
  margin: 0 0 1.15rem;
  font-size: 0.9rem;
}

/* Result actions row */
body.layout-family-math .math-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ds-color-border);
}

/* Examples grid — mobile 1-col → 2-col → 4-col */
body.layout-family-math .math-examples {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  body.layout-family-math .math-examples {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  body.layout-family-math .math-examples {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Secondary result chips */
body.layout-family-math .math-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}

body.layout-family-math .math-secondary__chip {
  background: var(--ds-color-surface-alt, #f3f4f6);
  border-radius: 0.4rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.88rem;
  color: var(--ds-color-text-muted, #555);
}

body.layout-family-math .math-secondary__chip strong {
  color: var(--ds-color-text);
  font-weight: 700;
}

/* Formula block */
body.layout-family-math .math-formula {
  background: var(--ds-color-surface-alt, #f9fafb);
  border-left: 3px solid var(--ds-color-primary, #1565c0);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0.85rem 1.1rem;
  max-width: 38rem;
}

body.layout-family-math .math-formula__eq {
  margin: 0 0 0.5rem;
  font-family: monospace;
  font-size: 1rem;
}

body.layout-family-math .math-formula__eq:last-child {
  margin-bottom: 0;
}

/* Scientific mode select */
body.layout-family-math .math-mode-select {
  width: 100%;
  margin-bottom: 1rem;
}

/* Exponent field toggle */
body.layout-family-math .math-field--exponent[hidden] {
  display: none;
}
