* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1a1a1a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.calc {
  width: 320px;
  background: #2a2a2a;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.display {
  background: #1a1a1a;
  color: #fff;
  font-size: 42px;
  text-align: right;
  padding: 16px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  min-height: 70px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.history {
  color: #888;
  font-size: 13px;
  text-align: right;
  padding: 0 12px;
  min-height: 18px;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.btn {
  border: none;
  font-size: 22px;
  padding: 18px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.1s;
  font-weight: 500;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { filter: brightness(0.9); }
.btn.num {
  background: #444;
  color: #fff;
}
.btn.op {
  background: #666;
  color: #fff;
}
.btn.op.clear, .btn.op.back, .btn.op.pct {
  background: #777;
}
.btn.equals {
  background: #f5a623;
  color: #fff;
}
.btn.zero {
  grid-column: span 1;
}
