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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  min-height: 100vh;
  padding: 16px;
}

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

h1 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e40af;
  margin-top: 24px;
  line-height: 1.3;
}

.subtitle {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 6px;
  margin-bottom: 24px;
}

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

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

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

.repair-card {
  border-top-color: #3b82f6;
}

.replace-card {
  border-top-color: #10b981;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: #334155;
}

.field {
  margin-bottom: 12px;
}

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

.field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color 0.15s;
}

.field input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}

.btn-calc {
  display: block;
  width: 100%;
  padding: 14px;
  background: #2563eb;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 20px;
}

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

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

.result-inner {
  padding: 20px;
}

.verdict {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.verdict.repair {
  background: #dbeafe;
  color: #1d4ed8;
}

.verdict.replace {
  background: #d1fae5;
  color: #065f46;
}

.verdict.tie {
  background: #fef3c7;
  color: #92400e;
}

.cost-compare {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.cost-item {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.85rem;
}

.cost-item strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 4px;
}

.cost-item.repair-cost strong { color: #2563eb; }
.cost-item.replace-cost strong { color: #059669; }

.cost-divider {
  font-weight: 700;
  color: #94a3b8;
  font-size: 1rem;
  flex-shrink: 0;
}

.diff {
  text-align: center;
  font-size: 0.9rem;
  color: #475569;
  background: #f1f5f9;
  padding: 10px;
  border-radius: 8px;
}

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

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

.history-header h3 {
  font-size: 0.95rem;
  color: #334155;
}

.btn-clear {
  font-size: 0.8rem;
  color: #ef4444;
  background: none;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s;
}

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

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #475569;
  border-left: 4px solid #cbd5e1;
}

.history-item.h-repair { border-left-color: #3b82f6; }
.history-item.h-replace { border-left-color: #10b981; }
.history-item.h-tie { border-left-color: #f59e0b; }

.history-item .h-verdict {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.history-item .h-detail {
  color: #94a3b8;
}
