/* Wider than the shared default (640px, see base.css) - two side-by-side
   keypads (scientific functions + standard digits) need the room. Matches
   the same --content-wide token the header/footer always use, so nothing
   on this page looks narrower than the chrome around it. */
.sc-app, .info { max-width: var(--content-wide); }

.card h1 { margin-bottom: 16px; }

.sc-display {
  background: var(--display-grad);
  border-radius: 12px;
  padding: 22px 18px 18px;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 10px rgba(31, 20, 80, 0.18);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  overflow: hidden;
}

.sc-expression {
  font-family: var(--mono);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  min-height: 18px;
  white-space: nowrap;
  overflow-x: auto;
  text-align: right;
}

.sc-result {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 12px rgba(31, 20, 80, 0.25);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow-x: auto;
}

.sc-result.error {
  color: #ffd0dc;
  text-shadow: none;
  font-size: 20px;
}

.sc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sc-mode-toggle {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: var(--key-bg);
}

.sc-mode-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  cursor: pointer;
}
.sc-mode-btn:hover { color: var(--text-primary); }
.sc-mode-btn.active {
  color: var(--accent-primary);
  background: var(--panel);
  box-shadow: 0 1px 4px rgba(31, 35, 51, 0.12);
}

.sc-memory-indicator {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-primary-dim);
  border-radius: 8px;
  padding: 6px 10px;
}

.sc-pads {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 12px;
}

.sc-pad {
  display: grid;
  gap: 6px;
}

.sc-pad-scientific {
  grid-template-columns: repeat(6, 1fr);
  align-content: start;
}

.sc-pad-standard {
  grid-template-columns: repeat(4, 1fr);
  align-content: start;
}

.sc-key {
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 0;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background: var(--key-bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease;
}

.sc-pad-scientific .sc-key { font-size: 12px; padding: 10px 0; }
.sc-pad-standard .sc-key { font-size: 18px; padding: 16px 0; }

.sc-key:hover { background: var(--key-bg-hover); }
.sc-key:active { transform: translateY(1px) scale(0.98); }

.sc-key-fn {
  color: var(--accent-rose);
  background: var(--accent-rose-dim);
  border-color: transparent;
}
.sc-key-fn:hover { background: rgba(225, 29, 116, 0.18); }

.sc-key-mem {
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
  border-color: transparent;
  font-size: 12px;
}
.sc-key-mem:hover { background: rgba(37, 99, 235, 0.18); }

.sc-key-percent {
  color: var(--accent-amber);
  background: var(--accent-amber-dim);
  border-color: transparent;
}
.sc-key-percent:hover { background: rgba(217, 119, 6, 0.2); }

.sc-key-op {
  color: var(--accent-teal);
  background: var(--accent-teal-dim);
  border-color: transparent;
}
.sc-key-op:hover { background: rgba(13, 148, 136, 0.2); }

.sc-key-equals {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
  font-weight: 700;
}
.sc-key-equals:hover { background: #6a48f2; }

.sc-key:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

@media (max-width: 700px) {
  .sc-pads { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .sc-result { font-size: 28px; }
  .sc-pad-standard .sc-key { font-size: 16px; padding: 14px 0; }
}
