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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6fa;
  color: #333;
  padding: 16px;
}

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

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

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

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

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8ecf0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 0.78rem;
  color: #666;
  font-weight: 500;
}

input[type="text"],
input[type="number"] {
  padding: 8px 10px;
  border: 1px solid #dde2e8;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #333;
  background: #fafbfc;
  transition: border-color 0.15s;
}

input:focus {
  outline: none;
  border-color: #4a90d9;
  background: #fff;
}

.btn-primary {
  display: inline-block;
  padding: 10px 22px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #357abd;
}

.current-result {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f0f5ff;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #2c3e50;
  display: none;
}

.current-result.active {
  display: block;
}

.current-result span {
  font-weight: 600;
  color: #4a90d9;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead th {
  background: #f0f5ff;
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid #eef0f3;
}

tbody tr:hover {
  background: #fafbfd;
}

tbody td {
  padding: 9px 10px;
  white-space: nowrap;
}

.row-current {
  background: #f0f5ff !important;
  font-weight: 600;
}

.cost-down {
  color: #27ae60;
  font-weight: 600;
}

.cost-up {
  color: #e74c3c;
  font-weight: 600;
}

.cost-same {
  color: #888;
}

.btn-del {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 0.78rem;
  color: #999;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-del:hover {
  background: #ffe8e8;
  border-color: #e74c3c;
  color: #e74c3c;
}

/* Responsive */
@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 1.2rem;
  }
}

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