body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #E8EBF0;
  color: #333;
}

header {
  background-color: #FFFFFF;
  padding: 15px;
  text-align: center;
  border-bottom: 2px solid #D1D5DA;
}

h1 {
  color: #005A9C;
  margin: 0;
  font-size: 1.8em;
}

main {
  display: flex;
  flex-wrap: wrap;
  padding: 20px;
  gap: 20px;
}

.control-panel, .chart-panel {
  background-color: #FFFFFF;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #D1D5DA;
}

.control-panel {
  flex: 1;
  min-width: 300px;
}

.chart-panel {
  flex: 2;
  min-width: 400px;
  min-height: 400px;
}

h2, h3, h4 {
  color: #005A9C;
  border-bottom: 1px solid #D1D5DA;
  padding-bottom: 5px;
  margin-top: 0;
}

ul {
  list-style: none;
  padding: 0;
}

.device-item {
  background-color: #F5F5F5;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid #D1D5DA;
  transition: background-color 0.2s;
}

.device-item.active {
  background-color: #005A9C;
  color: white;
  border-color: #005A9C;
}

.device-item:hover:not(.active) {
  background-color: #E0E7E9;
}

.control-group {
  margin-bottom: 20px;
}

.action-btn {
  padding: 10px 15px;
  border: 1px solid #D1D5DA;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

.connect-btn { background-color: #4CAF50; color: white; border-color: #4CAF50; }
.connect-btn:hover:not(:disabled) { background-color: #43a047; }
.disconnect-btn { background-color: #f44336; color: white; border-color: #f44336; }
.disconnect-btn:hover:not(:disabled) { background-color: #e53935; }
.start-btn { background-color: #005A9C; color: white; border-color: #005A9C; }
.start-btn:hover:not(:disabled) { background-color: #004d80; }
.stop-btn { background-color: #FFC107; color: black; border-color: #FFC107; }
.stop-btn:hover:not(:disabled) { background-color: #e0a800; }

.action-btn:disabled {
  background-color: #B0B0B0;
  cursor: not-allowed;
  border-color: #999;
  color: #555;
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  background: #D1D5DA;
  height: 8px;
  border-radius: 5px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #005A9C;
  border: 1px solid #fff;
  border-radius: 50%;
  cursor: pointer;
}

.message-area {
  background-color: #F5F5F5;
  border: 1px solid #D1D5DA;
  border-radius: 5px;
  padding: 10px;
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: monospace;
  color: #333;
}

.hidden {
  display: none;
}