body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background: #f4f4f4;
  transition: background 0.3s, color 0.3s;
}

.calculator {
  width: 320px;
  background: #222;
  color: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

#modeToggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: inherit;
}

.display {
  width: 100%;
  height: 60px;
  background: #000;
  color: #0f0;
  font-size: 2rem;
  text-align: right;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

button {
  padding: 20px;
  font-size: 1.2rem;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background: #333;
  color: #fff;
  transition: 0.3s;
}

button:hover {
  background: #555;
}

.equal {
  grid-column: span 2;
  background: #007BFF;
}

.clear {
  background: #e74c3c;
}

.back {
  background: #f39c12;
}

body.light {
  background: #fff;
  color: #000;
}

body.light .calculator {
  background: #f9f9f9;
  color: #000;
}

body.light .display {
  background: #eee;
  color: #000;
}
