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

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

.calculator {
  width: 320px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  background: #16213e;
}

.display {
  padding: 28px 24px 20px;
  text-align: right;
  background: #0f3460;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.display-expression {
  color: #8899aa;
  font-size: 14px;
  min-height: 20px;
  margin-bottom: 6px;
  word-break: break-all;
}

.display-value {
  color: #e6e6e6;
  font-size: 40px;
  font-weight: 300;
  line-height: 1.1;
  word-break: break-all;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 1px;
  background: #0d1b3e;
}

.btn {
  background: #1a1a40;
  border: none;
  color: #e6e6e6;
  font-size: 20px;
  padding: 22px 0;
  cursor: pointer;
  transition: background .12s;
}
.btn:hover { background: #252560; }
.btn:active { background: #333380; }

.btn.fn { color: #a8b8c8; }
.btn.op { background: #e94560; color: #fff; }
.btn.op:hover { background: #ff5a75; }
.btn.op:active { background: #ff7090; }

.btn.wide { grid-column: span 2; }
