:root{--bg:#10131d;--sidebar:#141824;--panel:#191e2c;--panel2:#1d2333;--line:#2a3143;--text:#f1f3f9;--muted:#929bb0;--soft:#bac2d3;--accent:#a78bfa;--accent2:#7c5cf3;--mint:#75e0c0;--shadow:0 18px 60px rgba(0,0,0,.18)}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:'DM Sans',sans-serif;font-size:14px}button,input,textarea{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh;display:flex}.sidebar{width:244px;background:var(--sidebar);border-right:1px solid var(--line);padding:28px 18px 22px;display:flex;flex-direction:column;flex-shrink:0}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--text);font:700 22px 'Space Grotesk',sans-serif;letter-spacing:-1px;padding:0 9px 45px}.brand-mark{display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:linear-gradient(135deg,#b69cff,#7959e9);color:#171326;font-size:23px}.brand-accent{color:var(--accent)}.workspace-label,.eyebrow,.screen-label,.graph-input-wrap label,.range-control label,.tool-panel label,.tutor-card label{font-size:10px;font-weight:700;letter-spacing:1.4px;color:#7f89a0}.workspace-label{padding:0 11px 13px}.nav-list{display:grid;gap:5px}.nav-item{border:0;background:transparent;color:#aab2c4;text-align:left;padding:12px 13px;border-radius:10px;display:flex;gap:13px;align-items:center;font-weight:600;transition:.2s}.nav-item span{font:600 18px 'Space Grotesk';width:18px;text-align:center;color:#8f99b0}.nav-item:hover{background:#202638;color:white}.nav-item.active{background:#29243e;color:#d8ccff}.nav-item.active span{color:var(--accent)}.sidebar-bottom{margin-top:auto;padding:20px 10px 0}.free-pill{display:inline-flex;align-items:center;gap:8px;border:1px solid #30463f;border-radius:30px;padding:7px 11px;color:#9be5ce;font-size:11px;font-weight:700}.pulse,.status-dot{width:7px;height:7px;border-radius:50%;background:var(--mint);box-shadow:0 0 12px #75e0c077}.sidebar-note{font-size:11px;line-height:1.7;color:#68738a;margin-top:15px}.main-content{max-width:1440px;width:calc(100% - 244px);padding:0 48px;min-width:0}.topbar{height:70px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:12px}.breadcrumb{display:flex;gap:10px;align-items:center}.crumb-slash{color:#4f596d}.breadcrumb strong{color:#dfe3ed;font-weight:600}.topbar-right{display:flex;gap:9px;align-items:center}.status-dot{width:6px;height:6px}.theme-toggle{margin-left:12px;background:var(--panel);border:1px solid var(--line);color:var(--soft);width:33px;height:33px;border-radius:9px;font-size:17px}.welcome-row{padding:38px 0 31px;display:flex;align-items:flex-end;justify-content:space-between}.eyebrow{color:var(--accent);margin-bottom:12px}.welcome-row h1{font:600 clamp(30px,4vw,43px) 'Space Grotesk',sans-serif;letter-spacing:-1.8px;margin:0}.welcome-row h1 span{color:var(--accent)}.welcome-copy{margin:10px 0 0;color:var(--muted);font-size:14px}.date-chip{border:1px solid var(--line);border-radius:30px;padding:9px 13px;color:#aeb6c8;font-size:11px;display:flex;gap:8px;align-items:center}.date-icon{color:var(--mint)}.section-heading{display:flex;justify-content:space-between;align-items:center;margin:5px 0 17px}.section-heading h2{font:600 21px 'Space Grotesk',sans-serif;letter-spacing:-.5px;margin:0 0 5px}.section-heading p{margin:0;color:var(--muted);font-size:12px}.tag{border:1px solid #3a3156;color:#bba9ff;background:#27213a;padding:6px 9px;border-radius:6px;font-size:9px;font-weight:700;letter-spacing:1px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow)}.calculator-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(260px,.85fr);gap:17px}.calculator-card{padding:20px}.calc-screen{background:#111622;border:1px solid #252d40;border-radius:12px;min-height:145px;padding:18px 19px;margin-bottom:15px}.screen-label{font-size:9px}.calc-screen input{background:transparent;border:0;outline:0;color:#aeb8cb;width:100%;font:500 18px 'Space Grotesk';margin-top:15px}.screen-result{font:600 34px 'Space Grotesk';letter-spacing:-1px;text-align:right;margin-top:3px;color:#fff}.screen-hint{text-align:right;color:#77839b;font-size:10px}.keypad{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.key{border:1px solid #30384c;background:#22293a;color:#e8ebf4;border-radius:9px;height:49px;font:600 16px 'Space Grotesk';transition:.15s}.key:hover,.function-row button:hover{border-color:#9275ed;background:#302b47}.key.utility{color:#c5b6ff;background:#28243b}.key.operator{color:#c6b4ff;background:#29243d;font-size:19px}.key.equals{background:linear-gradient(135deg,#a78bfa,#8060ed);color:#171326;border:0;font-size:20px}.function-row{display:flex;gap:7px;margin-top:11px;flex-wrap:wrap}.function-row button{background:#202638;border:1px solid #30384c;color:#b8c0d1;border-radius:7px;padding:8px 11px;font-size:11px}.right-stack{display:grid;grid-template-rows:auto 1fr;gap:15px}.tip-card{padding:19px;display:flex;gap:13px;align-items:flex-start}.card-icon{width:33px;height:33px;flex-shrink:0;border-radius:10px;display:grid;place-items:center}.purple{background:#302747;color:#c4adff}.tip-card h3,.history-card h3,.tool-panel h3,.tutor-intro h3,.tutor-output h3{font:600 14px 'Space Grotesk';margin:1px 0 7px}.tip-card p{font-size:11px;line-height:1.7;color:var(--muted);margin:0}.tip-card code{color:#c4adff;background:#29243b;padding:2px 4px;border-radius:4px}.history-card{padding:18px}.card-title-row{display:flex;justify-content:space-between;align-items:center}.text-button{background:transparent;border:0;color:var(--accent);font-size:11px}.history-list{display:grid;gap:8px;margin-top:12px}.history-item{display:flex;justify-content:space-between;gap:12px;padding:10px;background:#202638;border-radius:8px;color:#aab4c8;font-size:11px}.history-item strong{color:#e7e9f1;font-weight:600}.empty-state{color:#78849a;font-size:12px;line-height:1.7;padding:17px;background:#151b29;border:1px dashed #30394d;border-radius:10px}.tab-panel{display:none;padding-bottom:35px}.tab-panel.active{display:block}.tool-panel{padding:23px}.tool-panel>label,.graph-input-wrap label,.range-control label,.tutor-card label{display:block;margin-bottom:10px}.tool-panel input,.tool-panel textarea,.tutor-card textarea,.graph-input-wrap input{width:100%;background:#111622;border:1px solid #30394d;border-radius:9px;padding:12px 13px;color:var(--text);outline:none;resize:vertical}.tool-panel input:focus,.tool-panel textarea:focus,.tutor-card textarea:focus,.graph-input-wrap input:focus,.calc-screen input:focus{border-color:#8e70ed}.input-action{display:flex;gap:10px}.input-action input{flex:1;min-width:0}.primary-btn{border:0;border-radius:9px;background:linear-gradient(135deg,#ad95ff,#8060eb);color:#171326;font-weight:700;padding:12px 16px;white-space:nowrap;box-shadow:0 6px 20px #8060eb22}.primary-btn:hover{filter:brightness(1.08)}.primary-btn span{margin-left:8px}.example-row,.tutor-examples{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0 18px;color:#7f8aa0;font-size:11px}.example{background:#252b3c;border:1px solid #343c50;color:#b8c1d4;border-radius:6px;padding:6px 9px;font-size:10px}.result-area{margin-top:18px}.result-title{font:600 13px 'Space Grotesk';color:#dfe3ef;margin-bottom:10px}.solution-value{font:600 23px 'Space Grotesk';color:#a994ff;margin:5px 0 13px}.step-list{display:grid;gap:9px;counter-reset:steps}.step{display:flex;gap:10px;align-items:flex-start;color:#b2bbcc;font-size:12px;line-height:1.6}.step-num{width:21px;height:21px;flex-shrink:0;border-radius:7px;background:#302747;color:#c3adff;display:grid;place-items:center;font-size:10px;font-weight:700}.graph-panel{padding:20px}.graph-controls{display:flex;justify-content:space-between;gap:20px;align-items:end;margin-bottom:17px}.graph-input-wrap{flex:1;min-width:0}.graph-input-wrap .input-action{max-width:650px}.range-control{width:190px}.range-control label{display:flex;justify-content:space-between}.range-control strong{color:#c2b3ff;letter-spacing:0;font-size:10px}input[type=range]{width:100%;accent-color:#a78bfa}#graphCanvas{width:100%;height:auto;display:block;background:#111622;border:1px solid #293146;border-radius:10px}.graph-footer{display:flex;justify-content:space-between;color:#79849a;font-size:10px;padding:12px 3px 0}.graph-footer>span:first-child{display:flex;align-items:center;gap:8px;color:#c0c8d8}.legend-dot{width:8px;height:8px;border-radius:50%;background:#a78bfa}.two-tools{display:grid;grid-template-columns:1fr 1fr;gap:16px}.mini-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#302747;color:#c4b0ff;font:600 17px 'Space Grotesk';margin-bottom:15px}.tool-panel>p{color:var(--muted);font-size:11px;line-height:1.6;margin:0 0 20px}.tool-panel input{margin-bottom:12px}.full-btn{width:100%;margin-top:3px}.bounds-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.bounds-row label{margin-bottom:8px}.bounds-row input{margin-bottom:10px}.label-muted{font-weight:400;letter-spacing:0;text-transform:none;color:#77839a;margin-left:7px}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:18px}.stat-card{padding:15px;background:#202638;border:1px solid #30394d;border-radius:10px}.stat-card span{display:block;color:#8792a8;font-size:10px;margin-bottom:8px}.stat-card strong{font:600 21px 'Space Grotesk';color:#e9eaf2}.matrix-layout{display:grid;grid-template-columns:1fr 32px 1fr;gap:13px;align-items:center}.matrix-layout .tool-panel{padding:17px}.matrix-symbol{text-align:center;color:#b7a3ff;font:600 25px 'Space Grotesk'}.matrix-actions{display:flex;gap:10px;margin-top:14px}.secondary-btn{background:#262c3d;border:1px solid #384057;color:#d4d9e5;border-radius:9px;padding:12px 16px;font-weight:600}.tutor-layout{display:grid;grid-template-columns:1.1fr .9fr;gap:16px}.tutor-card{padding:23px}.tutor-avatar{width:42px;height:42px;border-radius:13px;background:linear-gradient(135deg,#b69cff,#7859e9);color:#1a1630;display:grid;place-items:center;font-size:22px;margin-bottom:17px}.tutor-intro p{color:var(--muted);font-size:12px;line-height:1.7;margin:0 0 22px}.tutor-card textarea{margin-bottom:5px}.tutor-examples{margin:9px 0 17px}.tutor-output{padding:25px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:320px}.empty-illustration{font-size:32px;color:#b69cff;background:#302747;border-radius:17px;width:60px;height:60px;display:grid;place-items:center;margin-bottom:17px}.tutor-output p{font-size:12px;color:var(--muted)}.tutor-output .step-list{text-align:left;width:100%;margin-top:12px}.tutor-output .result-title{align-self:flex-start}.footer{border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:10px;padding:19px 0 24px;color:#69758c;font-size:10px}.footer b{color:var(--accent)}.toast{position:fixed;bottom:25px;left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#e9e5ff;color:#21183b;padding:10px 16px;border-radius:9px;font-size:12px;font-weight:700;transition:.25s;box-shadow:var(--shadow);z-index:5}.toast.show{opacity:1;transform:translate(-50%,0)}
body.light{--bg:#f5f6fb;--sidebar:#fff;--panel:#fff;--panel2:#f2f3f8;--line:#e4e6ef;--text:#1e2331;--muted:#687188;--soft:#505a70;--shadow:0 12px 40px rgba(30,40,70,.06)}body.light .nav-item{color:#626d82}body.light .nav-item.active{background:#f0ebff;color:#6547c9}body.light .topbar{color:#687188}body.light .breadcrumb strong{color:#242a39}body.light .calc-screen,body.light .tool-panel input,body.light .tool-panel textarea,body.light .tutor-card textarea,body.light .graph-input-wrap input,body.light #graphCanvas{background:#f7f8fc;color:#202638}body.light .calc-screen input{color:#505b72}body.light .key{background:#f0f1f7;color:#30384c;border-color:#e0e3ed}body.light .key.utility,body.light .key.operator{background:#f0ebff;color:#6c50c8}body.light .empty-state{background:#f7f8fc}body.light .history-item,body.light .stat-card{background:#f3f4f9;color:#59647a}body.light .history-item strong{color:#252b3b}body.light .tip-card code,body.light .example{background:#f0ebff;color:#6951bd;border-color:#e3dcff}body.light .date-chip{color:#59647a}
@media(max-width:1000px){.main-content{padding:0 27px}.sidebar{width:215px}.main-content{width:calc(100% - 215px)}.calculator-layout{grid-template-columns:1fr}.right-stack{grid-template-columns:1fr 1fr;grid-template-rows:auto}.welcome-row{padding-top:30px}}
@media(max-width:700px){.app-shell{display:block}.sidebar{width:100%;height:auto;padding:14px 14px 10px;border-right:0;border-bottom:1px solid var(--line)}.brand{padding:0 5px 13px}.workspace-label,.sidebar-bottom{display:none}.nav-list{display:flex;overflow-x:auto;padding-bottom:3px}.nav-item{white-space:nowrap;padding:9px 11px;font-size:11px}.nav-item span{font-size:15px}.main-content{width:100%;padding:0 16px}.topbar{height:52px}.topbar-right{font-size:0}.topbar-right .status-dot{font-size:initial}.welcome-row{padding:27px 0 22px;align-items:flex-start}.welcome-row h1{font-size:30px}.date-chip{display:none}.section-heading h2{font-size:19px}.calculator-card{padding:13px}.key{height:46px}.right-stack,.two-tools,.tutor-layout{grid-template-columns:1fr}.right-stack{grid-template-rows:auto auto}.graph-controls{display:block}.range-control{width:100%;margin-top:15px}.input-action{flex-direction:column}.input-action .primary-btn{width:100%}.matrix-layout{grid-template-columns:1fr}.matrix-symbol{transform:rotate(90deg)}.stats-grid{grid-template-columns:repeat(2,1fr)}.footer{flex-wrap:wrap}.graph-panel{padding:12px}.matrix-actions{flex-wrap:wrap}.section-heading{gap:10px}.tag{font-size:8px}}

/* MathPro 2.0 additions */
.practice-controls{display:grid;grid-template-columns:1fr 1fr .7fr auto;gap:12px;align-items:end}.practice-controls label,.scanner-layout label,.account-panel label{display:block;margin-bottom:8px;font-size:10px;font-weight:700;letter-spacing:1.2px;color:#8994aa}.practice-controls select,.formula-grid input,.formula-grid select,.practice-controls select,.account-panel input{width:100%;background:#111622;border:1px solid #30394d;border-radius:9px;padding:12px;color:var(--text)}.practice-summary{margin:18px 0 12px;color:#9da8bd;font-size:12px}.practice-questions{display:grid;gap:12px}.practice-question{padding:16px;background:#151b29;border:1px solid #30394d;border-radius:11px}.question-top{display:flex;gap:12px;align-items:center;margin-bottom:12px}.question-top strong{font:600 11px 'Space Grotesk';color:#b9a7ff;white-space:nowrap}.question-top span{font-size:13px;color:#e5e8f1}.practice-question .input-action input{min-width:0;flex:1;background:#101622;border:1px solid #30394d;border-radius:8px;padding:10px;color:var(--text)}.practice-feedback{font-size:11px;margin-top:10px;line-height:1.5}.practice-feedback.correct{color:#80dfbd}.practice-feedback.incorrect{color:#ffb0a8}.formula-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}.formula-card{padding:17px;border:1px solid var(--line);border-radius:11px;background:var(--panel2)}.formula-meta{font-size:9px;letter-spacing:1.2px;color:#a995f6;text-transform:uppercase;font-weight:700}.formula-card h3{font:600 14px 'Space Grotesk';margin:8px 0}.formula-expression{font:600 17px 'Space Grotesk';color:#d4c8ff;margin:10px 0;overflow-wrap:anywhere}.formula-card p{font-size:11px;color:var(--muted);line-height:1.6;min-height:34px}.workspace-tools{display:grid;grid-template-columns:.9fr 1.1fr;gap:15px}.workspace-tools .tool-panel h3{margin:0 0 18px}.workspace-tools textarea{width:100%;background:#111622;border:1px solid #30394d;border-radius:9px;padding:12px;color:var(--text);resize:vertical}.saved-items{display:grid;gap:10px;margin-top:14px;max-height:500px;overflow:auto}.saved-item{display:flex;justify-content:space-between;gap:12px;padding:12px;background:var(--panel2);border:1px solid var(--line);border-radius:9px}.saved-item strong{font-size:12px}.saved-item p{color:var(--muted);font-size:11px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}.saved-item small,.privacy-note{font-size:10px;color:#7d899f;line-height:1.6}.privacy-note{margin:12px 2px}.scanner-layout{display:grid;grid-template-columns:1fr 1fr;gap:20px}.scanner-layout input[type=file]{width:100%;padding:10px;background:#111622;border:1px solid #30394d;border-radius:8px;color:var(--muted);margin-bottom:12px}.scanner-layout textarea{width:100%;background:#111622;border:1px solid #30394d;border-radius:9px;padding:12px;color:var(--text);margin-bottom:10px}.scan-status{font-size:11px;color:#a995f6;margin-top:12px;min-height:18px}.scanner-layout .input-action{flex-wrap:wrap}.account-panel{max-width:680px}.account-panel input{margin-bottom:15px}.account-notice{padding:15px;background:#242039;border:1px solid #41365e;border-radius:10px;margin-bottom:20px}.account-notice strong{color:#d3c5ff;font:600 13px 'Space Grotesk'}.account-notice p{font-size:11px;color:#aeb6c8;line-height:1.7;margin:8px 0 0}.account-panel button:disabled{opacity:.45;cursor:not-allowed}
body.light .practice-controls select,body.light .account-panel input,body.light .practice-question .input-action input,body.light .workspace-tools textarea,body.light .scanner-layout textarea,body.light .scanner-layout input[type=file]{background:#f7f8fc;color:#202638;border-color:#dfe3ed}body.light .practice-question{background:#f7f8fc}body.light .formula-card{background:#f6f6fb}body.light .formula-expression{color:#654cc0}body.light .account-notice{background:#f0ebff;border-color:#ded4ff}body.light .account-notice p{color:#5f6680}
@media(max-width:900px){.practice-controls{grid-template-columns:1fr 1fr}.workspace-tools,.scanner-layout{grid-template-columns:1fr}}
@media(max-width:700px){.formula-grid{grid-template-columns:1fr}.practice-controls{grid-template-columns:1fr}.question-top{align-items:flex-start;flex-direction:column}.saved-item{flex-direction:column}.workspace-tools .tool-panel{padding:16px}}
