body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f9f9f9;
  color: #333;
}

header, footer {
  background: #2c3e50;
  color: white;
  padding: 1rem;
  text-align: center;
}

main {
  padding: 2rem;
  max-width: 900px;
  margin: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

form label {
  display: block;
  margin: 1rem 0 0.5rem;
}

input {
  padding: 0.5rem;
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
}

button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #2980b9;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.device-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem auto;
  max-width: 100%;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.control-row button {
  padding: 0.75rem 1.25rem;
  background: #2980b9;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.device-controls input[type=number] {
  width: 80px;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.cycle-form {
  display: flex;
  justify-content: center;
}

.cycle-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cycle-group button {
  padding: 0.5rem 1.25rem;
  background: #8e44ad;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.cycle-group input[type=number] {
  width: 70px;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.voltage-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  margin: 2rem auto;
  max-width: 720px;
  justify-items: center;
}

.cell {
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 6px;
  padding: 0.5rem 0.25rem;
  width: 80px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.cell-label {
  font-size: 0.75rem;
  color: #777;
}

.cell-voltage {
  font-size: 1.1rem;
  font-weight: bold;
  color: #2c3e50;
}
