#calculator-button[hidden] { display: none !important; }
.student-calculator, .zeno-math-keypad {
    --sc-paper: #ffffff;
    --sc-ink: #293b39;
    --sc-muted: #687875;
    --sc-line: #e0e6e4;
    --sc-accent: #2b5da8;
}
.student-calculator {
    box-sizing: border-box;
    position: fixed;
    z-index: 1400;
    right: 18px;
    top: 80px;
    bottom: 18px;
    width: min(384px, calc(100vw - 36px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--sc-ink);
    background: var(--sc-paper);
    border: 1px solid var(--sc-line);
    border-radius: 16px;
    box-shadow: 0 14px 48px #22303a24, 0 2px 6px #22303a12;
    font-family: var(--font-ui, "Mulish", system-ui, sans-serif);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}
.student-calculator *, .student-calculator *::before, .student-calculator *::after { box-sizing: border-box; }
.student-calculator[hidden], .student-calculator [hidden] { display: none !important; }
.student-calculator button, .student-calculator input { font: inherit; }
.student-calculator button { color: inherit; cursor: pointer; }
.student-calculator button:focus-visible, .student-calculator input:focus-visible, .student-calculator summary:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.student-calculator h2, .student-calculator p { margin: 0; }
.student-calculator .sc-header { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 18px 20px 14px; border-bottom: 1px solid var(--sc-line); }
.student-calculator .sc-eyebrow { font: 600 10px var(--font-ui, "Mulish", sans-serif); letter-spacing: .1em; text-transform: uppercase; color: var(--sc-muted); margin-bottom: 3px; }
.student-calculator h2 { font: 400 27px/1.1 var(--font-display, "Bogue", Georgia, serif); letter-spacing: -.5px; }
.student-calculator .sc-icon-button { display: grid; place-items: center; background: none; border: 0; width: 34px; height: 34px; border-radius: 6px; font-size: 26px; line-height: 1; color: #65716f; }
.student-calculator .sc-icon-button:hover { background: #22303a0a; }
.student-calculator .sc-scroll-area { overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 20px; scrollbar-width: thin; min-height: 0; }
.student-calculator .sc-field-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.student-calculator .sc-angle { display: flex; gap: 1px; padding: 2px; border: 1px solid var(--sc-line); border-radius: 5px; }
.student-calculator .sc-angle button { background: none; border: 0; border-radius: 3px; padding: 3px 9px; color: var(--sc-muted); font: 600 11px var(--font-ui, "Mulish", sans-serif); }
.student-calculator .sc-angle button[aria-pressed="true"] { background: #ffffff; color: var(--sc-ink); box-shadow: 0 1px 3px #22303a15; }
.student-calculator .sc-expression { width: 100%; color: var(--sc-ink); border: 1px solid #dbe3e0; border-radius: 6px; background: #ffffff; padding: 12px; box-shadow: inset 0 1px 2px #22303a04; }
.student-calculator .sc-expression { font: 500 20px/1.5 var(--font-ui, "Mulish", sans-serif); }
.student-calculator .sc-expression::placeholder { font: 14px/1.5 var(--font-ui, "Mulish", sans-serif); color: #8a8e88; }
.student-calculator math-field {
    --caret-color: var(--sc-accent);
    --selection-color: var(--sc-ink);
    --selection-background-color: #2b5da81c;
    /* The caret identifies the edit position; do not shade its entire fraction
       or root. Keep explicit selections readable on this light paper surface. */
    --contains-highlight-background-color: transparent;
    --contains-highlight-color: var(--sc-ink);
    --smart-fence-color: var(--sc-ink);
}
.student-calculator math-field.sc-expression { display: block; min-height: 70px; font-size: 23px; padding: 10px; }
.student-calculator math-field:focus-within { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.student-calculator math-field::part(virtual-keyboard-toggle), .student-calculator math-field::part(menu-toggle) { display: none; }
.student-calculator .sc-entry-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
:is(.student-calculator, .zeno-math-keypad) .sc-cursor-keys { display: flex; gap: 4px; margin-top: 7px; }
:is(.student-calculator, .zeno-math-keypad) .sc-cursor-keys button { border: 1px solid var(--sc-line); border-radius: 4px; background: #ffffff; width: 26px; height: 24px; }
.student-calculator math-field.sc-history-expression { border: 0; background: transparent; padding: 0; font-size: 17px; max-width: 100%; pointer-events: none; }
.student-calculator .sc-hint { color: var(--sc-muted); font-size: 10.5px; line-height: 1.55; margin-top: 7px; }
.student-calculator .sc-answer { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 14px 0 16px; min-height: 37px; }
.student-calculator .sc-answer-label { color: var(--sc-muted); font-size: 11px; }
.student-calculator #sc-result { overflow-wrap: anywhere; text-align: right; font: 500 26px/1.35 var(--font-ui, "Mulish", sans-serif); font-variant-numeric: tabular-nums; }
:is(.student-calculator, .zeno-math-keypad) .sc-keypad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
:is(.student-calculator, .zeno-math-keypad) .sc-function-keys { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 9px; }
:is(.student-calculator, .zeno-math-keypad) .sc-key { height: 38px; padding: 0 1px; border: 1px solid var(--sc-line); border-radius: 8px; background: #f5f7f8; font: 500 12px var(--font-ui, "Mulish", sans-serif); transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease; box-shadow: 0 1px 2px #22303a04; }
:is(.student-calculator, .zeno-math-keypad) .sc-key:hover { background: #edf3fb; border-color: #b5c9e5; box-shadow: 0 2px 5px #2b5da80c; }
:is(.student-calculator, .zeno-math-keypad) .sc-key:active { transform: translateY(1px); }
:is(.student-calculator, .zeno-math-keypad) .sc-key.sc-number { background: #ffffff; font: 500 19px var(--font-ui, "Mulish", sans-serif); font-variant-numeric: tabular-nums; }
:is(.student-calculator, .zeno-math-keypad) .sc-key.sc-number:hover { background: #f0f5fc; }
:is(.student-calculator, .zeno-math-keypad) .sc-key.sc-operation { background: #eef3fb; color: #2b5da8; font-size: 22px; }
:is(.student-calculator, .zeno-math-keypad) .sc-key.sc-clear { color: var(--sc-accent); }
:is(.student-calculator, .zeno-math-keypad) .sc-key.sc-equals { color: #ffffff; background: var(--sc-accent); border-color: var(--sc-accent); font-size: 22px; }
:is(.student-calculator, .zeno-math-keypad) .sc-key.sc-equals:hover { background: #234f90; }
.student-calculator .sc-history { margin-top: 19px; border-top: 1px solid var(--sc-line); }
.student-calculator .sc-history summary { padding: 12px 0; color: #606d69; font-size: 11px; cursor: pointer; }
.student-calculator #sc-history-count { margin-left: 5px; color: var(--sc-muted); font: 600 11px var(--font-ui, "Mulish", sans-serif); }
.student-calculator #sc-history-list { padding: 0; margin: 0 0 8px; list-style: none; }
.student-calculator #sc-history-list button { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; width: 100%; padding: 9px 4px; background: none; border: 0; border-bottom: 1px solid var(--sc-line); text-align: right; overflow-wrap: anywhere; }
.student-calculator #sc-history-list button:hover { background: #22303a05; }
.student-calculator .sc-history-expression { font: 12px/1.4 var(--font-ui, "Mulish", sans-serif); color: var(--sc-muted); }
.student-calculator .sc-history-result { font: 500 14px/1.5 var(--font-ui, "Mulish", sans-serif); }
.student-calculator .sc-text-button { border: 0; background: none; padding: 7px 0; color: var(--sc-accent); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.student-calculator .sc-error { margin: 9px 0 4px; padding: 9px 10px; border-left: 2px solid var(--sc-accent); background: #fff2ed; color: #913421; font-size: 12px; }
@media (max-width: 600px) {
    .student-calculator { right: 10px; top: 12px; bottom: 12px; width: calc(100vw - 20px); max-width: 420px; }
    .student-calculator .sc-header { padding-top: 14px; padding-bottom: 12px; }
    :is(.student-calculator, .zeno-math-keypad) .sc-key { height: 39px; }
}
@media (max-height: 640px) and (min-width: 601px) {
    .student-calculator { top: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    :is(.student-calculator, .zeno-math-keypad) .sc-key:active { transform: none; }
}

.zeno-math-keypad { color: var(--sc-ink); font: 13px/1.45 var(--font-ui, "Mulish", system-ui, sans-serif); }
.zeno-math-keypad *, .zeno-math-keypad *::before, .zeno-math-keypad *::after { box-sizing: border-box; }
.zeno-math-keypad button { color: inherit; cursor: pointer; font: inherit; }
.zeno-math-keypad button:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.zeno-math-keypad button:disabled { opacity: .5; cursor: default; }
.zeno-math-keypad-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.zeno-math-keypad-tools .sc-cursor-keys { margin-top: 0; margin-left: auto; }
.zeno-math-keypad .sc-variable-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: calc(60% - 3px); }
.zeno-math-keypad .sc-key.sc-variable { background: #ffffff; font: italic 21px "KaTeX_Math", Georgia, serif; }
.zeno-math-keypad .sc-key.sc-repeating { background: #ffffff; font-size: 18px; }
.zeno-math-keypad .sc-repeating-symbol { display: inline-block; border-top: 1.5px solid currentColor; line-height: 1; padding: 1px 2px 0; }
.zeno-math-keypad .sc-key.sc-answer-equals { grid-column: 5; grid-row: 3 / span 2; height: auto; }

:is(.student-calculator, .zeno-math-keypad) .sc-function-keys .sc-key { height: 32px; }
@media (prefers-reduced-motion: reduce) { :is(.student-calculator, .zeno-math-keypad) .sc-key { transition: none; } }
