#calculator-button[hidden] { display: none !important; }
.zeno-math-keypad { --sc-paper:#ffffff; --sc-ink:#293b39; --sc-muted:#687875; --sc-line:#e0e6e4; --sc-accent:#2b5da8; }
.zeno-math-keypad .sc-cursor-keys { display: flex; gap: 4px; margin-top: 7px; }
.zeno-math-keypad .sc-cursor-keys button { border: 1px solid var(--sc-line); border-radius: 4px; background: #ffffff; width: 26px; height: 24px; }
.zeno-math-keypad .sc-keypad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.zeno-math-keypad .sc-function-keys { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 9px; }
.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; }
.zeno-math-keypad .sc-key:hover { background: #edf3fb; border-color: #b5c9e5; box-shadow: 0 2px 5px #2b5da80c; }
.zeno-math-keypad .sc-key:active { transform: translateY(1px); }
.zeno-math-keypad .sc-key.sc-number { background: #ffffff; font: 500 19px var(--font-ui, "Mulish", sans-serif); font-variant-numeric: tabular-nums; }
.zeno-math-keypad .sc-key.sc-number:hover { background: #f0f5fc; }
.zeno-math-keypad .sc-key.sc-operation { background: #eef3fb; color: #2b5da8; font-size: 22px; }
.zeno-math-keypad .sc-key.sc-clear { color: var(--sc-accent); }
.zeno-math-keypad .sc-key.sc-equals { color: #ffffff; background: var(--sc-accent); border-color: var(--sc-accent); font-size: 22px; }
.zeno-math-keypad .sc-key.sc-equals:hover { background: #234f90; }
.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; }
.zeno-math-keypad .sc-function-keys .sc-key { height: 32px; }
@media (prefers-reduced-motion: reduce) { .zeno-math-keypad .sc-key { transition: none; } }

@media (max-width: 600px) { .zeno-math-keypad .sc-key { height: 39px; } }
@media (prefers-reduced-motion: reduce) { .zeno-math-keypad .sc-key:active { transform: none; } }

/* Scientific worksheet. Its controls use Arial; mathematical keycaps use Times. */
.student-calculator {
    box-sizing: border-box; position: fixed; z-index: 1400; top: 80px; right: 18px;
    width: min(600px, calc(100vw - 36px)); height: min(550px, calc(100dvh - 98px));
    min-height: 300px; display: flex; flex-direction: column; overflow: visible;
    background: #fff; border: 1px solid #ccc; color: #000;
    font: 300 14px Arial, sans-serif; text-align: left; isolation: isolate;
}
.student-calculator *, .student-calculator *::before, .student-calculator *::after { box-sizing: border-box; }
.student-calculator[hidden], .student-calculator [hidden] { display: none !important; }
.student-calculator button { font: inherit; color: inherit; cursor: pointer; margin: 0; letter-spacing: normal; text-transform: none; }
.student-calculator button:disabled { cursor: default; }
.student-calculator button:focus-visible { outline: 2px solid #2d70b3; outline-offset: -2px; }
.student-calculator button svg { width: 24px; height: 24px; display: block; fill: currentColor; pointer-events: none; }
.student-calculator .sc-close { position: absolute; right: -1px; top: -30px; width: 30px; height: 29px; border: 1px solid #ccc; border-bottom: 0; background: #fff; color: #666; font: 24px/24px Arial,sans-serif; }
.student-calculator .sc-close:hover { background: #eee; color: #000; }
.student-calculator .sc-worksheet { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; display: flex; flex-direction: column; }
.student-calculator .sc-rows { margin-top: auto; flex: none; }
.student-calculator .sc-row { display: flex; align-items: center; position: relative; min-height: 55px; border-top: 1px solid #ccc; padding: 1px 12px; gap: 6px; }
.student-calculator .sc-row.sc-selected { box-shadow: inset 0 0 0 2px #2d70b3; z-index: 1; }
.student-calculator math-field { --caret-color: #000; --selection-background-color: #b4d5fe; --selection-color:#000; --contains-highlight-background-color:transparent; --contains-highlight-color:#000; --smart-fence-color:#000; border: 0; border-radius: 0; outline: 0; background: transparent; margin: 0; color:#000; padding: 0; min-width: 0; }
.student-calculator math-field::part(virtual-keyboard-toggle), .student-calculator math-field::part(menu-toggle) { display: none; }
.student-calculator math-field::part(container) { padding: 0; }
.student-calculator math-field::part(content) { padding: 5px 3px; }
.student-calculator .sc-expression { flex: 1 1 auto; width: 0; font-size: 18.4px; min-height: 40px; display: block; }
.student-calculator .sc-output { flex: 0 1 auto; min-width: 0; max-width: 55%; display: flex; justify-content: flex-end; align-items: center; }
.student-calculator .sc-result { font-size: 18.4px; pointer-events: none; display: block; max-width: 100%; overflow-x: auto; }
.student-calculator .sc-answer-toggle { border: 0; background: none; padding: 2px; color: #777; align-self: center; font: 15px 'Times New Roman',serif; }
.student-calculator .sc-answer-toggle:hover, .student-calculator .sc-answer-toggle[aria-pressed="true"] { color: #2d70b3; }
.student-calculator .sc-warning { display: grid; place-items: center; width: 21px; height: 21px; border: 2px solid #c74440; border-radius: 50%; font: bold 14px Arial,sans-serif; color: #c74440; cursor: help; }
.student-calculator .sc-error-message { position: absolute; right: 10px; bottom: calc(100% - 2px); max-width: min(350px, 90%); padding: 9px 12px; background: white; border: 1px solid #c74440; box-shadow: 0 2px 5px #0002; font: 13px/1.4 Arial,sans-serif; color: #9e2926; z-index: 4; display: none; }
.student-calculator .sc-invalid:hover .sc-error-message, .student-calculator .sc-invalid:focus-within .sc-error-message { display: block; }
.student-calculator .sc-controls { flex: none; height: 47px; background: #eee; display: flex; align-items: center; padding: 0 7px; border-top: 1px solid #ccc; }
.student-calculator .sc-tabs { display: flex; align-self: flex-start; height: 38px; margin-top: 2px; flex: 0 0 201px; }
.student-calculator .sc-tabs button { flex: 1; border: 0; border-bottom: 4px solid transparent; padding: 4px 0 0; background: transparent; color: #555; font: 300 14px Arial,sans-serif; }
.student-calculator .sc-tabs button[aria-selected="true"] { color: #000; border-bottom-color: #2d70b3; }
.student-calculator .sc-tabs button:hover { background: #e2e2e2; }
.student-calculator .sc-angle { display: flex; flex: none; margin: 0 5px 0 4px; }
.student-calculator .sc-angle button { height: 25px; border: 1px solid #bbb; border-radius: 2px; background: linear-gradient(#fafafa,#e7e7e7); padding: 0 7px; font-size: 13px; color: #333; }
.student-calculator .sc-angle button + button { margin-left: -1px; }
.student-calculator .sc-angle button[aria-checked="true"] { background: #dce5f4; border-color: #2d70b3; color: #234f84; z-index: 1; }
.student-calculator .sc-angle button:disabled { opacity: .4; }
.student-calculator .sc-tool { display: grid; place-items: center; border: 0; background: none; height: 40px; flex: 1; padding: 0; color: #666; }
.student-calculator .sc-tool svg { width: 23px; height: 23px; }
.student-calculator .sc-tool:disabled { color: #ccc; }
.student-calculator .sc-tool:not(:disabled):hover { background: #ddd; }
.student-calculator .sc-clear { flex: 1.5; height: 40px; padding: 0; white-space: nowrap; background: transparent; border: 0; color: #666; font-size: 14px; }
.student-calculator .sc-clear:disabled { color: #ccc; }
.student-calculator .sc-clear:not(:disabled):hover { background: #ddd; }
.student-calculator .sc-keys { flex: none; background: #eee; padding: 0 5px 6px; display: grid; gap: 4px; }
.student-calculator .sc-key-row { display: flex; gap: 4px; height: 36px; }
.student-calculator .sc-calc-key { display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 0; height: 36px; padding: 0; border: 1px solid #d8d8d8; border-radius: 0; background: linear-gradient(#fff,#fafafa); font: 16.56px 'Times New Roman',serif; color: #000; box-shadow: 0 1px 1px #00000006; touch-action: manipulation; }
.student-calculator .sc-calc-key i { font-family: 'Times New Roman',serif; font-weight: 400; }
.student-calculator .sc-calc-key sup { font-size: .7em; align-self: flex-start; margin-top: 5px; line-height: 1; }
.student-calculator .sc-calc-key .sc-root-index { position: relative; margin: 4px -4px 0 0; }
.student-calculator .sc-radical-line { width: 8px; border-top: 1px solid; height: 12px; margin-left: -1px; }
.student-calculator .sc-calc-key.sc-shaded { border-color: #bdbdbd; background: linear-gradient(#d6d6d6,#c9c9c9); }
.student-calculator .sc-calc-key:hover { background: #e4e4e4; }
.student-calculator .sc-calc-key.sc-shaded:hover { background: #bfbfbf; }
.student-calculator .sc-calc-key:active { background: #aaa; }
.student-calculator .sc-calc-key.sc-enter { background: linear-gradient(#2f78d7,#2d70d4); border-color: #2968c4; border-radius: 2px; color: #fff; }
.student-calculator .sc-calc-key.sc-enter:hover { background: #2465bc; }
.student-calculator .sc-calc-key.sc-enter:active { background: #1c5096; }
.student-calculator .sc-calc-key svg { width: 22px; height: 22px; }
.student-calculator .sc-calc-key[aria-label="Backspace"] svg { width: 18px; }
.student-calculator .sc-fraction { display: inline-flex; flex-direction: column; align-items: stretch; text-align: center; font-size: .8em; line-height: 1.05; min-width: 9px; }
.student-calculator .sc-fraction > :first-child { border-bottom: 1px solid; padding-bottom: 1px; }
.student-calculator .sc-fraction > :last-child { padding-top: 1px; }
.student-calculator .sc-group-start { margin-left: 24px; }
.student-calculator .sc-keys[data-tab="main"] .sc-wide-enter { flex: 2 1 0; margin-left: 24px; }
.student-calculator .sc-keys[data-tab="main"] .sc-wide-back { flex: 1.5 1 0; margin-left: calc(24px + (100% - 80px) / 18); }
.student-calculator .sc-keys[data-tab="abc"] .sc-key-row:nth-child(2) { padding: 0 30px; }
.student-calculator .sc-keys[data-tab="abc"] .sc-letter-wide { flex: 1.6 1 0; }
.student-calculator .sc-keys[data-tab="abc"] [aria-pressed="true"] { background: #999; }
.student-calculator .sc-settings { position: absolute; z-index: 8; bottom: 212px; right: 4px; width: 282px; padding: 10px; background: #fff; border: 1px solid #bbb; border-radius: 5px; box-shadow: 0 2px 8px #0003; }
.student-calculator .sc-display { display: flex; height: 36px; margin-bottom: 10px; }
.student-calculator .sc-display button { flex: 1; border: 1px solid #999; background: #fff; font: bold 16px Arial,sans-serif; }
.student-calculator .sc-display button:first-child { border-radius: 3px 0 0 3px; }
.student-calculator .sc-display button:last-child { border-radius: 0 3px 3px 0; margin-left: -1px; font-size: 24px; }
.student-calculator .sc-display button[aria-checked="true"] { color: white; background: #555; border-color: #333; z-index: 1; }
.student-calculator .sc-complex { padding-top: 10px; border-top: 1px solid #ddd; display: flex; align-items: center; cursor: pointer; }
.student-calculator .sc-complex input { position: absolute; opacity: 0; width: 32px; height: 22px; right: 10px; }
.student-calculator .sc-switch { margin-left: auto; height: 12px; width: 30px; background: #ddd; border-radius: 9px; position: relative; }
.student-calculator .sc-switch::after { content: ''; position: absolute; top: -4px; left: 0; width: 20px; height: 20px; background: #f6f6f6; box-shadow: 0 1px 3px #0003; border-radius: 50%; }
.student-calculator input:checked + .sc-switch { background: #9ac1eb; }
.student-calculator input:checked + .sc-switch::after { left: 10px; background: #2d70b3; }
.student-calculator input:focus-visible + .sc-switch { outline: 2px solid #2d70b3; outline-offset: 5px; }
.student-calculator.sc-large .sc-expression, .student-calculator.sc-large .sc-result { font-size: 28px; }
.student-calculator.sc-large .sc-row { min-height: 69px; }
.student-calculator.sc-large .sc-calc-key { font-size: 21px; }
.student-calculator.sc-large .sc-key-row, .student-calculator.sc-large .sc-calc-key { height: 44px; }
.student-calculator.sc-large .sc-settings { bottom: 244px; }
@media (max-width: 640px) {
    .student-calculator { right: 8px; top: 42px; width: calc(100vw - 16px); height: calc(100dvh - 50px); }
    .student-calculator .sc-controls { padding: 0 4px; }
    .student-calculator .sc-tabs { flex-basis: 32%; }
    .student-calculator .sc-angle { margin: 0 3px; }
    .student-calculator .sc-angle button { padding: 0 3px; font-size: 11px; }
    .student-calculator .sc-tabs button, .student-calculator .sc-clear { font-size: 12px; }
    .student-calculator .sc-tool svg { width: 20px; }
    .student-calculator .sc-group-start { margin-left: 7px; }
    .student-calculator .sc-keys[data-tab="main"] .sc-wide-enter { margin-left: 7px; }
    .student-calculator .sc-keys[data-tab="main"] .sc-wide-back { margin-left: calc(7px + (100% - 46px) / 18); }
    .student-calculator .sc-keys[data-tab="abc"] .sc-key-row:nth-child(2) { padding: 0 5%; }
}
@media (max-height: 500px) and (min-width: 641px) {
    .student-calculator { top: 36px; height: calc(100dvh - 44px); }
}

.student-calculator .sc-tabs button:first-child { flex: 1.1; }
.student-calculator .sc-calc-key[aria-label="Previous answer"] { font: 14.4px Arial,sans-serif; }
.student-calculator .sc-keys[data-tab="main"] .sc-key-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) 20.67px repeat(4,minmax(0,1fr)) 20.67px repeat(2,minmax(0,1fr)); }
.student-calculator .sc-keys[data-tab="main"] .sc-calc-key { margin-left: 0; }
.student-calculator .sc-keys[data-tab="main"] .sc-calc-key:nth-child(4) { grid-column: 5; }
.student-calculator .sc-keys[data-tab="main"] .sc-calc-key:nth-child(8) { grid-column: 10; }
.student-calculator .sc-keys[data-tab="main"] .sc-calc-key.sc-wide-enter { grid-column: 10 / span 2; }
.student-calculator .sc-keys[data-tab="main"] .sc-calc-key.sc-wide-back { grid-column: 10 / span 2; width: 74%; justify-self: end; }
@media(max-width:640px) { .student-calculator .sc-keys[data-tab="main"] .sc-key-row { grid-template-columns: repeat(3,minmax(0,1fr)) 3px repeat(4,minmax(0,1fr)) 3px repeat(2,minmax(0,1fr)); } }

/* Graphing: the same rows and keys with a graph. Narrow, the graph sits above them;
   wide (sc-wide), it sits beside them and takes the full height. */
.student-calculator .sc-swatch { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.student-calculator.sc-graphing { width: min(940px, calc(100vw - 36px)); display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(120px,1fr) auto auto auto; }
.student-calculator.sc-graphing .sc-worksheet { max-height: 168px; }
.student-calculator .sc-graph { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; border-bottom: 1px solid #ccc; overflow: hidden; }
.student-calculator.sc-graphing.sc-wide { grid-template-columns: minmax(0,1fr) 420px; grid-template-rows: minmax(0,1fr) auto auto; }
.student-calculator.sc-graphing.sc-wide .sc-worksheet { max-height: none; }
.student-calculator.sc-graphing.sc-wide .sc-worksheet, .student-calculator.sc-graphing.sc-wide .sc-controls, .student-calculator.sc-graphing.sc-wide .sc-keys { grid-column: 2; }
.student-calculator.sc-graphing.sc-wide .sc-graph { grid-row: 1 / -1; border-bottom: 0; border-right: 1px solid #ccc; }
/* A page's own button font must not reach the calculator's controls. */
.student-calculator .sc-angle button, .student-calculator .sc-clear { font-family: Arial, sans-serif; font-weight: 300; }
/* The narrow-panel arrangement follows the panel's own width, so it also applies when docked in a column. */
.student-calculator { container-type: inline-size; }
@container (max-width: 520px) {
    .student-calculator .sc-controls { padding: 0 4px; }
    .student-calculator .sc-tabs { flex-basis: 32%; }
    .student-calculator .sc-angle { margin: 0 3px; }
    .student-calculator .sc-angle button { padding: 0 3px; font-size: 11px; }
    .student-calculator .sc-tabs button, .student-calculator .sc-clear { font-size: 12px; }
    .student-calculator .sc-tool svg { width: 20px; }
    .student-calculator .sc-keys[data-tab="main"] .sc-key-row { grid-template-columns: repeat(3,minmax(0,1fr)) 8px repeat(4,minmax(0,1fr)) 8px repeat(2,minmax(0,1fr)); }
}
/* Docked: the calculator fills the place its page gave it, and the page supplies the close control. */
.student-calculator.sc-docked { position: relative; inset: auto; z-index: auto; width: 100%; height: 100%; min-height: 0; border: 0; }
.student-calculator.sc-docked .sc-close { display: none; }
