:root {
  --bg: #ffffff;
  --card: #f3f2ef;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.5);
  --line: rgba(23, 23, 26, 0.1);
  --accent: #3b6cf6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 12px;
}

.cl { position: relative; width: min(244px, 100%); padding: 12px; border-radius: 26px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 #ffffff, 0 26px 36px -24px rgba(23, 23, 26, 0.5); }
/* the display: the sum above, small, and the number being typed */
.cl__screen { display: grid; align-content: end; justify-items: end; gap: 0; height: 68px; padding: 6px 12px 8px; border-radius: 16px; background: #ffffff; box-shadow: inset 0 0 0 1px var(--line), inset 0 3px 6px -3px rgba(23, 23, 26, 0.18); overflow: hidden; }
.cl__sum { display: block; height: 16px; overflow: hidden; font-size: 12px; line-height: 16px; font-weight: 550; color: var(--soft); font-variant-numeric: tabular-nums; }
.cl__sum span { display: block; white-space: nowrap; }
.cl__value { display: flex; justify-content: flex-end; height: 36px; font-size: 31px; line-height: 36px; font-weight: 640; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; transform-origin: 100% 60%; }
.cl__value i { display: inline-block; font-style: normal; }

.cl__pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.cl__key { position: relative; display: grid; place-items: center; height: min(44px, 9.2vh); border: 0; border-radius: 14px; background: #ffffff; color: var(--ink); font: inherit; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; outline: none; box-shadow: inset 0 0 0 1px var(--line), inset 0 -2px 0 rgba(23, 23, 26, 0.06), 0 2px 3px -1px rgba(23, 23, 26, 0.2); transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.cl__key span { display: block; pointer-events: none; }
.cl__key.is-wide { grid-column: span 2; }
.cl__key.is-fn { background: #e6e4df; font-size: 15px; font-weight: 680; }
.cl__key.is-op { background: color-mix(in srgb, var(--accent) 13%, #ffffff); color: var(--accent); font-size: 21px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent), 0 2px 3px -1px rgba(23, 23, 26, 0.16); }
/* the operation waiting for its second number stays lit */
.cl__key.is-op.is-held { background: var(--accent); color: #ffffff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 10px -6px var(--accent); }
.cl__key.is-eq { background: var(--accent); color: #ffffff; font-size: 21px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 12px -8px var(--accent); }
.cl__key:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
@media (hover: hover) { .cl__key:not(.is-op):not(.is-eq):not(.is-fn):hover { background: #fbfaf8; box-shadow: inset 0 0 0 1px rgba(23, 23, 26, 0.2), 0 2px 3px -1px rgba(23, 23, 26, 0.2); } }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }
