body {
  background: linear-gradient(to right, #fddb92, #d1fdff);
  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;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

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: 22px;
  cursor: pointer;
  color: inherit;
}

input[type="number"] {
  padding: 12px;
  margin-top: 20px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  width: 100%;
  box-sizing: border-box;
}

.action-btn {
  margin-top: 15px;
  padding: 12px;
  width: 100%;
  font-size: 16px;
  background: linear-gradient(to right, #36d1dc, #5b86e5);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.result {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
  color: #2a9d8f;
  min-height: 24px;
}

.extras {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.extras button {
  padding: 10px;
  width: 48%;
  font-size: 14px;
  background: linear-gradient(to right, #00c6ff, #0072ff);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

ul#historyList {
  list-style: none;
  padding-left: 0;
  margin-top: 10px;
  text-align: left;
  max-height: 150px;
  overflow-y: auto;
}

ul#historyList li {
  background: #eee;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 5px;
  color: #333;
}

body.dark ul#historyList li {
  background: #2b2b2b;
  color: #ccc;
}

@media (max-width: 600px) {
  .top-bar {
    flex-direction: column;
    gap: 10px;
  }
  .extras button {
    width: 100%;
  }
}
