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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

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

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

.subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 20px;
}

h2 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 12px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 6px;
}

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

.settings-card {
  background: #f0faf5;
  border: 1px solid #c3e6d4;
}

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.form-row label {
  flex: 0 0 140px;
  font-size: 0.9rem;
  color: #555;
}

.form-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-row input:focus {
  border-color: #2c7a5a;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #2c7a5a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #235f46;
}

.btn-secondary {
  width: 100%;
  padding: 10px;
  background: #fff;
  color: #2c7a5a;
  border: 2px solid #2c7a5a;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: #2c7a5a;
  color: #fff;
}

.btn-danger {
  width: 100%;
  padding: 8px;
  background: #fff;
  color: #c0392b;
  border: 1px solid #c0392b;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s, color 0.2s;
}

.btn-danger:hover {
  background: #c0392b;
  color: #fff;
}

/* 結果 */
.result-card {
  background: #fffef0;
  border: 1px solid #e8e0a0;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed #eee;
}

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

.result-label {
  color: #666;
}

.result-value {
  font-weight: bold;
  color: #333;
}

.result-item.subtotal {
  background: #f9f9e8;
  padding: 6px 8px;
  border-radius: 4px;
  border-bottom: 1px solid #ddd;
}

.result-item.total {
  padding: 8px 0;
}

.result-value.price {
  font-size: 1.4rem;
  color: #2c7a5a;
}

/* 履歴 */
.history-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border-left: 4px solid #2c7a5a;
  position: relative;
}

.history-item .h-name {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.history-item .h-price {
  font-size: 1.2rem;
  color: #2c7a5a;
  font-weight: bold;
}

.history-item .h-detail {
  font-size: 0.78rem;
  color: #888;
  margin-top: 4px;
}

.history-item .h-date {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 2px;
}

.history-item .del-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1rem;
}

.history-item .del-btn:hover {
  color: #c0392b;
}

.empty-msg {
  color: #aaa;
  font-size: 0.9rem;
  text-align: center;
  padding: 12px 0;
}

@media (max-width: 400px) {
  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .form-row label {
    flex: none;
  }
  .form-row input {
    width: 100%;
  }
}
