* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    padding: 20px;
    color: #333333;
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  h1 {
    margin-bottom: 20px;
    color: #333333;
    font-weight: normal;
  }
  
  .controls {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
  }
  
  .btn {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: 1px solid #dddddd;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
  }
  
  .btn:hover {
    background-color: #e0e0e0;
  }
  
  .btn-primary {
    background-color: #4a90e2;
    border-color: #4a90e2;
    color: white;
  }
  
  .btn-primary:hover {
    background-color: #3a80d2;
  }
  
  #connection-status {
    margin-left: auto;
    font-size: 14px;
    padding: 5px 10px;
    border: 1px solid #dddddd;
  }
  
  #connection-status.connected {
    border-color: #4a90e2;
    color: #4a90e2;
  }
  
  /* Main layout: ML controls on left, Serial on right ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  .main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
  }
  
  .serial-side {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  /* serial input ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  .serial-input {
    border: 1px solid #dddddd;
    border-radius: 3px;
  }
  
  .input-header {
    padding: 10px;
    border-bottom: 1px solid #dddddd;
    font-size: 14px;
    font-weight: normal;
  }
  
  .input-controls {
    padding: 10px;
  }
  
  .input-controls textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #dddddd;
    border-radius: 3px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 10px;
  }
  
  .input-controls textarea:focus {
    outline: none;
    border-color: #4a90e2;
  }
  
  .input-controls textarea:disabled {
    background-color: #f0f0f0;
    color: #999999;
    cursor: not-allowed;
  }
  
  .input-controls textarea::placeholder {
    color: #999999;
  }
  
  .input-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .input-buttons .btn:disabled {
    background-color: #f0f0f0;
    color: #999999;
    cursor: not-allowed;
    border-color: #dddddd;
  }
  
  .input-buttons .btn:disabled:hover {
    background-color: #f0f0f0;
  }
  
  .btn-secondary {
    background-color: #f0f0f0;
    border-color: #dddddd;
    color: #333333;
  }
  
  .btn-secondary:hover {
    background-color: #e0e0e0;
  }
  
  /* serial monitor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  .serial-monitor {
    border: 1px solid #dddddd;
    border-radius: 3px;
  }
  
  .monitor-header {
    padding: 10px;
    border-bottom: 1px solid #dddddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .monitor-controls {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .autoscroll-container {
    display: flex;
    align-items: center;
    font-size: 14px;
    gap: 5px;
    cursor: pointer;
  }
  
  .monitor-content {
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    margin: 0;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
  }
  
  .timestamp {
    color: #999999;
    margin-right: 8px;
  }
  
  .data-line {
    margin-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
  }
  
  /* Simple scrollbar ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  .monitor-content::-webkit-scrollbar {
    width: 6px;
  }
  
  .monitor-content::-webkit-scrollbar-thumb {
    background: #dddddd;
  }
  
  .monitor-content::-webkit-scrollbar-thumb:hover {
    background: #cccccc;
  }
  
  /* config and collection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  .ml-section {
    border: 1px solid #dddddd;
    border-radius: 3px;
    margin-bottom: 15px;
  }
  
  .ml-section h2 {
    padding: 10px;
    border-bottom: 1px solid #dddddd;
    font-size: 16px;
    font-weight: normal;
    margin: 0;
    background-color: #f9f9f9;
  }
  
  .config-row {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .config-row:last-child {
    border-bottom: none;
  }
  
  .config-row label {
    min-width: 120px;
    font-size: 14px;
    font-weight: normal;
  }
  
  .config-row input {
    flex: 1;
    padding: 8px;
    border: 1px solid #dddddd;
    border-radius: 3px;
    font-size: 14px;
  }
  
  .config-row input:focus {
    outline: none;
    border-color: #4a90e2;
  }
  
  .config-row input::placeholder {
    color: #999999;
  }
  
  .ml-section > .btn,
  .ml-section > .status-indicator {
    margin: 10px;
  }
  
  .ml-section > .btn:last-child {
    margin-right: 10px;
  }
  
  .status-indicator {
    font-size: 14px;
    padding: 5px 10px;
    border: 1px solid #dddddd;
    border-radius: 3px;
    display: inline-block;
  }
  
  .status-indicator.connected {
    border-color: #4a90e2;
    color: #4a90e2;
  }
  
  .status-indicator.disconnected {
    border-color: #dddddd;
    color: #999999;
  }
  
  /* Success and danger button variants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  .btn-success {
    background-color: #5cb85c;
    border-color: #5cb85c;
    color: white;
  }
  
  .btn-success:hover {
    background-color: #4cae4c;
  }
  
  .btn-success:disabled {
    background-color: #f0f0f0;
    color: #999999;
    border-color: #dddddd;
    cursor: not-allowed;
  }
  
  .btn-success:disabled:hover {
    background-color: #f0f0f0;
  }
  
  .btn-danger {
    background-color: #d9534f;
    border-color: #d9534f;
    color: white;
  }
  
  .btn-danger:hover {
    background-color: #c9302c;
  }
  
  .btn-danger:disabled {
    background-color: #f0f0f0;
    color: #999999;
    border-color: #dddddd;
    cursor: not-allowed;
  }
  
  .btn-danger:disabled:hover {
    background-color: #f0f0f0;
  }
  
  .ml-section .btn + .btn {
    margin-left: 0;
  }
  
  /* Responsive design ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  @media (max-width: 768px) {
    .main-layout {
      grid-template-columns: 1fr;
    }
    
    .input-buttons {
      flex-direction: column;
    }
    
    .input-buttons .btn {
      width: 100%;
    }
  }