:root {
  --bg-color: #fff;
  --text-color: #000;
  --btn-bg: #f1f1f1;
  --btn-color: #333;
  --accent: #2f9fff;
}

body.dark {
  --bg-color: #1e1e1e;
  --text-color: #fff;
  --btn-bg: #333;
  --btn-color: #fff;
  --accent: #4dabf7;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Poppins", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  transition: all 0.3s ease;
}

.container {
  max-width: 320px;
  width: 100%;
  padding: 20px;
  border-radius: 15px;
  background: var(--bg-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.display {
  width: 100%;
  font-size: 2rem;
  text-align: right;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-color);
  margin-bottom: 15px;
}

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

button {
  padding: 15px;
  font-size: 1.2rem;
  background-color: var(--btn-bg);
  color: var(--btn-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background-color: var(--accent);
  color: #fff;
}

.operator {
  color: var(--accent);
}

.theme-toggle {
  text-align: right;
  margin-bottom: 10px;
}

.history {
  margin-top: 20px;
  background-color: var(--btn-bg);
  padding: 10px;
  border-radius: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.history h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.history ul {
  list-style: none;
  padding-left: 0;
}

.history li {
  padding: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.history li:hover {
  background-color: var(--accent);
  color: white;
}