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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f4f8;
  color: #333;
  min-height: 100vh;
  padding: 20px 16px 40px;
}

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

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1565C0;
  text-align: center;
  margin-bottom: 4px;
}

.subtitle {
  text-align: center;
  color: #777;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

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

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

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

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

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

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

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

button#calcBtn:hover {
  background: #1976D2;
}

button#calcBtn:active {
  background: #1565C0;
}

.result-card {
  background: linear-gradient(135deg, #1565C0, #2196F3);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(33,150,243,0.3);
}

.result-label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 8px;
}

.result-cost {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.result-detail {
  font-size: 0.8rem;
  opacity: 0.8;
  line-height: 1.6;
}

.history-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.history-header h2 {
  font-size: 1rem;
  color: #444;
}

.clear-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #999;
  font-size: 0.78rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-btn:hover {
  border-color: #e53935;
  color: #e53935;
}

.history-list {
  list-style: none;
}

.history-item {
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.history-item:last-child {
  border-bottom: none;
}

.history-info {
  font-size: 0.8rem;
  color: #777;
  line-height: 1.5;
}

.history-cost {
  font-size: 1rem;
  font-weight: 700;
  color: #1565C0;
  white-space: nowrap;
}

@media (max-width: 375px) {
  h1 {
    font-size: 1.4rem;
  }
  .result-cost {
    font-size: 2rem;
  }
}
