body {
  background: linear-gradient(to right, #d4fc79, #96e6a1);
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}

body.dark {
  background: #121212;
  color: #eee;
}

.calculator-card {
  background: white;
  padding: 30px;
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

body.dark .calculator-card {
  background: #1e1e1e;
  color: #eee;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.theme-toggle {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: inherit;
}

input[type="number"] {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.btn-group button {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(to right, #4facfe, #00f2fe);
  color: white;
  cursor: pointer;
}

.result {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
  min-height: 24px;
  color: #2a9d8f;
}

ul#historyList {
  list-style: none;
  padding-left: 0;
  margin-top: 10px;
  text-align: left;
}

ul#historyList li {
  background: #eee;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 5px;
  color: #333;
}

body.dark ul#historyList li {
  background: #2b2b2b;
  color: #ccc;
}

button {
  margin-top: 10px;
  padding: 12px;
  width: 100%;
  font-size: 15px;
  background: linear-gradient(to right, #00c9ff, #92fe9d);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

@media (max-width: 600px) {
  .btn-group {
    flex-direction: column;
  }

  .top-bar {
    flex-direction: column;
    gap: 10px;
  }
}
