body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  margin: 30px auto;
  max-width: 900px;
  background-color: #f8f9fb;
  color: #333;
  line-height: 1.6;
}

h1, h2 {
  color: #1a4d80;
  border-bottom: 2px solid #e0e6ee;
  padding-bottom: 6px;
}

table {
  border-collapse: collapse;
  margin-bottom: 25px;
  width: 100%;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

td, th {
  border: 1px solid #ddd;
  padding: 10px 12px;
  text-align: left;
}

tr:nth-child(even) {
  background-color: #f4f7fb;
}

input, select {
  font-size: 14px;
  padding: 6px 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background-color: #fff;
}

input:focus, select:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 3px rgba(26, 115, 232, 0.4);
  outline: none;
}

input.byte-field {
  width: 50px;
  text-align: center;
}

button {
  background-color: #1a73e8;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover {
  background-color: #155fc1;
}

button:active {
  transform: scale(0.97);
}

.button-selector-row {
  display: flex;
  gap: 10px;
}

.button-radio {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.button-radio input[type="radio"] {
  display: none; /* hide actual input */
}
.button-radio input[type="radio"]:disabled + .button-radio-label {
  background: #e0e0e0;
  color: #888;
  border-color: #ccc;
  cursor: not-allowed;
}

.button-radio-label {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #999;
  background: #f5f5f5;
  font-size: 14px;
  transition: all 0.2s ease;
}

.configtable tr td {
  border-right: 0;
}

/* Hover effect */
.button-radio:hover .button-radio-label {
  background: #e7e7e7;
}

/* Checked (selected) style */
.button-radio input[type="radio"]:checked + .button-radio-label {
  background: #0078d4;
  color: white;
  border-color: #0078d4;
}

#outputFields {
  margin-top: 15px;
  padding: 15px;
  background-color: #fefefe;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
}

label {
  margin-right: 10px;
  font-weight: 500;
}

input[type="checkbox"] {
  margin-right: 4px;
}

td:first-child {
  width: 25%;
  font-weight: 600;
  color: #333;
}

#helpLink {
  position: fixed;
  bottom: 15px;
  right: 20px;
  font-size: 16px;
  background: #f0f0f0;
  padding: 6px 10px;
  border-radius: 20px;
  text-decoration: none;
  color: #333;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: background 0.2s;
}

#helpLink:hover {
  background: #e6e6e6;
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
  body {
    margin: 15px;
  }

  table {
    font-size: 14px;
  }

  td, th {
    padding: 8px;
  }

  /* Stack labels and inputs vertically in table cells */
  td > label {
    display: block;
    margin-bottom: 6px;
  }

  input, select {
    width: 100%;
    box-sizing: border-box;
  }

  #outputFields {
    padding: 12px;
  }

  button {
    width: 100%;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  h1, h2 {
    font-size: 1.2em;
  }

  table {
    font-size: 13px;
  }

  td:first-child {
    width: 100%;
    display: block;
    font-weight: bold;
    margin-top: 10px;
  }

  tr {
    display: block;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
  }

  td {
    display: block;
    border: none;
    padding: 6px 0;
  }

  input.byte-field {
    width: 100%;
  }
}