* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f5;
  color: #1a1a1a;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

h2 {
  font-size: 1rem;
  color: #2e7d32;
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 12px;
}

label {
  display: block;
  font-size: 0.85rem;
  color: #444;
  margin-bottom: 4px;
  font-weight: 500;
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  appearance: textfield;
}

input[type="number"]:focus {
  border-color: #2e7d32;
}

button#calcBtn {
  width: 100%;
  padding: 12px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}

button#calcBtn:hover {
  background: #1b5e20;
}

.result-card {
  border-left: 4px solid #2e7d32;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.result-row:last-of-type {
  border-bottom: none;
}

.result-label {
  font-size: 0.9rem;
  color: #555;
}

.result-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2e7d32;
}

.result-note {
  font-size: 0.78rem;
  color: #888;
  margin-top: 8px;
  margin-bottom: 10px;
}

.save-btn {
  width: 100%;
  padding: 9px;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1.5px solid #a5d6a7;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.save-btn:hover {
  background: #c8e6c9;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.clear-btn {
  background: none;
  border: none;
  color: #e53935;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 2px 6px;
}

.clear-btn:hover {
  text-decoration: underline;
}

#historyList {
  list-style: none;
  padding: 0;
}

#historyList li {
  font-size: 0.82rem;
  color: #444;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.5;
}

#historyList li:last-child {
  border-bottom: none;
}

.empty-msg {
  color: #aaa !important;
  text-align: center;
  padding: 12px 0 !important;
}

.error-msg {
  background: #fff3e0;
  color: #e65100;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.88rem;
  margin-top: 8px;
}
