/* MathMentor Midnight Athenaeum tokens: Math views only (data-active-product="math").
   Values are copied from research-athenaeum-tokens.css; keep the two in step by hand.
   Variables are set on body, not :root, so they override the palette that app/theme.js
   writes inline on <html>. Screen only: printing keeps the black-on-white rules in app.css.
   KaTeX keeps its own fonts; never set font-family on .katex. */

@media screen {

html[data-active-product="math"] .btn-theme-switch-wrap {
  display: none !important;
}

/* ---------- Raw values (also used by the Math card on the start page) ---------- */

html[data-active-product="math"] body,
html[data-active-product="platform"] .main-header-row,
#launcher-workspace,
#platform-entry,
#classroom-workspace,
.launcher-card--math,
.launcher-card--research,
.launcher-card--economics,
.launcher-card--classroom {
  --mm-background: oklch(0.17 0.032 265);
  --mm-foreground: oklch(0.95 0.008 250);
  --mm-surface: oklch(0.213 0.031 264);
  --mm-surface-raised: oklch(0.245 0.034 264);
  --mm-muted: oklch(0.71 0.021 258);
  --mm-border: oklch(0.32 0.03 264);
  --mm-border-strong: oklch(0.42 0.028 264);
  --mm-gold: oklch(0.82 0.108 85);
  --mm-gold-soft: oklch(0.88 0.06 88);
  --mm-gold-hover: color-mix(in oklab, var(--mm-gold) 16%, transparent);
  --mm-accent: oklch(0.72 0.09 205);
  --mm-danger: #f87171;
  --mm-success: #4ade80;
  --mm-warning: #fbbf24;
  --mm-info: oklch(0.72 0.02 250);
  --mm-font-display: "Cormorant Garamond", "Times New Roman", serif;
  --mm-font-ui: "Commissioner", "Segoe UI", sans-serif;
  --mm-radius: 0.5rem;
  --mm-shadow-elevated: 0 24px 60px -30px oklch(0.08 0.03 265 / 0.9);
  --mm-shadow-gold: 0 0 0 1px color-mix(in oklab, var(--mm-gold) 42%, transparent),
    0 18px 40px -28px color-mix(in oklab, var(--mm-gold) 28%, transparent);
}

html[data-theme="light"][data-active-product="math"] body,
html[data-theme="light"][data-active-product="platform"] .main-header-row,
html[data-theme="light"] #launcher-workspace,
html[data-theme="light"] #platform-entry,
html[data-theme="light"] #classroom-workspace,
html[data-theme="light"] .launcher-card--math,
html[data-theme="light"] .launcher-card--research,
html[data-theme="light"] .launcher-card--economics,
html[data-theme="light"] .launcher-card--classroom {
  --mm-background: oklch(0.97 0.012 85);
  --mm-foreground: oklch(0.22 0.028 265);
  --mm-surface: oklch(0.99 0.008 85);
  --mm-surface-raised: oklch(0.995 0.01 78);
  --mm-muted: oklch(0.38 0.018 258);
  --mm-border: oklch(0.86 0.014 80);
  --mm-border-strong: oklch(0.72 0.02 80);
  --mm-gold: oklch(0.50 0.12 80);
  --mm-gold-soft: oklch(0.45 0.10 80);
  --mm-gold-hover: color-mix(in oklab, var(--mm-gold) 12%, transparent);
  --mm-accent: oklch(0.55 0.05 205);
  --mm-danger: #b91c1c;
  --mm-success: #166534;
  --mm-warning: #b45309;
  --mm-info: oklch(0.42 0.02 250);
  --mm-shadow-elevated: 0 16px 40px -28px oklch(0.35 0.02 80 / 0.28);
  --mm-shadow-gold: 0 0 0 1px color-mix(in oklab, var(--mm-gold) 38%, transparent),
    0 14px 32px -24px color-mix(in oklab, var(--mm-gold) 18%, transparent);
}

/* ---------- App variables inside the Math views ---------- */

/* app.css pairs the button gradient with white text in about 30 places (calculator, keyboard,
   notebook, tabs), so the gradient stays dark in both themes. --accent-subtle fills large areas
   (calculator keys, the function builder); more than a few percent of gold over navy turns grey. */
html[data-active-product="math"] body {
  --bg-page: var(--mm-background);
  --bg: var(--mm-background);
  --card-bg: var(--mm-surface);
  --card-border: var(--mm-border);
  --text: var(--mm-foreground);
  --text-muted: var(--mm-muted);
  --tab-bg: color-mix(in oklab, var(--mm-foreground) 7%, var(--mm-surface));
  --tab-active-bg: var(--mm-surface-raised);
  --tab-active-text: var(--mm-foreground);
  --input-border: var(--mm-border);
  --input-focus: var(--mm-gold);
  --divider: var(--mm-border);
  --accent: var(--mm-gold);
  --accent-subtle: color-mix(in oklab, var(--mm-gold) 6%, var(--mm-surface-raised));
  --accent-fg: var(--mm-gold);
  --btn-primary-bg: var(--mm-gold);
  --btn-primary-hover: var(--mm-gold-soft);
  --btn-ghost-bg: color-mix(in oklab, var(--mm-foreground) 5%, transparent);
  --btn-ghost-text: var(--mm-muted);
  --btn-secondary-bg: color-mix(in oklab, var(--mm-foreground) 4%, transparent);
  --btn-secondary-tint: color-mix(in oklab, var(--mm-foreground) 6%, transparent);
  --btn-border: var(--mm-border);
  --btn-text: var(--mm-foreground);
  --btn-gradient-start: var(--mm-border-strong);
  --btn-gradient-end: var(--mm-border);
  --ai-accent-from: var(--mm-gold);
  --ai-accent-to: var(--mm-gold-soft);
  --ai-accent-red: var(--mm-accent);
  --ai-glow: color-mix(in oklab, var(--mm-gold) 22%, transparent);
  --ai-btn-hover: var(--mm-gold-soft);
  --ai-options-card-bg: color-mix(in oklab, var(--mm-gold) 5%, var(--mm-surface));
  --ai-options-card-border: color-mix(in oklab, var(--mm-gold) 28%, var(--mm-border));
  --ai-options-card-hover: color-mix(in oklab, var(--mm-gold) 10%, var(--mm-surface));
  --ai-options-card-active-border: var(--mm-gold);
  --fw-type-active-bg: var(--mm-surface-raised);
  --fw-type-active-text: var(--mm-gold);
  --fw-type-active-border: color-mix(in oklab, var(--mm-gold) 55%, transparent);
  --fw-type-active-shadow: none;
  --fw-btn-bg: var(--mm-surface);
  --fw-btn-border: var(--mm-border);
  --fw-btn-hover-bg: var(--mm-surface-raised);
  --kbd-bg: var(--mm-surface);
  --kbd-border: var(--mm-border);
  --kbd-key-bg: var(--mm-surface-raised);

  font-family: var(--mm-font-ui);
  background: var(--mm-background);
  color: var(--mm-foreground);
}

html[data-theme="light"][data-active-product="math"] body {
  --btn-gradient-start: oklch(0.36 0.035 264);
  --btn-gradient-end: oklch(0.44 0.035 264);
  --tab-active-text: var(--mm-surface);
}

:where(html[data-active-product="math"] body) :where(button, select) {
  font-family: inherit;
}

html[data-active-product="math"] .app-title,
html[data-active-product="math"] .product-context-bar__product,
html[data-active-product="math"] .answer-header-title,
html[data-active-product="math"] .modal-title {
  font-family: var(--mm-font-display);
  letter-spacing: 0.005em;
}

html[data-active-product="math"] .product-context-bar__product,
html[data-active-product="math"] .answer-header-title {
  font-size: 1.2rem;
  font-weight: 600;
}

/* ---------- Header ---------- */

html[data-active-product="math"] .main-header-row {
  border-bottom: 1px solid color-mix(in oklab, var(--mm-gold) 38%, var(--mm-border));
}

html[data-active-product="math"] .app-title .title-icon {
  color: var(--mm-gold);
}

html[data-active-product="math"] .app-title .title-icon svg {
  filter: none;
}

html[data-active-product="math"] .main-header-row .theme-btn {
  background: var(--mm-surface);
  color: var(--mm-foreground);
  border-color: var(--mm-border);
}

html[data-active-product="math"] .main-header-row .theme-btn.active {
  background: var(--mm-surface-raised);
  color: var(--mm-gold);
  border-color: color-mix(in oklab, var(--mm-gold) 55%, transparent);
}

html[data-active-product="math"] .lang-btn.lang-switch-trigger {
  background: var(--mm-surface-raised);
  color: var(--mm-foreground);
  border-color: var(--mm-border);
  box-shadow: none;
}

html[data-active-product="math"] .lang-menu-item.active,
html[data-active-product="math"] .lang-btn.active {
  background: var(--mm-gold-hover);
  color: var(--mm-gold);
  border-color: color-mix(in oklab, var(--mm-gold) 45%, transparent);
}

html[data-active-product="math"] .product-context-bar--math {
  border-left-color: var(--mm-gold);
}

html[data-active-product="math"] .product-context-subnav__btn--active,
html[data-active-product="math"] .tool-tab.active,
html[data-active-product="math"] .stats-tab.active {
  background: var(--mm-surface-raised);
  color: var(--mm-gold);
  border-color: color-mix(in oklab, var(--mm-gold) 55%, transparent);
}

html[data-active-product="math"] .tool-tab.active,
html[data-active-product="math"] .stats-tab.active {
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--mm-gold) 55%, transparent);
}

html[data-active-product="math"] .math-conventions-count {
  background: var(--mm-gold-hover);
  color: var(--mm-gold);
}

/* ---------- Buttons ---------- */

html[data-active-product="math"] .btn-ai-primary {
  background: var(--mm-surface-raised);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  color: var(--mm-gold);
  box-shadow: none;
  font-weight: 600;
}

html[data-active-product="math"] .btn-ai-primary:hover:not(:disabled) {
  background: var(--mm-gold-hover);
  border-color: color-mix(in oklab, var(--mm-gold) 72%, transparent);
  color: var(--mm-gold);
  box-shadow: var(--mm-shadow-gold);
  transform: translateY(-1px);
}

html[data-active-product="math"] .btn-ai-primary .btn-inline-spinner {
  border-color: color-mix(in oklab, var(--mm-gold) 30%, transparent);
  border-top-color: var(--mm-gold);
}

html[data-active-product="math"] .btn-secondary-theme,
html[data-active-product="math"] #ai-panel .btn-secondary-theme,
html[data-active-product="math"] .tool-panel .btn-secondary-theme {
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  color: var(--mm-foreground);
  box-shadow: none;
}

html[data-active-product="math"] .btn-secondary-theme:hover:not(:disabled),
html[data-active-product="math"] #ai-panel .btn-secondary-theme:hover:not(:disabled),
html[data-active-product="math"] .tool-panel .btn-secondary-theme:hover:not(:disabled) {
  background: var(--mm-surface-raised);
  border-color: var(--mm-border-strong);
  opacity: 1;
}

html[data-active-product="math"] .btn.ai-accent {
  padding: 8px 14px;
  border: 1px solid color-mix(in oklab, var(--mm-gold) 45%, transparent);
  border-radius: 10px;
  background: var(--mm-surface-raised);
  color: var(--mm-gold);
}

html[data-active-product="math"] .btn.ai-accent:hover:not(:disabled) {
  background: var(--mm-gold-hover);
  color: var(--mm-gold);
}

html[data-active-product="math"] .toast .toast-btn,
html[data-active-product="math"] .notebook-toolbar .btn.active {
  background: var(--mm-surface-raised);
  color: var(--mm-gold);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  box-shadow: none;
}

/* ---------- Answer card ---------- */

html[data-active-product="math"] #answer-card {
  border-left-color: color-mix(in oklab, var(--mm-gold) 70%, transparent);
}

html[data-active-product="math"] .answer-header-bar {
  background: linear-gradient(135deg, var(--mm-surface) 0%, color-mix(in oklab, var(--mm-gold) 5%, var(--mm-surface)) 100%);
}

html[data-active-product="math"] .answer {
  border-left-color: var(--mm-border-strong);
}

html[data-active-product="math"] .answer .ai-summary-table th {
  background: var(--mm-surface-raised);
  color: var(--mm-foreground);
}

html[data-active-product="math"] #solve-result-wrap {
  box-shadow: none;
}

html[data-active-product="math"] .solve-method-section,
html[data-active-product="math"] .solve-method-section:first-child {
  border-color: var(--mm-border);
  border-left-color: color-mix(in oklab, var(--mm-gold) 70%, transparent);
  background: var(--mm-surface);
  box-shadow: none;
}

/* ---------- Verify: keep green, amber and red; tuned for both themes ---------- */

html[data-active-product="math"] .verify-badge {
  box-shadow: none;
}

html[data-active-product="math"] .verify-badge.checking {
  color: var(--mm-muted);
  background: color-mix(in oklab, var(--mm-info) 12%, transparent);
  border-color: color-mix(in oklab, var(--mm-info) 40%, transparent);
  box-shadow: none;
}

html[data-active-product="math"] .verify-badge.checking::before {
  border-color: color-mix(in oklab, var(--mm-gold) 30%, transparent);
  border-top-color: var(--mm-gold);
}

html[data-active-product="math"] .verify-badge.verified {
  color: var(--mm-success);
  background: color-mix(in oklab, var(--mm-success) 13%, transparent);
  border-color: color-mix(in oklab, var(--mm-success) 50%, transparent);
  box-shadow: none;
}

html[data-active-product="math"] .verify-badge.uncertain,
html[data-active-product="math"] .verify-badge.not-checked {
  color: var(--mm-muted);
  background: color-mix(in oklab, var(--mm-muted) 12%, transparent);
  border-color: var(--mm-border-strong);
  box-shadow: none;
}

html[data-active-product="math"] .verify-badge.incorrect {
  color: var(--mm-danger);
  background: color-mix(in oklab, var(--mm-danger) 13%, transparent);
  border-color: color-mix(in oklab, var(--mm-danger) 55%, transparent);
  box-shadow: none;
}

html[data-active-product="math"] .verify-badge.warning,
html[data-active-product="math"] .verify-badge.partial {
  color: var(--mm-warning);
  background: color-mix(in oklab, var(--mm-warning) 13%, transparent);
  border-color: color-mix(in oklab, var(--mm-warning) 55%, transparent);
  box-shadow: none;
}

html[data-active-product="math"] .verify-issues-panel {
  border-left-color: var(--mm-warning);
  background: color-mix(in oklab, var(--mm-warning) 7%, var(--mm-surface));
}

html[data-active-product="math"] .verify-issues-panel.verify-issues-error {
  border-left-color: var(--mm-danger);
  background: color-mix(in oklab, var(--mm-danger) 7%, var(--mm-surface));
}

/* ---------- Second opinion: gold instead of purple ---------- */

html[data-active-product="math"] .second-opinion-btn {
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  background: var(--mm-surface-raised);
  color: var(--mm-gold);
}

html[data-active-product="math"] .second-opinion-btn:hover,
html[data-active-product="math"] .second-opinion-btn:focus-visible {
  background: var(--mm-gold-hover);
  outline: 2px solid color-mix(in oklab, var(--mm-gold) 60%, transparent);
  box-shadow: var(--mm-shadow-gold);
}

html[data-active-product="math"] .answer-second-opinion {
  border-left-color: color-mix(in oklab, var(--mm-gold) 70%, transparent);
}

html[data-active-product="math"] .answer-second-opinion__title {
  color: var(--mm-gold);
}

html[data-active-product="math"] .answer-second-opinion__spinner {
  border-color: color-mix(in oklab, var(--mm-gold) 30%, transparent);
  border-top-color: var(--mm-gold);
}

/* ---------- Callouts: muted gold and blue; tip, warning and mistake keep their meaning ---------- */

html[data-active-product="math"] .md-callout--keyidea,
html[data-active-product="math"] .md-callout--definition,
html[data-active-product="math"] .md-callout--formula,
html[data-active-product="math"] .md-callout--summary {
  border-left-color: color-mix(in oklab, var(--mm-gold) 75%, transparent);
  background: color-mix(in oklab, var(--mm-gold) 6%, var(--mm-surface));
}

html[data-active-product="math"] .md-callout--note,
html[data-active-product="math"] .md-callout--example,
html[data-active-product="math"] .md-callout--assumptions,
html[data-active-product="math"] .md-callout--comparison,
html[data-active-product="math"] .md-callout--interpretation {
  border-left-color: var(--mm-info);
  background: color-mix(in oklab, var(--mm-info) 8%, var(--mm-surface));
}

html[data-active-product="math"] .md-callout--tip {
  border-left-color: var(--mm-success);
  background: color-mix(in oklab, var(--mm-success) 7%, var(--mm-surface));
}

html[data-active-product="math"] .md-callout--warning {
  border-left-color: var(--mm-warning);
  background: color-mix(in oklab, var(--mm-warning) 8%, var(--mm-surface));
}

html[data-active-product="math"] .md-callout--mistake {
  border-left-color: var(--mm-danger);
  background: color-mix(in oklab, var(--mm-danger) 7%, var(--mm-surface));
}

/* ---------- Thinking and loading ---------- */

html[data-active-product="math"] .status-thinking {
  color: var(--mm-gold) !important;
  font-weight: 600;
}

html[data-active-product="math"] .thinking-spinner,
html[data-active-product="math"] .material-upload-spinner,
html[data-active-product="math"] .exam-step.step-current .exam-step-icon {
  border-color: color-mix(in oklab, var(--mm-gold) 28%, transparent);
  border-top-color: var(--mm-gold);
}

/* ---------- Modals ---------- */

html[data-active-product="math"] .modal {
  border-color: var(--mm-border);
  box-shadow: var(--mm-shadow-elevated);
}

html[data-active-product="math"] .modal-head {
  background: var(--mm-surface-raised);
  color: var(--mm-foreground);
  border-bottom: 1px solid var(--mm-border);
}

html[data-active-product="math"] .modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

html[data-active-product="math"] .modal-close {
  background: color-mix(in oklab, var(--mm-foreground) 7%, transparent);
  color: var(--mm-foreground);
}

html[data-active-product="math"] .modal-close:hover {
  background: var(--mm-gold-hover);
  color: var(--mm-gold);
}

html[data-active-product="math"] .calc-stacked-frac .calc-frac-num,
html[data-active-product="math"] .calc-stacked-frac .calc-frac-den {
  color: var(--mm-gold);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}

html[data-active-product="math"] .vkb-toggle-btn:not(.vkb-open) {
  border-color: var(--mm-border);
  background: var(--mm-surface-raised);
  color: var(--mm-gold);
  box-shadow: var(--mm-shadow-elevated);
}

/* ---------- Concept hub: same gold outline as Research, no indigo wash ---------- */

html[data-active-product="math"] .concept-domain-rail-mast {
  display: grid;
  place-items: center;
  background: var(--mm-surface);
  border-bottom-color: var(--mm-border);
}

html[data-active-product="math"] .concept-domain-rail-mast-img {
  display: none;
}

html[data-active-product="math"] .concept-domain-rail-mast::after {
  content: "π";
  font-family: var(--mm-font-display);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--mm-gold);
}

html[data-active-product="math"] .concept-domain-icon {
  color: var(--mm-muted);
}

html[data-active-product="math"] .concept-domain-rail-btn:hover {
  background: var(--mm-gold-hover);
  border-color: color-mix(in oklab, var(--mm-gold) 35%, transparent);
}

html[data-active-product="math"] .concept-domain-rail-btn:focus-visible {
  outline-color: var(--mm-gold);
}

html[data-active-product="math"] .concept-domain-rail-btn[aria-pressed="true"] {
  border-color: color-mix(in oklab, var(--mm-gold) 55%, transparent);
  box-shadow: inset 3px 0 0 var(--mm-gold);
  background: var(--mm-gold-hover);
  color: var(--mm-foreground);
}

html[data-active-product="math"] .concept-domain-rail-btn[aria-pressed="true"] .concept-domain-icon {
  color: var(--mm-gold);
}

html[data-active-product="math"] .concept-leaf-section-header {
  background: var(--mm-gold-hover);
  border-color: color-mix(in oklab, var(--mm-gold) 28%, transparent);
}

html[data-active-product="math"] .concept-selection-chip {
  background: var(--mm-gold-hover);
  border-color: color-mix(in oklab, var(--mm-gold) 40%, transparent);
  color: var(--mm-foreground);
}

html[data-active-product="math"] .concept-leaf-checkbox {
  accent-color: var(--mm-gold);
}

html[data-active-product="math"] .concept-hub-tree-card:hover,
html[data-active-product="math"] .concept-hub-focus-card:hover,
html[data-active-product="math"] .concept-hub-card:hover {
  border-color: color-mix(in oklab, var(--mm-gold) 45%, var(--mm-border));
  box-shadow: var(--mm-shadow-gold);
}

html[data-active-product="math"] .library-concept-scope .concept-hub-card--hub-pill .concept-hub-card-footer,
html[data-active-product="math"] .library-concept-scope .concept-hub-ai-coach,
html[data-active-product="math"] .library-concept-scope #hub-card-revision .concept-hub-card-footer--math,
html[data-active-product="math"] .library-concept-scope #hub-card-structured .concept-hub-card-footer--math,
html[data-active-product="math"] .library-concept-scope #hub-card-adaptive .concept-hub-card-footer--math,
html[data-active-product="math"] .library-concept-scope .concept-hub-card.is-hub-active .concept-hub-card-footer {
  background: var(--mm-surface-raised);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  color: var(--mm-gold);
  box-shadow: none;
  filter: none;
}

html[data-active-product="math"] .library-concept-scope .concept-hub-card--hub-pill:hover:not(.concept-hub-card--placeholder):not([aria-disabled="true"]) .concept-hub-card-footer,
html[data-active-product="math"] .library-concept-scope .concept-hub-ai-coach:hover {
  background: var(--mm-gold-hover);
  color: var(--mm-gold);
  box-shadow: var(--mm-shadow-gold);
  filter: none;
}

html[data-active-product="math"] .library-concept-scope #hub-card-cognitive-profile.concept-hub-card {
  background: var(--mm-surface-raised);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 40%, var(--mm-border));
  box-shadow: none;
  padding: 10px 12px 12px;
  gap: 4px;
}

html[data-active-product="math"] .library-concept-scope #hub-card-cognitive-profile.concept-hub-card:hover {
  border-color: color-mix(in oklab, var(--mm-gold) 62%, var(--mm-border));
  background: var(--mm-surface-raised);
  box-shadow: var(--mm-shadow-gold);
}

html[data-active-product="math"] .library-concept-scope #hub-card-cognitive-profile .concept-hub-card-label {
  background: transparent;
  border: none;
  box-shadow: none;
  filter: none;
  min-height: 0;
  padding: 4px 4px 0;
  color: var(--mm-foreground);
  font-family: var(--mm-font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

html[data-active-product="math"] .library-concept-scope #hub-card-cognitive-profile .concept-hub-card-icon--hub-radar {
  aspect-ratio: auto;
  height: 132px;
  max-height: none;
  min-height: 132px;
}

html[data-active-product="math"] .library-concept-scope #hub-card-cognitive-profile .hub-radar-svg {
  width: 92%;
  height: 92%;
  max-width: none;
  max-height: none;
}

html[data-active-product="math"] .hub-radar-axis {
  color: var(--mm-muted);
  font-size: 0.68rem;
}

html[data-active-product="math"] .hub-radar-score {
  border-color: color-mix(in oklab, var(--mm-gold) 55%, transparent);
  background: var(--mm-surface);
  color: var(--mm-gold);
  box-shadow: none;
  width: 26px;
  height: 26px;
  font-size: 0.72rem;
}

html[data-active-product="math"] .hub-radar-svg line,
html[data-active-product="math"] .hub-radar-svg polygon[fill="none"] {
  stroke: color-mix(in oklab, var(--mm-gold) 32%, var(--mm-border));
}

html[data-active-product="math"] .hub-radar-svg polygon:not([fill="none"]) {
  fill: color-mix(in oklab, var(--mm-gold) 28%, transparent);
  stroke: var(--mm-gold);
}

html[data-active-product="math"] .material-mode-toggle .material-mode-btn,
html[data-active-product="math"] .material-mode-toggle .material-mode-btn.active {
  background: var(--mm-surface-raised);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  color: var(--mm-gold);
  box-shadow: none;
  filter: none;
}

html[data-active-product="math"] .material-mode-toggle .material-mode-btn.active {
  background: var(--mm-gold-hover);
}

html[data-active-product="math"] .action-help-btn,
html[data-active-product="math"] #minimized-modals-tray .minimized-modal-tab,
html[data-active-product="math"] .notebook-toolbar .btn.btn-ai-primary,
html[data-active-product="math"] .notebook-toolbar-tools-group #notebook-select.notebook-tool-primary,
html[data-active-product="math"] #notebook-lines-btn.active {
  background: var(--mm-surface-raised);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  color: var(--mm-gold);
  box-shadow: none;
  filter: none;
}

html[data-active-product="math"] .notebook-toolbar .btn.btn-ai-primary:hover:not(:disabled),
html[data-active-product="math"] .notebook-toolbar-tools-group #notebook-select.notebook-tool-primary:hover,
html[data-active-product="math"] .notebook-toolbar-tools-group #notebook-select.notebook-tool-primary.active,
html[data-active-product="math"] .action-help-btn:hover,
html[data-active-product="math"] .action-help-btn:focus-visible {
  background: var(--mm-gold-hover);
  color: var(--mm-gold);
  box-shadow: var(--mm-shadow-gold);
  filter: none;
}

html[data-active-product="math"] .revision-list-badge--open {
  background: var(--mm-gold-hover);
  color: var(--mm-gold);
}

html[data-active-product="math"] .concept-node-inner.is-selected {
  background: var(--mm-gold-hover);
  box-shadow: inset 3px 0 0 var(--mm-gold);
}

html[data-active-product="math"] .concept-leaf-dot {
  background: var(--mm-gold);
}

html[data-active-product="math"] .library-picker-mode-banner,
html[data-active-product="math"] .lib-guide-step.active {
  background: var(--mm-gold-hover);
  border-color: color-mix(in oklab, var(--mm-gold) 40%, transparent);
}

html[data-active-product="math"] .notebook-text-object.selected,
html[data-active-product="math"] .notebook-image-object.selected {
  outline-color: var(--mm-gold);
}

html[data-active-product="math"] .notebook-selection-rect {
  border-color: var(--mm-gold);
  background: color-mix(in oklab, var(--mm-gold) 12%, transparent);
}

html[data-active-product="math"] #notebook-math-edit:focus {
  outline-color: var(--mm-gold);
  border-color: var(--mm-gold);
}

/* ---------- Start page: Math card ---------- */

.launcher-card--math {
  border-top: 3px solid var(--mm-gold);
}

.launcher-card--math:hover {
  border-color: color-mix(in oklab, var(--mm-gold) 40%, var(--card-border));
  border-top-color: var(--mm-gold);
}

.launcher-card--math .launcher-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--mm-border);
  background: color-mix(in oklab, var(--mm-surface-raised) 80%, transparent);
  color: var(--mm-gold);
}

.launcher-card--math .launcher-card__icon svg {
  width: 20px;
  height: 20px;
}

.launcher-card--math .launcher-card__title {
  font-family: var(--mm-font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

.launcher-card--math .launcher-card__enter {
  background: var(--mm-surface-raised);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  color: var(--mm-gold);
  box-shadow: none;
}

.launcher-card--math .launcher-card__enter:hover:not(:disabled) {
  background: var(--mm-gold-hover);
  box-shadow: var(--mm-shadow-gold);
}

/* ---------- Start page: same quiet gold on the Research card and the header ---------- */

html[data-active-product="platform"] .btn-theme-switch-wrap {
  display: none !important;
}

html[data-active-product="platform"] .main-header-row .theme-btn {
  background: var(--mm-surface);
  color: var(--mm-foreground);
  border-color: var(--mm-border);
}

html[data-active-product="platform"] .main-header-row .theme-btn.active {
  background: var(--mm-surface-raised);
  color: var(--mm-gold);
  border-color: color-mix(in oklab, var(--mm-gold) 55%, transparent);
}

html[data-active-product="platform"] .lang-btn.lang-switch-trigger {
  background: var(--mm-surface-raised);
  color: var(--mm-foreground);
  border-color: var(--mm-border);
  box-shadow: none;
}

html[data-active-product="platform"] .lang-menu-item.active,
html[data-active-product="platform"] .lang-btn.active {
  background: var(--mm-gold-hover);
  color: var(--mm-gold);
  border-color: color-mix(in oklab, var(--mm-gold) 45%, transparent);
}

.launcher-card--research {
  border-top: 3px solid var(--mm-gold);
}

.launcher-card--research:hover {
  border-color: color-mix(in oklab, var(--mm-gold) 40%, var(--card-border));
  border-top-color: var(--mm-gold);
}

.launcher-card--research .launcher-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--mm-border);
  background: color-mix(in oklab, var(--mm-surface-raised) 80%, transparent);
  color: var(--mm-gold);
  font-size: 0;
}

.launcher-card--research .launcher-card__icon svg {
  width: 20px;
  height: 20px;
}

.launcher-card--research .launcher-card__title {
  font-family: var(--mm-font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

.launcher-card--research .launcher-card__enter {
  background: var(--mm-surface-raised);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  color: var(--mm-gold);
  box-shadow: none;
}

.launcher-card--research .launcher-card__enter:hover:not(:disabled) {
  background: var(--mm-gold-hover);
  box-shadow: var(--mm-shadow-gold);
}

.launcher-card--economics {
  border-top: 3px solid var(--mm-gold);
}

.launcher-card--economics:hover {
  border-color: color-mix(in oklab, var(--mm-gold) 40%, var(--card-border));
  border-top-color: var(--mm-gold);
}

.launcher-card--economics .launcher-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--mm-border);
  background: color-mix(in oklab, var(--mm-surface-raised) 80%, transparent);
  color: var(--mm-gold);
  font-size: 0;
}

.launcher-card--economics .launcher-card__icon svg {
  width: 20px;
  height: 20px;
}

.launcher-card--economics .launcher-card__title {
  font-family: var(--mm-font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

.launcher-card--economics .launcher-card__enter {
  background: var(--mm-surface-raised);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  color: var(--mm-gold);
  box-shadow: none;
}

.launcher-card--economics .launcher-card__enter:hover:not(:disabled) {
  background: var(--mm-gold-hover);
  box-shadow: var(--mm-shadow-gold);
}

.launcher-card--classroom {
  border-top: 3px solid var(--mm-gold);
}

.launcher-card--classroom:hover {
  border-color: color-mix(in oklab, var(--mm-gold) 40%, var(--card-border));
  border-top-color: var(--mm-gold);
}

.launcher-card--classroom .launcher-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--mm-border);
  background: color-mix(in oklab, var(--mm-surface-raised) 80%, transparent);
  color: var(--mm-gold);
  font-size: 0;
}

.launcher-card--classroom .launcher-card__icon svg {
  width: 20px;
  height: 20px;
}

.launcher-card--classroom .launcher-card__title {
  font-family: var(--mm-font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

.launcher-card--classroom .launcher-card__enter {
  background: var(--mm-surface-raised);
  border: 1px solid color-mix(in oklab, var(--mm-gold) 55%, transparent);
  color: var(--mm-gold);
  box-shadow: none;
}

.launcher-card--classroom .launcher-card__enter:hover:not(:disabled) {
  background: var(--mm-gold-hover);
  box-shadow: var(--mm-shadow-gold);
}

}
