/* Scientific calculator widget (app/views/tools/scientific-calculator.php). */
.sc [hidden] { display: none !important; }
.sc-screen { border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); padding: 10px 12px; }
.sc-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sc-expr { display: block; width: 100%; box-sizing: border-box; border: 0; background: transparent; color: var(--ink); font: 600 1.35rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: right; padding: 6px 2px; outline-offset: 2px; }
.sc-res { min-height: 1.5em; text-align: right; color: var(--muted); font: 500 1rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.sc-res.sc-err { color: var(--err); }
.sc-res.sc-pending { opacity: .75; }
.sc-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.sc-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sc-key { min-height: 46px; padding: 0 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: 600 1.05rem/1 inherit; font-family: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sc-key:hover { border-color: var(--brand); }
.sc-key:active { transform: scale(.97); }
.sc-key:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.sc-fn { background: var(--soft); font-size: .9rem; font-weight: 500; }
.sc-op { background: var(--soft); color: var(--brand-ink); }
.sc-act { background: var(--soft); color: var(--err); }
.sc-eq { background: var(--brand); border-color: var(--brand); color: #fff; font-size: 1.25rem; }
.sc-history { margin-top: 14px; }
.sc-history-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sc-history ol { list-style: none; margin: 0; padding: 0; }
.sc-history li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; }
.sc-history li > button:first-child { flex: 1 1 auto; min-width: 0; border: 0; background: none; padding: 0; text-align: left; color: var(--muted); font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.sc-history li > span { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 420px) { .sc-key { min-height: 42px; font-size: .98rem; } .sc-fn { font-size: .8rem; } }
