/* Calculator overlay (app/calc.js), styled on the TI-84 Plus CE keypad. Scoped to .calc-modal. */
.calc-modal { position: fixed; inset: 0; background: rgba(8, 10, 18, .55); display: none; align-items: flex-end; justify-content: center; z-index: 40; padding: 0; }
.calc-modal.open { display: flex; }
.calc-modal:focus { outline: none; }
@media (min-width: 560px) { .calc-modal { align-items: center; padding: 12px; } }
.calc { background: #1f2430; color: #e8ecf3; border-radius: 18px 18px 0 0; width: 100%; max-width: 420px; padding: 10px 10px 12px; box-shadow: 0 -8px 30px rgba(0,0,0,.35); font-family: var(--display, inherit); max-height: 96vh; max-height: 96dvh; display: flex; flex-direction: column; }
@media (min-width: 560px) { .calc { border-radius: 18px; } }
.calc-top { display: flex; align-items: center; gap: 8px; padding: 0 2px 6px; }
.calc-brand { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #9aa4b8; }
.calc-flags { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.calc .flag { font-size: .62rem; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; background: #2d3444; color: #c5cde0; }
.calc .flag.f2 { background: #2f6fed; color: #fff; }
.calc .flag.fa { background: #2fa36b; color: #fff; }
.calc-close { font: inherit; font-size: 1.3rem; line-height: 1; background: #2d3444; color: #e8ecf3; border: 0; border-radius: 999px; width: 34px; height: 34px; cursor: pointer; }
.calc-screen { background: #cfe3c6; color: #111; border-radius: 8px; padding: 8px 10px; min-height: 120px; max-height: 32vh; overflow: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1rem; line-height: 1.35; border: 3px solid #3b4252; }
.calc-screen .h { display: flex; justify-content: space-between; gap: 12px; }
.calc-screen .he { white-space: pre-wrap; word-break: break-all; }
.calc-screen .ha { white-space: nowrap; }
.calc-screen .ha.err { color: #a61e4d; }
.calc-entry { white-space: pre-wrap; word-break: break-all; min-height: 1.35em; }
.calc-entry .cursor { background: #111; color: #cfe3c6; animation: calc-blink 1s steps(1) infinite; }
.calc-entry .cursor.c2 { background: #2f6fed; color: #fff; }
.calc-entry .cursor.ca { background: #2fa36b; color: #fff; }
@keyframes calc-blink { 50% { background: transparent; color: inherit; } }
.calc-menu { margin-top: 6px; }
.calc-modebox, .calc-mathbox { background: #cfe3c6; color: #111; border-radius: 8px; padding: 6px 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.calc .mrow { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; align-items: center; }
.calc .mopt { font: inherit; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 3px 6px; cursor: pointer; color: #111; min-height: 30px; }
.calc .mopt.on { background: #111; color: #cfe3c6; }
.calc .mopt:hover { border-color: #111; }
.calc-mathbox { display: grid; grid-template-columns: 1fr 1fr; }
.calc .fine { font-family: inherit; font-size: .7rem; color: #334; margin: 4px 0 0; }
.calc-keys { margin-top: 8px; display: grid; gap: 5px; }
.calc-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.calc .k { position: relative; font: inherit; background: #3b4252; color: #fff; border: 0; border-radius: 7px; min-height: 46px; padding: 14px 2px 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; line-height: 1; }
.calc .k:active { transform: translateY(1px); filter: brightness(1.15); }
.calc .k .k1 { font-size: .9rem; font-weight: 700; }
.calc .k .k2 { position: absolute; top: 3px; left: 5px; font-size: .56rem; color: #8fb3ff; font-weight: 600; letter-spacing: .02em; }
.calc .k .ka { position: absolute; top: 3px; right: 5px; font-size: .56rem; color: #7fe0a8; font-weight: 600; }
.calc .k.k-num { background: #e8ecf3; color: #111; }
.calc .k.k-num .k1 { font-size: 1.05rem; }
.calc .k.k-op { background: #5b6478; }
.calc .k.k-2nd { background: #2f6fed; }
.calc .k.k-alpha { background: #2fa36b; }
.calc .k.k-enter { background: #5b6478; }
.calc .k.k-clear { background: #5b6478; }
.calc .k.k-on { background: #1a1e28; }
.calc .k.k-arrow { background: #2d3444; }
.calc .k.k-arrow .k1 { font-size: .8rem; }
.calc .k.k-dim { opacity: .45; cursor: default; }
.calc-modal.second .k .k2 { color: #fff; background: #2f6fed; padding: 1px 3px; border-radius: 3px; }
.calc-modal.alpha .k .ka { color: #fff; background: #2fa36b; padding: 1px 3px; border-radius: 3px; }
.calc-btn { font: inherit; font-size: .82rem; font-weight: 700; color: var(--accent); background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px; padding: 6px 12px; min-height: 36px; cursor: pointer; white-space: nowrap; }
.calc-btn:hover { border-color: var(--accent); }
.play .progress .tools { margin-left: auto; display: flex; gap: 6px; }
