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

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

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

h1 {
  font-size: 1.3rem;
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #34495e;
  border-left: 4px solid #3498db;
  padding-left: 8px;
}

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

.input-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.input-row label {
  font-size: 0.85rem;
  color: #666;
}

.input-row input[type="text"],
.input-row input[type="number"] {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

input[type="range"] {
  width: 100%;
  margin-top: 6px;
}

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

.btn-primary:hover {
  background: #2980b9;
}

.btn-danger {
  display: block;
  width: 100%;
  padding: 12px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 8px;
  margin-bottom: 24px;
}

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

/* 固定費一覧 */
.item-list {
  margin-bottom: 12px;
}

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

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

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

.item-info {
  flex: 1;
}

.item-name {
  font-size: 0.95rem;
  font-weight: bold;
}

.item-amount {
  font-size: 0.85rem;
  color: #555;
}

.badge-reducible {
  font-size: 0.7rem;
  background: #e8f6fd;
  color: #2980b9;
  border: 1px solid #aed6ef;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.btn-delete {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* サマリー */
.summary {
  border-top: 2px solid #f0f0f0;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.summary-row span:last-child {
  font-weight: bold;
}

.summary-row.reducible span:last-child {
  color: #2980b9;
}

.summary-row.profit span:last-child {
  color: #27ae60;
}

.summary-row.profit-rate span:last-child {
  color: #27ae60;
}

/* シミュレーション結果 */
.result-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.highlight {
  color: #e67e22;
  font-size: 1.1rem;
}

.highlight-green {
  color: #27ae60;
  font-size: 1.1rem;
}

@media (max-width: 400px) {
  body {
    padding: 10px;
  }
  h1 {
    font-size: 1.1rem;
  }
}
