/* Obsidian spectral palette shared by the mathematics tools. */
body.tool-math {
    --math-violet:#a78bfa;
    --math-violet-bright:#c4b5fd;
    --math-cyan:#69f5e7;
    --math-gold:#f8d477;
    --math-rose:#f187c8;
    --tool-primary:#a78bfa;
    --tool-primary-hover:#c4b5fd;
    --tool-primary-soft:rgba(167,139,250,.12);
    --tool-surface:#0e0e19;
    --tool-surface-raised:#161525;
    --tool-border:rgba(167,139,250,.2);
    --tool-text:#f2effc;
    --tool-text-muted:#aaa3bd;
    --tool-shadow-sm:0 18px 55px rgba(0,0,0,.28);
    color-scheme:dark;
    color:var(--tool-text);
    background:radial-gradient(circle at 12% 8%,rgba(92,56,171,.13),transparent 30rem),radial-gradient(circle at 88% 24%,rgba(37,150,156,.07),transparent 28rem),linear-gradient(180deg,#09090f,#0b0912 60%,#07070c) !important;
}
body.tool-math.tool-reference { --tool-primary:#38c6c2; }

body.tool-math::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.2;background-image:linear-gradient(rgba(167,139,250,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(167,139,250,.045) 1px,transparent 1px);background-size:48px 48px;mask-image:linear-gradient(black,transparent 78%)}
body.tool-math>section:first-of-type>main,body.tool-math>.math-app-shell,body.tool-math .decomposition-tool,body.tool-math .matrix-tool,body.tool-math .eigen-tool{background:transparent !important}
body.tool-math .tool-hero h1,body.tool-math .math-app-header h1{color:transparent !important;background:linear-gradient(105deg,#fff 12%,#d9d1f4 58%,#81eee4);background-clip:text;text-shadow:0 12px 42px rgba(167,139,250,.12)}
body.tool-math .eyebrow,body.tool-math .math-eyebrow{color:var(--math-cyan)}

body.tool-math .panel,body.tool-math .math-control-card,body.tool-math .math-visual-card,body.tool-math .controls-panel,body.tool-math .truth-table-container,body.tool-math .help-strip,body.tool-math .help-box,body.tool-math .concept-grid article,body.tool-math .operations-panel,body.tool-math .result-panel,body.tool-math .matrix-card,body.tool-math .explanation-section,body.tool-math .explanation-card{
    color:var(--tool-text);background:linear-gradient(145deg,rgba(21,20,37,.97),rgba(10,10,18,.97)) !important;border-color:var(--tool-border) !important;box-shadow:0 22px 65px rgba(0,0,0,.28),inset 0 1px rgba(255,255,255,.025) !important
}
body.tool-math .panel,body.tool-math .math-control-card,body.tool-math .math-visual-card,body.tool-math .truth-table-container{border-radius:14px 4px 14px 4px !important}
body.tool-math h2,body.tool-math h3,body.tool-math .panel-header h2,body.tool-math .math-card-heading h2{color:#e5dff5 !important}
body.tool-math p,body.tool-math small,body.tool-math .panel-header p,body.tool-math .math-card-heading p{color:var(--tool-text-muted)}

body.tool-math input:not([type=checkbox]):not([type=range]),body.tool-math select,body.tool-math textarea{color:#eeeafd !important;background:rgba(5,5,11,.78) !important;border-color:rgba(167,139,250,.24) !important;border-radius:9px 3px 9px 3px !important;box-shadow:inset 0 4px 16px rgba(0,0,0,.28)}
body.tool-math input:focus,body.tool-math select:focus,body.tool-math textarea:focus{outline:none !important;border-color:var(--math-violet) !important;box-shadow:inset 0 4px 16px rgba(0,0,0,.28),0 0 0 3px rgba(167,139,250,.11) !important}
body.tool-math input[type=range]{background:linear-gradient(90deg,var(--math-violet),rgba(167,139,250,.18))}

body.tool-math .secondary-button,body.tool-math .ghost-button,body.tool-math .mode-tab:not(.active),body.tool-math .preset-button{color:var(--button-text)!important;background:var(--button-bg)!important;border-color:var(--button-border)!important;box-shadow:none!important}

body.tool-math table{border-color:rgba(167,139,250,.17) !important;background:#0b0b14}
body.tool-math th{color:var(--math-cyan) !important;background:rgba(105,245,231,.065) !important;border-color:rgba(105,245,231,.14) !important}
body.tool-math td{color:#d9d3e8 !important;background:rgba(14,14,25,.8) !important;border-color:rgba(167,139,250,.12) !important}
body.tool-math tr:hover td{background:rgba(167,139,250,.08) !important}
body.tool-math code,body.tool-math .formula-box,body.tool-math .latex-preview{color:#ded8f0;background:rgba(5,5,10,.72) !important;border-color:rgba(167,139,250,.22) !important}
body.tool-math .is-success,body.tool-math .success{color:#67e8bd !important}body.tool-math .is-error,body.tool-math .error{color:#f49ab9 !important}
body.tool-math canvas{background:radial-gradient(circle,rgba(73,54,127,.13),transparent 62%),#08080f !important;border:1px solid rgba(167,139,250,.2);box-shadow:inset 0 0 60px rgba(0,0,0,.5),0 15px 45px rgba(0,0,0,.22)}

@media(max-width:680px){body.tool-math{background:linear-gradient(180deg,#09090f,#0b0912) !important}body.tool-math .panel,body.tool-math .math-control-card,body.tool-math .math-visual-card{border-radius:11px 3px 11px 3px !important}}
@media(prefers-reduced-motion:reduce){body.tool-math *,body.tool-math *::before{transition:none!important}}

/* Restore a true light theme; dark spectral tokens must not reach the global nav. */
body.tool-math:not(.dark-mode){--tool-primary:#6855bd;--tool-primary-hover:#5744a8;--tool-primary-soft:rgba(104,85,189,.1);--tool-surface:#fff;--tool-surface-raised:#f7f6fb;--tool-border:#dcd8eb;--tool-text:#242337;--tool-text-muted:#656b7f;color-scheme:light;color:#242337;background:radial-gradient(circle at 12% 8%,rgba(104,85,189,.08),transparent 28rem),#f5f4f8!important}
body.tool-math:not(.dark-mode) .tool-hero h1,body.tool-math:not(.dark-mode) .math-app-header h1{background:linear-gradient(105deg,#242034,#604cae 58%,#188f91);background-clip:text;text-shadow:none}
body.tool-math:not(.dark-mode) .panel,body.tool-math:not(.dark-mode) .math-control-card,body.tool-math:not(.dark-mode) .math-visual-card,body.tool-math:not(.dark-mode) .controls-panel,body.tool-math:not(.dark-mode) .truth-table-container,body.tool-math:not(.dark-mode) .help-strip,body.tool-math:not(.dark-mode) .help-box,body.tool-math:not(.dark-mode) .concept-grid article,body.tool-math:not(.dark-mode) .operations-panel,body.tool-math:not(.dark-mode) .result-panel,body.tool-math:not(.dark-mode) .matrix-card,body.tool-math:not(.dark-mode) .explanation-section,body.tool-math:not(.dark-mode) .explanation-card{color:#242337;background:linear-gradient(145deg,#fff,#f9f8fc)!important;border-color:#dcd8eb!important;box-shadow:0 18px 50px rgba(45,38,76,.08)!important}
body.tool-math:not(.dark-mode) h2,body.tool-math:not(.dark-mode) h3,body.tool-math:not(.dark-mode) .panel-header h2,body.tool-math:not(.dark-mode) .math-card-heading h2{color:#302d42!important}
body.tool-math:not(.dark-mode) p,body.tool-math:not(.dark-mode) small{color:#656b7f}
body.tool-math:not(.dark-mode) input:not([type=checkbox]):not([type=range]),body.tool-math:not(.dark-mode) select,body.tool-math:not(.dark-mode) textarea{color:#29263a!important;background:#fff!important;border-color:#d4d0e2!important;box-shadow:inset 0 2px 8px rgba(45,38,76,.04)}
body.tool-math:not(.dark-mode) .secondary-button,body.tool-math:not(.dark-mode) .ghost-button,body.tool-math:not(.dark-mode) .mode-tab:not(.active),body.tool-math:not(.dark-mode) .preset-button{color:#554d76!important;background:#f5f2fc!important;border-color:#d2cbea!important}
body.tool-math:not(.dark-mode) table{background:#fff}body.tool-math:not(.dark-mode) th{color:#216f75!important;background:#eaf8f7!important;border-color:#cbe7e5!important}body.tool-math:not(.dark-mode) td{color:#343044!important;background:#fff!important;border-color:#e1deea!important}
body.tool-math:not(.dark-mode) code,body.tool-math:not(.dark-mode) .formula-box,body.tool-math:not(.dark-mode) .latex-preview{color:#38334e;background:#faf9fd!important;border-color:#d8d3e7!important}
