* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #1c1c1e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.calculator {
  width: 340px;
  background: #000;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.display {
  text-align: right;
  padding: 20px 12px 16px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.expression {
  font-size: 18px;
  color: #8e8e93;
  min-height: 22px;
  margin-bottom: 4px;
  word-break: break-all;
}

.result {
  font-size: 56px;
  font-weight: 300;
  color: #fff;
  line-height: 1.1;
  word-break: break-all;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.key {
  height: 68px;
  border: none;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 400;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
  user-select: none;
}

.key:active {
  transform: scale(0.95);
}

.key.num {
  background: #333;
  color: #fff;
}

.key.num:hover {
  filter: brightness(1.3);
}

.key.fn {
  background: #a5a5a5;
  color: #000;
}

.key.fn:hover {
  filter: brightness(1.1);
}

.key.op {
  background: #ff9f0a;
  color: #fff;
}

.key.op:hover {
  filter: brightness(1.15);
}

.key.op.active {
  background: #fff;
  color: #ff9f0a;
}

.zero {
  grid-column: span 2;
  border-radius: 34px;
  text-align: left;
  padding-left: 26px;
}
