/* Math & Education family — formula-first, large answer */


.math-hero { padding: clamp(1.5rem, 4vw, 2.25rem) 0 0.35rem; }

.math-workspace { padding: 1.15rem 0 0.5rem; }
.math-workspace__grid {
  display: grid;
  gap: 1.15rem;
  align-items: start;
}

.math-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}
.math-mode {
  border: 1px solid var(--ds-color-border);
  background: var(--ds-color-surface);
  color: var(--ds-color-text-secondary);
  font: inherit;
  font-size: var(--ds-text-sm);
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  border-radius: var(--ds-radius-pill);
  cursor: pointer;
}
.math-mode.is-active {
  background: var(--ds-color-text);
  color: #fff;
  border-color: var(--ds-color-text);
}

.math-fields { display: grid; gap: 1rem; }
.math-input {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 1rem 1.1rem;
  min-height: 3.5rem;
}

.math-card--result {
  text-align: left;
  min-height: 240px;
  background: linear-gradient(180deg, #f8fafc 0%, var(--ds-color-surface) 50%);
}
.math-result__label {
  margin: 0;
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.math-result__value {
  margin: 0.35rem 0 0.5rem;
  font-size: var(--ds-text-result);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ds-color-text);
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}
.math-result__unit {
  font-size: 0.45em;
  color: var(--ds-color-primary);
  font-weight: 700;
}
.math-result__eq {
  margin: 0 0 1rem;
  font-family: var(--ds-font-mono);
  font-size: var(--ds-text-sm);
  color: var(--ds-color-text-secondary);
  padding: 0.65rem 0.8rem;
  background: var(--ds-color-surface-muted);
  border-radius: var(--ds-radius-sm);
}
.math-steps {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ds-color-text-secondary);
  font-size: var(--ds-text-sm);
  line-height: 1.55;
}
.math-steps strong { color: var(--ds-color-text); }

.math-formula {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-md);
  background: var(--ds-color-surface);
  font-size: 1.05rem;
}
.math-formula code { font-family: var(--ds-font-mono); }

.math-examples {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 700px) {
  .math-examples { grid-template-columns: repeat(3, 1fr); }
}
.math-ex {
  text-align: left;
  border: 1px solid var(--ds-color-border);
  background: var(--ds-color-surface);
  border-radius: var(--ds-radius-md);
  padding: 1rem 1.1rem;
  cursor: pointer;
  font: inherit;
}
.math-ex:hover { border-color: var(--ds-color-primary); }
.math-ex strong { display: block; margin-bottom: 0.25rem; }
.math-ex span { color: var(--ds-color-text-secondary); font-size: var(--ds-text-sm); }

@media (min-width: 900px) {
  .math-workspace__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.35rem;
  }
  .math-result-col {
    position: sticky;
    top: var(--ds-sticky-top);
  }
}

/* More about this calculator — Finance-parity reading card (ds tokens) */
body.layout-family-math .ui-reading-section {
  background: var(--ds-color-bg);
}
body.layout-family-math .ui-reading {
  background: var(--ds-color-surface);
  border: 1px solid var(--ds-color-border);
  border-left: 4px solid var(--ds-color-accent);
  border-radius: var(--ds-radius-md);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 1.85rem);
  box-shadow: var(--ds-shadow-md);
  max-width: 42rem;
}
body.layout-family-math .ui-reading__title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ds-color-text);
}
body.layout-family-math .ui-reading__body {
  color: var(--ds-color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
}
body.layout-family-math .ui-reading__body h2,
body.layout-family-math .ui-reading__body h3 {
  color: var(--ds-color-text);
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 650;
}
body.layout-family-math .ui-reading__body h2:first-child,
body.layout-family-math .ui-reading__body h3:first-child {
  margin-top: 0;
}
body.layout-family-math .ui-reading__body p {
  margin: 0 0 0.85rem;
}
body.layout-family-math .ui-reading__body p:last-child {
  margin-bottom: 0;
}
body.layout-family-math .ui-reading__body ul,
body.layout-family-math .ui-reading__body ol {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
}
body.layout-family-math .ui-reading__body li {
  margin: 0.25rem 0;
}

/* FAQ accordion — Finance-parity on Math pages */
body.layout-family-math .section-heading {
  margin: 0 0 1rem;
  font-size: var(--ds-text-xl);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ds-color-text);
}
body.layout-family-math .faq-accordion .accordion-item {
  background: var(--ds-color-surface);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-md);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
body.layout-family-math .faq-accordion .accordion-button {
  font-weight: 650;
  font-size: var(--ds-text-sm);
  color: var(--ds-color-text);
  background: var(--ds-color-surface);
  box-shadow: none;
  padding: 0.95rem 1.1rem;
}
body.layout-family-math .faq-accordion .accordion-button:not(.collapsed) {
  color: var(--ds-color-primary-deep);
  background: var(--ds-color-primary-soft);
  box-shadow: none;
}
body.layout-family-math .faq-accordion .accordion-button:focus {
  box-shadow: var(--ds-focus-ring);
}
body.layout-family-math .faq-accordion .accordion-body {
  color: var(--ds-color-text-secondary);
  font-size: var(--ds-text-sm);
  line-height: 1.6;
  padding: 0.85rem 1.1rem 1.1rem;
}
body.layout-family-math .faq-accordion .accordion-body p {
  margin: 0 0 0.85rem;
}
body.layout-family-math .faq-accordion .accordion-body p:last-child {
  margin-bottom: 0;
}
