#mathView[hidden]{display:none!important}
#mathView{height:calc(100dvh - 108px);display:grid;grid-template-columns:360px minmax(0,1fr);background:#090d14;color:#eaf1fb;overflow:hidden}
.math-inspector{display:flex;flex-direction:column;min-height:0;border-right:1px solid #27303e;background:#0d1119}
.math-form{overflow:auto;padding:26px 24px;scrollbar-width:thin}
.math-form h2{font:650 22px/1.3 system-ui;margin:6px 0 10px;letter-spacing:-.6px}
.math-form h3{font:600 13px/1.4 system-ui;margin:0 0 12px}
.math-form p{font-size:12px;line-height:1.6;color:#9db0c8;margin:0 0 14px}
.math-form .eyebrow{font-size:9px;color:#a0bddb;letter-spacing:1.7px}
.math-section{margin-top:26px}
#mathText{width:100%;min-height:240px;resize:vertical;border:1px solid #323f53;border-radius:20px;padding:18px;background:#1e2530;color:#f0f5ff;font:15px/1.8 ui-monospace,monospace;tab-size:2}
.math-meta{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#8fa8c5;margin:10px 0}
#mathFont,#mathPlacement{width:100%;min-height:53px;padding:13px 15px;border:1px solid #343e4d;border-radius:17px;background:#20252f;color:#e9f1fb;font-size:13px}
.math-form input[type=range]{width:100%;accent-color:#2998ff;margin:10px 0}
.math-form output{float:right;color:#a5d5ff}
.math-prompt{margin:18px 0 22px;padding:17px;border:1px solid #5285b0;border-radius:18px;background:linear-gradient(135deg,#193651,#142338);box-shadow:0 8px 24px #0002}
.math-prompt-heading{display:block}.math-prompt-title{display:flex;align-items:center;gap:9px}.math-step{display:grid;place-items:center;flex:0 0 25px;height:25px;border-radius:8px;background:#a5d5ff;color:#12304d;font-size:12px;font-weight:750}
.math-prompt-heading h3{margin:0;font-size:14px;color:#f0f7ff}
.math-form .math-prompt-heading p{margin:11px 0 13px;font-size:12px;color:#bdd3e9}
.math-prompt button{min-height:44px;width:100%;border-radius:13px;border:1px solid #8bc9ff;background:#a5d5ff;color:#102b45;font-size:13px;font-weight:700;cursor:pointer}.math-prompt button:hover{background:#c3e4ff}
.math-prompt details{margin-top:12px;font-size:11px;color:#a5bdd6}
.math-prompt summary{cursor:pointer;width:fit-content}
.math-prompt details p{font-size:11px;margin:10px 0 0}
#mathPromptStatus{display:block;font-size:11px;line-height:1.5;color:#a5d5ff}
#mathPromptStatus:not(:empty){margin-top:10px}
#mathPromptText{width:100%;height:240px;resize:vertical;font:12px/1.7 system-ui;margin-top:12px;background:#0e1725;color:#d4e3f5;border:1px solid #3c506b;border-radius:12px;padding:12px}
.math-actions{flex-shrink:0;margin-top:auto;padding:16px 22px;background:#0d1119;border-top:1px solid #293344}
#mathInsert{min-height:52px;border-radius:23px;background:#2083ec;border:1px solid #3189e6;color:#fff;font-size:13px}
#mathInsert:disabled{opacity:.45;cursor:not-allowed}
.math-actions p{font-size:10px;color:#92acc9;margin:8px 0 0;text-align:center}
.math-main{display:grid;grid-template-columns:minmax(0,1fr) 180px;min-height:0;min-width:0}
.math-canvas{min-width:0;overflow:auto;padding:30px;background:radial-gradient(ellipse at 50% 0,#142035,#06080e 80%);scrollbar-width:thin}
#mathPreviewPages{transform-origin:top left;width:100%;min-width:0}
.math-preview-page{display:block;width:100%;height:auto;margin:0 0 24px;background:#fff;box-shadow:0 12px 30px #0006;border-radius:3px}
.math-tools{overflow:auto;padding:22px 15px;border-left:1px solid #2a3443;background:#0e141e;display:flex;flex-direction:column;gap:20px;font-size:11px}
.math-tools h3{font-size:12px;margin:0 0 12px}
.math-tools input[type=range]{width:100%;accent-color:#2998ff;margin-top:15px}
.math-zoom-buttons{display:flex;align-items:center;justify-content:space-between;gap:5px}
.math-tools button{background:#19283b;border:1px solid #344a66;border-radius:10px;padding:8px 11px;color:#cce4ff;font-size:11px}
.math-tools p{font-size:10px;color:#94abc7;line-height:1.6;margin:0}
.math-tools output{color:#d3eaff}
#mathPlacement{font-size:11px;padding:10px 8px;min-height:44px;border-radius:12px}
#mathError{color:#ffc783;font-size:12px;line-height:1.6;margin:12px 0}
#mathMissing{padding:12px;margin-top:12px;border:1px solid #705b35;background:#372d1d;border-radius:14px;color:#ffe1a6}
@media(min-width:1600px){#mathView{grid-template-columns:390px minmax(0,1fr)}}
@media(max-width:1100px){#mathView{grid-template-columns:310px minmax(0,1fr)}.math-main{grid-template-columns:minmax(0,1fr) 150px}.math-form{padding:23px 18px}.math-canvas{padding:18px}}
@media(max-width:760px){#mathView{display:flex;height:auto;overflow:visible;flex-direction:column}.math-form{overflow:visible;padding:24px 18px}.math-inspector{border-right:0}.math-main{grid-template-columns:minmax(0,1fr) 115px;min-height:500px}.math-tools{padding:16px 10px}.math-canvas{padding:16px 10px;max-height:75dvh}.math-zoom-buttons{flex-wrap:wrap}.math-actions{padding:15px 18px}#mathText{min-height:210px}.nav-create{gap:20px}}

#mathMissing[hidden]{display:none!important}
#mathMissing p{font-size:11px;line-height:1.6;margin:10px 0 0;color:#edce9c}.math-tools .math-format-note{margin-top:12px;color:#d5b98a}
.math-form label{display:block;font-size:12px;font-weight:600;margin:18px 0 8px}
.math-preview-missing{min-height:340px;padding:58px 30px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:#f7faff;border:1px solid #d8e4f0;border-radius:4px;color:#162c48;box-shadow:0 12px 30px #0005}.math-preview-missing h3{font:650 21px/1.4 system-ui;margin:0 0 12px}.math-preview-missing p{max-width:410px;font:13px/1.7 system-ui;color:#53667e;margin:0}.math-required-symbols{font:500 31px/1.5 system-ui;letter-spacing:5px;margin:25px 0;overflow-wrap:anywhere}.math-preview-missing .button{font-size:12px;border-radius:16px;padding:13px 20px;background:#2083ec;color:#fff}

.math-spacing-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px}
.math-spacing-heading h3{margin:0}
#mathSpacingReset{padding:5px 0 5px 8px;border:0;background:none;color:#9ccafa;font-size:10px;cursor:pointer}
.math-tracking-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.math-tracking-card{min-width:0;padding:14px 12px 8px;border:1px solid #303e51;border-radius:16px;background:#192331}
.math-form .math-tracking-card label{margin:0 0 7px;font-size:12px}
.math-tracking-card output{display:block;float:none;font-size:12px;font-variant-numeric:tabular-nums}
.math-form .math-tracking-card input{margin:14px 0 3px}
.math-page-selects{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}
.math-page-selects>div{min-width:0}
.math-page-options #mathColumnGapControl{margin-top:14px}
.math-spacing output{font-variant-numeric:tabular-nums}

#mathSheetFormat,#mathPaper,#mathArrangement{width:100%;min-height:44px;border:1px solid #34465e;border-radius:14px;background:#19283b;color:#e9f1fb;padding:10px 12px;font-size:12px}
#mathColumnGapControl[hidden]{display:none!important}

#mathPromptReminder[hidden],#mathInsert[hidden]{display:none!important}
.math-prompt-reminder{padding:14px;margin:0 0 2px;border:1px solid #527da2;border-radius:16px;background:#14283e;outline:none}
.math-prompt-reminder h3{margin:0 0 8px;font:650 14px/1.4 system-ui;color:#eef6ff}
.math-actions .math-prompt-reminder p{font-size:11px;line-height:1.6;text-align:left;margin:0 0 12px;color:#b7cfe6}
.math-reminder-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.math-reminder-actions button{min-height:44px;border-radius:11px;padding:8px;font:650 11px/1.4 system-ui;cursor:pointer}
#mathReminderCopy{border:1px solid #668dae;background:#23405d;color:#e3f2ff}
#mathConfirmInsert{border:1px solid #3899ff;background:#2083ec;color:white}
#mathReminderCancel{display:block;width:100%;border:0;background:none;color:#a9c6e2;font-size:11px;padding:11px 0 0;cursor:pointer}
#mathReminderStatus{display:block;font-size:11px;line-height:1.5;color:#bde1ff}
#mathReminderStatus:not(:empty){margin-top:10px}
.math-prompt button:focus-visible,.math-reminder-actions button:focus-visible,#mathReminderCancel:focus-visible{outline:3px solid #e2f1ff;outline-offset:3px}

#mathLayoutNotice{color:#a4c6e9;font-size:11px;line-height:1.6;margin:10px 0}#mathError .math-error-location{display:block;margin-top:8px;border:1px solid #607994;border-radius:9px;background:#1b3048;color:#deedff;padding:8px 11px;font:inherit;cursor:pointer}

.math-input-details{margin:12px 0 18px;border:1px solid #354d69;border-radius:12px;padding:0 12px;background:#142233}.math-input-details summary{cursor:pointer;padding:12px 0;font-size:11px;color:#bdd5ed}.math-input-details label{margin:5px 0 8px}.math-input-details select{display:block;width:100%;min-height:44px;border:1px solid #466381;border-radius:9px;background:#1d3046;color:#e3efff;padding:8px;font:14px system-ui}.math-form .math-input-details p{font-size:11px;margin:10px 0 13px}

.math-sheet-area{display:grid;grid-template-rows:minmax(0,1fr) auto;min-width:0;min-height:0}
#mathCanvas.ink-touch-viewport{touch-action:pan-x pan-y}
.math-page-navigation{display:flex;justify-content:center;align-items:center;gap:8px;padding:5px 8px;border-top:1px solid #2a3443;background:#0e141e}
.math-page-navigation[hidden]{display:none}
.math-page-navigation button,.math-page-navigation select{min-height:44px;border:1px solid #344a66;border-radius:9px;background:#19283b;color:#d9eaff}
.math-page-navigation button{min-width:44px;font-size:22px}
.math-page-navigation select{min-width:0;max-width:calc(100% - 104px);padding:0 9px;font-size:13px}
.math-page-navigation button:disabled{opacity:.42}
