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

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

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

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

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

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

.card h2 {
  font-size: 1rem;
  color: #1a6fc4;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8f0fb;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: #555;
  margin-bottom: 4px;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccd7e8;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #333;
  background: #fafcff;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #1a6fc4;
  background: #fff;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-row .flex1 {
  flex: 1;
}

.align-bottom {
  display: flex;
  align-items: flex-end;
  margin-bottom: 12px;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #1a6fc4;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #155ca8;
}

.btn-secondary {
  padding: 10px 18px;
  background: #e8f0fb;
  color: #1a6fc4;
  border: 2px solid #1a6fc4;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: #1a6fc4;
  color: #fff;
}

.total-info {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #f0f4f8;
  border-radius: 6px;
}

.device-list {
  list-style: none;
}

.device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: #f8faff;
  border: 1px solid #e8f0fb;
}

.device-item.priority-high {
  border-left: 4px solid #e74c3c;
}

.device-item.priority-mid {
  border-left: 4px solid #f39c12;
}

.device-item.priority-low {
  border-left: 4px solid #2ecc71;
}

.device-item.highlight {
  background: #fff3cd;
  border-left: 4px solid #f39c12;
  border-color: #f39c12;
}

.device-info {
  flex: 1;
}

.device-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #222;
}

.device-meta {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

.device-watt {
  font-size: 1rem;
  font-weight: 700;
  color: #1a6fc4;
  margin: 0 12px;
  white-space: nowrap;
}

.btn-delete {
  background: none;
  border: 1px solid #ddd;
  color: #999;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

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

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

.result-summary {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.result-summary.success {
  background: #d4edda;
  color: #155724;
}

.result-summary.warn {
  background: #fff3cd;
  color: #856404;
}

.result-summary.fail {
  background: #f8d7da;
  color: #721c24;
}

@media (max-width: 500px) {
  h1 {
    font-size: 1.3rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .align-bottom {
    align-items: stretch;
  }

  .btn-secondary {
    width: 100%;
    padding: 10px;
  }
}
