/* Scientific calculator - expression input, result screen, 5-column keypad. */
.sc-input { font-family: var(--e-mono); font-size: 1.05em; }
.sc-screen {
    margin: 8px 0 var(--e-gap); padding: 8px 12px; min-height: 58px; text-align: right;
    background: var(--e-surface); border: 1px solid var(--e-line); border-radius: 10px;
}
.sc-out { display: block; font-size: 1.7em; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sc-err { margin: 2px 0 0; font-size: .82em; color: var(--e-bad); text-align: left; }
.sc-err:empty { display: none; }
.sc-pad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sc-key {
    font: inherit; font-size: 1em; font-weight: 600; min-height: 42px; padding: 0 2px; cursor: pointer;
    border: 1px solid var(--e-line-strong); border-radius: 9px; background: var(--e-bg); color: var(--e-ink);
    white-space: nowrap; overflow: hidden;
}
.sc-key:hover { background: var(--e-surface); }
.sc-key.sc-fn { font-size: .88em; font-weight: 500; background: var(--e-surface); color: var(--e-ink-2); min-height: 36px; }
.sc-key.sc-op { background: var(--e-surface); color: var(--e-ink-2); font-size: 1.1em; }
.sc-key.sc-eq { background: var(--e-accent); color: var(--e-accent-ink); border-color: var(--e-accent); }
.sc-key:focus-visible { outline: 2px solid var(--e-focus); outline-offset: 2px; }
.sc-key:active { transform: translateY(1px); }
@media (max-width: 360px) { .sc-pad { gap: 4px; } .sc-key.sc-fn { font-size: .8em; } }
html[data-compact="1"] .sc-key { min-height: 36px; }
html[data-compact="1"] .sc-out { font-size: 1.4em; }
