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

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

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

h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
  color: #c0392b;
}

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

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

h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #444;
}

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

.form-row label {
  font-size: 0.9rem;
  width: 120px;
  flex-shrink: 0;
}

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

/* プリセット */
.preset-area {
  margin-bottom: 10px;
}

.preset-label {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 6px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-btn {
  background: #fef9ec;
  border: 1px solid #e67e22;
  color: #e67e22;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}

.preset-btn:hover {
  background: #e67e22;
  color: #fff;
}

/* 家電追加フォーム */
.appliance-form {
  display: grid;
  grid-template-columns: 1fr 80px 60px auto;
  gap: 6px;
  align-items: center;
}

.appliance-form input {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100%;
}

.appliance-form button {
  background: #e67e22;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.appliance-form button:hover {
  background: #ca6f1e;
}

/* 家電リスト */
.empty-msg {
  color: #aaa;
  font-size: 0.9rem;
  text-align: center;
  padding: 10px 0;
}

.appliance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

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

.app-name {
  flex: 1;
  font-weight: 500;
}

.app-detail {
  color: #666;
  margin: 0 10px;
  white-space: nowrap;
}

.app-watt-total {
  font-weight: bold;
  color: #e67e22;
  margin-right: 10px;
  white-space: nowrap;
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 1rem;
  padding: 0 4px;
}

.delete-btn:hover {
  color: #e74c3c;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 2px solid #e67e22;
  font-weight: bold;
}

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

/* 結果 */
.result-card {
  background: #fff8f3;
  border: 2px solid #e67e22;
}

.result-grid {
  display: grid;
  gap: 10px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #fde8d0;
}

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

.result-label {
  font-size: 0.9rem;
  color: #666;
}

.result-value {
  font-size: 1.4rem;
  font-weight: bold;
  color: #c0392b;
}

.result-unit {
  font-size: 0.85rem;
  color: #888;
  margin-left: 4px;
}

.result-note {
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 8px;
}

/* リセットボタン */
.clear-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
  margin-top: 4px;
}

.clear-btn:hover {
  background: #ffe5e5;
  border-color: #e74c3c;
  color: #e74c3c;
}

/* スマホ対応 */
@media (max-width: 480px) {
  .appliance-form {
    grid-template-columns: 1fr 70px 54px auto;
  }

  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row label {
    width: auto;
  }

  .form-row input {
    width: 100%;
  }
}
