/* Math Reference structure; appearance follows the current world tokens. */
.math-reference-tabs { display:flex; gap:4px; margin:8px 0; }
.math-reference-tabs button { flex:1; min-width:0; min-height:40px; padding:7px 4px; font-size:12px; }
.math-reference-tabs [aria-selected="true"] { color:var(--paper); background:var(--ink); }
.math-reference-card { border:1px solid var(--line); background:var(--paper); color:var(--ink); border-radius:10px; padding:12px; margin:10px 0; overflow-wrap:anywhere; }
.math-reference-card h3 { margin:4px 0 8px; font-size:var(--t-body,15px); }
.math-reference-card p,.math-reference-why p { font-size:13px; line-height:1.5; margin:6px 0; }
.math-reference-kicker { font-size:11px!important; color:var(--muted); }
.math-reference-equation { overflow-x:auto; padding:8px 0; max-width:100%; }
.math-reference-actions { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.math-reference-actions button { min-height:36px; padding:6px 9px; font-size:12px; }
.math-reference-related { display:grid; gap:6px; }
.math-reference-card a,.math-reference-why a { color:var(--ink); text-underline-offset:3px; }
.math-reference-why { grid-column:1/-1; padding:6px 10px; color:var(--ink); background:var(--paper); }
.math-reference-why summary,.math-reference-card summary { cursor:pointer; padding:7px 0; font-size:13px; }
.math-reference-why h4,.math-reference-card h4 { margin:10px 0 3px; font-size:12px; }
.reference-item-row:has(.math-reference-why) { flex-wrap:wrap; }
.reference-item-row > .math-reference-why { flex-basis:100%; }
.math-reference-tabs button:focus-visible,.math-reference-card :focus-visible,.math-reference-why :focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
@media (pointer:coarse) { .math-reference-tabs button,.math-reference-actions button { min-height:44px; } }

.transformation-review { box-sizing:border-box; width:min(42rem,94vw); max-height:85dvh; overflow:auto; padding:22px; color:var(--ink); background:var(--paper); }
.transformation-review li { margin:14px 0; padding-inline-start:5px; }
.transformation-review p { line-height:1.5; overflow-wrap:anywhere; }
.transformation-review button { min-height:44px; }
.transformation-review :focus-visible { outline:2px solid var(--accent-ui); outline-offset:3px; }
@media(max-width:600px){.transformation-review{width:100%;max-width:100%;max-height:90dvh;margin:auto 0 0;padding:16px;padding-bottom:max(16px,env(safe-area-inset-bottom));border-radius:16px 16px 0 0;}.transformation-review ol{padding-left:22px;}}
