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

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

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
  margin-bottom: 6px;
}

.subtitle {
  text-align: center;
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .input-grid {
    grid-template-columns: 1fr;
  }
}

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

.card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eee;
}

.domestic h2 { border-color: #4caf50; color: #2e7d32; }
.import h2 { border-color: #2196f3; color: #1565c0; }

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 4px;
  font-weight: 500;
}

.field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.field input:focus {
  outline: none;
  border-color: #2e86ab;
}

.calc-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: #2e86ab;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 24px;
}

.calc-btn:hover {
  background: #1a6e8f;
}

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

.result h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #333;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}

.result-card {
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.domestic-result {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}

.import-result {
  background: #e3f2fd;
  border: 1px solid #90caf9;
}

.result-label {
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 4px;
  font-weight: 600;
}

.result-total {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

.result-unit-cost {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
}

.verdict {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.verdict.domestic {
  background: #e8f5e9;
  color: #2e7d32;
}

.verdict.import {
  background: #e3f2fd;
  color: #1565c0;
}

.verdict.tie {
  background: #fff8e1;
  color: #f57f17;
}

.diff-info {
  text-align: center;
  font-size: 0.875rem;
  color: #666;
}

.hidden {
  display: none;
}

.history-section {
  background: #fff;
  border-radius: 12px;
  padding: 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: 14px;
}

.history-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

.clear-btn {
  padding: 6px 12px;
  background: #fee;
  color: #c62828;
  border: 1px solid #ef9a9a;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.clear-btn:hover {
  background: #ffcdd2;
}

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

.history-item {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.history-item .hist-date {
  color: #999;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.history-item .hist-verdict {
  font-weight: 700;
  margin-bottom: 4px;
}

.history-item .hist-detail {
  color: #555;
}
