.mk-toggle{border:1px solid #dcd5f3;border-radius:9px;background:#f4f0ff;color:#6244bd;min-height:44px;padding:8px 12px;font:700 13px 'DM Sans',sans-serif;cursor:pointer;white-space:nowrap}
.mk-toggle:focus-visible,.math-keyboard button:focus-visible{outline:3px solid #6244d5;outline-offset:2px}
.mk-toggle[aria-expanded=true]{background:#7456e8;color:white;border-color:#7456e8}
.mk-toggle:disabled{opacity:.45;cursor:default}
.math-keyboard[hidden],.mk-alphabets[hidden]{display:none!important}
.math-keyboard{position:fixed;z-index:40;bottom:0;inset-inline:0;border-top:1px solid #dcd5ed;background:#f0eef8;box-shadow:0 -8px 35px #30205218;color:#292438;padding:8px 12px max(8px,env(safe-area-inset-bottom));max-height:70dvh;overflow-y:auto;overscroll-behavior:contain}
.mk-inner{max-width:720px;margin:auto}
.mk-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 2px 3px;font-size:12px;color:#655d7b}
.math-keyboard button{font-family:'DM Sans',sans-serif;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none}
.math-keyboard button:disabled{opacity:.35;cursor:default}
.mk-done{min-height:36px;border:0;background:none;border-radius:8px;color:#6343c0;font-size:13px;font-weight:800;padding:4px 10px}
.mk-preview{border:1px solid #e0daef;background:#faf9fe;border-radius:10px;min-height:44px;max-height:78px;overflow:auto;padding:7px 12px;display:flex;align-items:center;font:20px/1.4 'Cambria Math','Times New Roman',serif;white-space:pre;scrollbar-width:thin}
.mk-placeholder{font:12px 'DM Sans',sans-serif;color:#82788e;white-space:normal}
.mk-preview math{font-size:21px;flex-shrink:0}
.mk-tabs{display:flex;align-items:center;gap:6px;padding:7px 0}
.mk-tab{border:0;border-radius:20px;background:transparent;color:#665e77;min-width:52px;min-height:40px;font-size:17px;font-weight:600;padding:7px 14px}
.mk-tab[aria-selected=true]{background:#a28af6;color:#241641}
.mk-alphabets{display:flex;gap:6px;padding:0 0 6px}
.mk-alphabets button{border:1px solid #dcd5ed;border-radius:8px;padding:4px 13px;min-height:32px;background:transparent;color:#665e77}
.mk-alphabets button[aria-pressed=true]{background:#ded5fb;color:#39236c}
.mk-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
.mk-key{min-width:0;min-height:44px;padding:6px 2px;border:1px solid #e8e4f0;border-bottom:2px solid #dcd7e7;border-radius:9px;background:#fff;color:#282333;font-size:21px;line-height:1.1}
.mk-key:active,.mk-navigation button:active{background:#e3dafb;transform:translateY(1px)}
.mk-command{background:#dbd7e4;border-color:#d1cbdc}
.mk-key[aria-pressed=true]{background:#a28af6}
.mk-navigation{display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) 2.3fr;gap:5px;margin-top:7px}
.mk-navigation button{border:0;border-radius:8px;background:#e0dce9;color:#4d425f;min-height:38px;font-size:23px;padding:3px}
.mk-navigation .mk-native{background:transparent;color:#65577a;font-size:11px;line-height:1.2;font-weight:700;padding:2px 5px}
.math-keyboard-open{padding-bottom:calc(var(--math-keyboard-height,380px) + 16px)}
html:has(.math-keyboard-open){scroll-padding-bottom:calc(var(--math-keyboard-height,380px) + 14px)}
#answer,#answer-unit,#exam-solution{scroll-margin-bottom:16px;scroll-margin-top:16px}
.answer-fields{flex-wrap:wrap}.answer-fields>#answer{flex-basis:140px}.answer-fields>.mk-toggle{order:3;align-self:flex-end}
.answer-unit-wrap>.mk-toggle{font-size:11px;padding:4px;min-height:32px}
.exam-response>.mk-toggle{justify-self:start;margin-top:-7px}
@media(min-width:761px){
  .math-keyboard{position:static;width:100%;max-width:620px;margin:20px auto 0;border:1px solid #dcd5ed;border-radius:18px;padding:12px;max-height:none;overflow:visible;box-shadow:none}
  .math-keyboard .mk-key{min-height:38px;font-size:19px}
  .math-keyboard-open{padding-bottom:0}
  html:has(.math-keyboard-open){scroll-padding-bottom:16px}
  .answer-form>.primary-button{min-height:44px}
}
@media(max-width:760px){.answer-fields{flex-basis:100%}.answer-fields>#answer{width:auto;flex-basis:100%}.answer-fields>.mk-toggle{order:0}.answer-unit-wrap{width:110px}.answer-form>.primary-button{min-height:46px;flex:1}.mk-key{font-size:20px}.math-keyboard{padding-inline:8px}.mk-heading{font-size:11px}.mk-navigation button{min-height:40px}}
@media(max-width:760px) and (max-height:500px) and (orientation:landscape){.math-keyboard{max-height:70dvh}.mk-heading{position:absolute;right:12px;top:8px}.mk-heading strong,.mk-preview{display:none}.mk-inner{max-width:850px}.mk-tabs{padding-top:0}.mk-grid{grid-template-columns:repeat(12,minmax(0,1fr))}.mk-key{min-height:38px}.mk-navigation{margin-top:5px}.math-keyboard-open{padding-bottom:var(--math-keyboard-height,260px)}}
