﻿html {
  width: 100%;
  height: 100%;
  margin: 0px;
}

* {
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

body {
  width: 100%;
  height: 100%;
  margin: 0px;
}

.header {
  display: block;
  opacity: 1;
  grid-area: header;
  background-color: #ffd800;
  border: solid 1px green;
}

[tabindex="-1"]:focus {
  outline: none !important;
}

.text-instructions {
  font-size: 0.8rem;
  font-style: italic;
}

a.btn.disabled,
fieldset[disabled] a.btn {
  pointer-events: none;
}

div.picValueSpinner.disabled > div {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-panel {
  padding: 0.2rem;
  margin-top: 0.2rem;
}

.btn {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  cursor: pointer;
}

.btn > * {
  cursor: pointer;
}

.btn-stateonly {
  pointer-events: none;
  cursor: no-drop;
}

.btnarray {
  display: inline-block;
}

.btnarray > div {
  display: inline-block;
}

.btn-toggle {
  cursor: pointer;
}

div.dashContainer,
div.configContainer {
  position: relative;
}

div.mmgrOuter {
  width: 98%;
  max-width: 98%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 5px;
  gap: 0px;
}

div.messageContainer {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
}

/* Send Queue is now its own view page (not a top container) */

div.messagesContentContainer {
  width: 100%;
  max-width: 100%;
  flex: 1;
}

div.messagesContentContainer > div.picMessages {
  width: 100% !important;
  max-width: 100% !important;
}

@media screen and (max-width: 1277px) {
  div.messageContainer {
    flex-direction: column;
  }
}
@media screen and (max-width: 1048px) {
  div.messageContainer {
    flex-direction: column;
  }
}
@media screen and (max-width: 1024px) {
  div.messageContainer {
    flex-direction: column;
  }
}
.header {
  display: block;
  opacity: 1;
  grid-area: header;
  background-color: #ffd800;
  border: solid 1px green;
}

span.picPercentData {
  padding-left: 2px;
  padding-right: 2px;
}

table.msgList-container {
  width: 100%;
  height: 100%;
  position: relative;
  table-layout: auto;
  border-collapse: collapse;
  border-spacing: 0px;
  box-sizing: border-box;
}

table.msgList-container > tbody > tr > td {
  padding: 0px;
}

tr.msgList-body {
  height: 100%;
}

td.msgList-body {
  height: 100%;
  width: 100%;
  vertical-align: top;
  overflow: hidden;
  position: relative;
}

/* Empty state placeholder */
div.msgList-empty-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #999;
  display: block;
  z-index: 10;
  pointer-events: none;
}

div.msgList-empty-placeholder div.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: #ccc;
}

div.msgList-empty-placeholder div.empty-message {
  font-size: 1rem;
  margin: 0.5rem 0;
  color: #666;
}

/* Message Row Column Widths and Alignment */
tr.msgRow > td:nth-child(1) {
  width: 30px;
  min-width: 20px;
  max-width: 20px;
  text-align: center;
  padding: 2px;
}

tr.msgRow > td:nth-child(2) {
  min-width: 20px;
  text-align: center;
  padding: 2px;
}

tr.msgRow > td:nth-child(3) {
  min-width: 40px;
  text-align: center;
  padding: 2px;
}

tr.msgRow > td:nth-child(4) {
  min-width: 20px;
  text-align: center;
  padding: 2px;
}

tr.msgRow > td:nth-child(5) {
  min-width: 20px;
  text-align: center;
  padding: 2px;
}

tr.msgRow > td:nth-child(6) {
  min-width: 60px;
  padding: 2px;
}

tr.msgRow > td:nth-child(7) {
  min-width: 60px;
  padding: 2px;
}

tr.msgRow > td:nth-child(8) {
  min-width: 60px;
  padding: 2px;
}

tr.msgRow > td:nth-child(9) {
  min-width: 30px;
  padding: 2px;
}

tr.msgRow > td:nth-child(10) {
  /* Payload column - flexible, takes remaining space */
  min-width: 200px;
  padding: 2px;
  text-align: left;
}

tr.msgRow > td:nth-child(n+6) > span {
  overflow: visible;
  white-space: nowrap;
  display: inline-block;
}

tr.msgRow > td:nth-child(10) > span {
  /* Payload content */
  overflow: visible;
  white-space: nowrap;
  display: inline-block;
  text-align: left;
}

tr.msgRow > td:nth-child(n+6) > span {
  overflow: visible;
  white-space: nowrap;
  display: inline-block;
}

tr.msgRow > td:nth-child(10) > span {
  /* Payload content */
  overflow: visible;
  white-space: nowrap;
  display: inline-block;
  text-align: left;
}

/* Message List Header Alignment - match column widths */
tr.vlist-header > td.vlist-header-col:nth-child(1) {
  width: 4px;
  padding: 8px;
  box-sizing: border-box;
  overflow: visible;
}

tr.vlist-header > td.vlist-header-col:nth-child(2) {
  width: 10px;
  padding-left: 4px;
}

tr.vlist-header > td.vlist-header-col:nth-child(3) {
  width: 38px;
  padding-left: 16px;
}

tr.vlist-header > td.vlist-header-col:nth-child(4) {
  width: 20px;
  padding-left: 4px;
}

tr.vlist-header > td.vlist-header-col:nth-child(5) {
  width: 20px;
  padding-left: 2px;
}

tr.vlist-header > td.vlist-header-col:nth-child(6) {
  width: 55px;
  padding-left: 9px;
}

tr.vlist-header > td.vlist-header-col:nth-child(7) {
  width: 64px;
  padding-left: 8px;
}

tr.vlist-header > td.vlist-header-col:nth-child(8) {
  width: 58px;
  padding-left: 10px;
}

tr.vlist-header > td.vlist-header-col:nth-child(9) {
  width: 24px;
  padding-left: 0px;
}

tr.vlist-header > td.vlist-header-col:nth-child(10) {
  padding-left: 30px;
}

tr.msgRow.changed > td:nth-child(4) > span.changed {
  color: #6495ed;
}

tr.msgRow > td:nth-child(4) > span.changed.new {
  color: mediumvioletred;
}

tr.msgApiRow > td:nth-child(1),
tr.msgApiRow > td:nth-child(3),
tr.msgApiRow > td:nth-child(4) {
  text-align: center;
}

tr.msgApiRow > td:nth-child(5) > span {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: normal;
  display: inline-block;
  width: 214px;
  padding-left: 2px;
  padding-right: 2px;
}

/* tr.msgRow > td:nth-child(8) {
  text-align: center;
}

tr.msgRow > td:nth-child(8) > span {
  max-width: 37px;
} */

tr.msgApiRow > td:last-child > span {
  display: inline-block;
  padding-left: 2px;
  padding-right: 2px;
  max-width: 427px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* @media screen and (max-width: 1277px) {
  tr.msgRow > td:last-child > span {
    width: 247px;
  }
} */
@media screen and (max-width: 1048px) {
  tr.msgRow > td:last-child > span {
    width: 224px;
  }
}
@media screen and (max-width: 1024px) {
  tr.msgRow > td:last-child > span {
    width: 372px;
  }
}
tr.msgRow:nth-child(2n+1) {
  background-color: aliceblue;
}

div.mmgrButton {
  display: inline-block;
  cursor: pointer;
  margin-left: 0.5rem;
}

div.mmgrButton.selected {
  color: deeppink;
}

div.queued-message.selected {
  color: black;
  background: -webkit-linear-gradient(-90deg, white 0%, #AEBF76 65%);
  background: linear-gradient(180deg, white 0%, #AEBF76 65%);
}

div.mmgrButton:hover {
  color: orange;
  text-shadow: 3px 3px 16px #272634;
}

div.picMessages.changesOnly tr.msgRow.nochange {
  display: none;
}

tr.msgApiRow.selected,
tr.msgRow.selected {
  color: black;
  background: -webkit-linear-gradient(-90deg, white 0%, #AEBF76 65%);
  background: linear-gradient(180deg, white 0%, #AEBF76 65%);
}

tr.msgApiRow:hover,
tr.msgRow:hover {
  color: white;
  filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#FF159FCF, EndColorStr=#FF13647F);
  background: -ms-linear-gradient(top, #159FCF, #13647F);
  background: -moz-linear-gradient(top, #159FCF, #13647F);
  background: -webkit-linear-gradient(top, #159FCF, #13647F);
  background: linear-gradient(to bottom, #159FCF, #13647F);
}

tr.msgRow > td > span {
  padding-left: 2px;
  padding-right: 2px;
}

tr.msgRow.invalid {
  background-color: tomato;
  color: yellow;
}

tr.msgRow[data-msgdir=out] i.fa-arrow-circle-left {
  color: deeppink;
}

tr.msgRow[data-msgdir=in] i.fa-arrow-circle-right {
  color: gray;
}

span.msg-detail-byte {
  color: salmon;
  font-weight: bold;
}

i.msg-detail-fromto {
  padding-left: 3px;
  padding-right: 3px;
}

div.msg-detail-section {
  display: inline-block;
  vertical-align: top;
}

div.msg-detail-section.bytearrays {
  padding-left: 10px;
}

span.msg-detail-bytearray {
  display: inline-block;
  white-space: nowrap;
  max-width: 167px;
  text-overflow: ellipsis;
  overflow: hidden;
}

span.msg-detail-bytearray::before {
  content: "[";
}

span.msg-detail-bytearray::after {
  content: "]";
}

div.msg-detail-section.bytearrays > div.dataline > label {
  display: inline-block;
  width: 57px;
  font-weight: bold;
}

div.msg-detail-section.apiDetails > div.dataline > label,
div.queue-detail-panel > div.dataline > label,
div.msg-detail-section.details > div.dataline > label {
  display: inline-block;
  width: 70px;
  font-weight: bold;
}

div.callbody-value-outer {
  font-size: 10pt;
  padding-left: 10px;
}

label.callbody-name {
  color: mediumpurple;
  padding-right: 4px;
}

span.callbody-value {
  color: blue;
}

span.callbody-value[data-type$=string] {
  color: tomato;
}

span.callbody-value[data-type$=null] {
  color: darkgray;
  font-style: italic;
}

div.msg-invalid-banner {
  border: solid 1px gray;
  border-radius: 5px;
  padding: 4px;
  text-align: center;
  display: inline-block;
  box-shadow: 3px 3px 3px rgba(127, 127, 127, 0.5);
  -webkit-box-shadow: 3px 3px 3px rgba(127, 127, 127, 0.5);
  -moz-box-shadow: 3px 3px 3px rgba(127, 127, 127, 0.5);
  background-color: tomato;
  color: yellow;
}

div.picMessageDetail:not(.invalid) div.msg-invalid-banner {
  display: none;
}

div.dataline {
  font-size: 8pt;
}

table.msg-payload {
  border-collapse: collapse;
  border-spacing: 0px;
  font-size: 8pt;
}

tr.msg-payload-header {
  color: white;
  filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#FF159FCF, EndColorStr=#FF13647F);
  background: -ms-linear-gradient(top, #159FCF, #13647F);
  background: -moz-linear-gradient(top, #159FCF, #13647F);
  background: -webkit-linear-gradient(top, #159FCF, #13647F);
  background: linear-gradient(top, #159FCF, #13647F);
}

td.payload-byte {
  cursor: pointer;
}

td.payload-byte.payload-change {
  color: yellow;
  background-color: cornflowerblue;
  cursor: pointer;
}

tr.msg-payload-header > td {
  border: solid 1px white;
  padding: 1px;
  text-align: center;
}

tr.msg-payload-decimal > td, tr.msg-payload-ascii > td, tr.msg-payload-hex > td {
  border: solid 1px gainsboro;
  padding: 0px;
  text-align: center;
  min-width: 21px;
  max-width: 21px;
  overflow: hidden;
  box-sizing: border-box;
}

div.msg-payload-bytediff {
  position: absolute;
  box-sizing: border-box;
  font-size: 8pt;
  box-shadow: 3px 3px 3px rgba(127, 127, 127, 0.5);
  -webkit-box-shadow: 3px 3px 3px rgba(127, 127, 127, 0.5);
  -moz-box-shadow: 3px 3px 3px rgba(127, 127, 127, 0.5);
  color: black;
  background-color: white;
  border: solid 1px gray;
  border-radius: 5px;
}

table.msg-payload-bytediff {
  border-radius: 5px;
  border-collapse: collapse;
}

tr.bytediff-header > td.bytediff-binary {
  border-top-right-radius: 5px;
}

tr.bytediff-header > td.bytediff-dec,
tr.bytediff-header > td.bytediff-ascii,
tr.bytediff-header > td.bytediff-hex {
  width: 1.7rem;
}

tr.bytediff-header > td,
tr.bytediff-curr > td,
tr.bytediff-prev > td {
  border: solid 1px gray;
  padding-left: 1px;
  padding-right: 1px;
}

tr.msg-payload-header > td.selected,
tr.bytediff-header > td {
  background: #fde4be;
  background: -webkit-linear-gradient(-90deg, #fde4be 0%, #E78F08 65%);
  background: linear-gradient(180deg, #fde4be 0%, #E78F08 65%);
  color: black;
  font-weight: bold;
}

tr.bytediff-header > td.bytediff-name {
  border: none;
  background: none;
  font-size: 10pt;
  font-weight: bold;
  text-align: center;
  color: darkorange;
}

table.queue-list-header {
  box-sizing: border-box;
  font-size: 8pt;
  color: white;
  font-weight: bold;
  width: 100%;
  table-layout: auto;
  border-spacing: 0px;
  border-collapse: collapse;
  filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#FF159FCF, EndColorStr=#FF13647F);
  background-image: -ms-linear-gradient(top, #159FCF, #13647F);
  background-image: -moz-linear-gradient(top, #159FCF, #13647F);
  background-image: -webkit-linear-gradient(top, #159FCF, #13647F);
  background-image: linear-gradient(to bottom, #159FCF, #13647F);
}

table.queue-list-header > tbody > tr > td:nth-child(6),
table.queue-list-header > tbody > tr > td:nth-child(1) {
  width: 14px;
}

table.queue-list-header > tbody > tr > td:nth-child(2) {
  width: 47px;
}

table.queue-list-header > tbody > tr > td:nth-child(3) {
  text-align: center;
  width: 57px;
}

table.queue-list-header > tbody > tr > td:nth-child(4) {
  text-align: center;
  width: 47px;
}

table.queue-list-header > tbody > tr > td:nth-child(5) {
  text-align: center;
}

table.queue-list-header > tbody > tr > td:nth-child(6) {
  width: 70px;
  text-align: center;
}

div.queue-send-list {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}

div.queued-message {
  width: 100%;
  font-size: 8pt;
  white-space: nowrap;
  line-height: 12px;
}

div.picSendMessageQueue.processing > div.picMessageListTitle > div.mmgrButton {
  display: none;
}

div.picSendMessageQueue.processing div.picActionButton:not(.cancel-button) {
  display: none;
}

div.picSendMessageQueue:not(.processing) div.picActionButton.cancel-button {
  display: none;
}

div.cancelButton {
  margin-right: 1.5rem;
  text-align: center;
}

div.queued-message.sending {
  background: -webkit-linear-gradient(-90deg, white 0%, #AEBF76 65%);
  background: linear-gradient(180deg, white 0%, #AEBF76 65%);
}

div.queued-message.sent {
  font-style: italic;
  color: dimgray;
}

div.queued-message > div.mmgrButton {
  vertical-align: middle;
}

div.queued-message-edit {
  margin-right: 2px;
  margin-left: 0px;
}

div.queued-message-remove {
  margin-right: 0px;
  margin-left: 2px;
}

div.queued-message > span {
  display: inline-block;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding-left: 2px;
  padding-right: 2px;
  vertical-align: middle;
}

span.queued-message-action,
span.queued-message-srcdest {
  text-align: center;
  width: 47px;
}

span.queued-message-delay {
  text-align: center;
  width: 20px;
}

span.queued-message-proto {
  width: 57px;
}

span.queued-message-payload {
  width: 242px;
}

div.edit-message-doc,
div.edit-message-panel,
div.edit-message-protocol,
div.edit-message-payload {
  font-size: 10pt;
}

div.edit-message-doc textarea,
div.edit-message-doc input[type=text],
div.edit-message-panel input[type=text],
div.edit-message-protocol input[type=text],
div.edit-message-payload input[type=text] {
  font-size: 10pt;
}

span.picPercentData {
  padding-left: 2px;
  padding-right: 2px;
}

div.picControllerTitle {
  display: table;
  width: 100%;
}

input.picServerAddress {
  width: 10rem;
}

input.picServerPort {
  width: 4rem;
}

div.picOptionLine > label {
  width: 9rem;
  display: inline-block;
}

div.picPanelMode,
div.picFreezeProtect {
  text-align: center;
  color: blue;
}

div.picSpaDrain {
  text-align: center;
  color: black;
}

div.picPanelMode[data-status=""],
div.picPanelMode[data-status=auto],
div.picFreezeProtect[data-status=off],
div.picSpaDrain[data-status=off] {
  display: none;
}

div.picModel > i {
  cursor: pointer;
  padding-right: 0.2rem;
}

div.picModel > i:hover {
  cursor: pointer;
  padding-right: 0.2rem;
  color: orange;
}

div.picPanelMode > label,
div.picFreezeProtect > label,
div.picSpaDrain > label {
  font-weight: bold;
  color: red;
  font-size: 1.2rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

div.picControllerTitle > div {
  display: table-cell;
}

div.picControllerTitle > div:nth-child(2) {
  text-align: center;
}

div.picControllerTitle > div:nth-child(1) {
  width: 20%;
}

div.picControllerTitle > div:nth-child(4) {
  width: 20%;
  text-align: right;
}

div.picAppLogging > label,
div.picPacketLogging > label {
  min-width: 4rem;
  display: inline-block;
}

div.picBS {
  color: purple;
}

div.picFirmware {
  font-size: 0.8rem;
  display: block;
  /* vertical-align:top; */
}

div.picFirmware > div.picOptionLine > label {
  width: 4.5rem;
}

div.picFirmware > div.picOptionLine > span {
  display: inline-block;
  width: 2rem;
  text-align: right;
}

div.picModules {
  display: inline-block;
  vertical-align: top;
  padding-left: 1em;
  padding-right: 1em;
  font-size: 0.8rem;
}

div.picModules > table > tbody > tr > td:nth-child(1) {
  width: 70px;
  text-align: left;
}

div.picModules > table > tbody > tr > td:nth-child(2) {
  width: 200px;
  text-align: left;
}

div.picModules > table {
  border-collapse: collapse;
  box-sizing: border-box;
  border-spacing: 0px;
}

div.picModules > table > tbody > tr:nth-child(1) {
  color: white;
  font-weight: bold;
  filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#ffaf4b, EndColorStr=#ff920a);
  background-image: -ms-linear-gradient(top, #ffaf4b, #ff920a);
  background-image: -moz-linear-gradient(top, #ffaf4b, #ff920a);
  background-image: -webkit-linear-gradient(top, #ffaf4b, #ff920a);
  background-image: linear-gradient(to bottom, #ffaf4b, #ff920a);
}

div.picModules > table > tbody > tr:nth-child(n+2) {
  width: 100%;
  top: 0;
  margin: 0px;
  background-color: white;
}

div.picModules > table > tbody > tr:nth-child(n+1) > td {
  border: solid 1px teal;
  padding-left: 4px;
  padding-right: 4px;
  border-collapse: collapse;
}

div.picModules > table > tbody > tr:nth-child(1) > td {
  border: solid 1px black;
  padding-left: 4px;
  padding-right: 4px;
  border-collapse: collapse;
}

div.picConfigIcon, div.picStartLogs {
  display: inline-block;
  cursor: pointer;
  margin-left: 0.5rem;
  vertical-align: text-top;
}

div.picConfigIcon:hover, div.picStartLogs:hover {
  color: orange;
  text-shadow: 3px 3px 16px #272634;
}

div.picOptionField > label {
  display: inline-block;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden;
}

div.picAmbientTemp > div {
  display: inline-block;
}

div.picAmbientTemp > div:nth-child(2) {
  float: right;
}

div.picAmbientTemp label {
  color: gray;
}

div.picBodyTemp > div:nth-child(2) {
  font-size: 2em;
}

div.ct-narrative {
  width: 100%;
  overflow: hidden;
  font-size: 0.8em;
  margin-top: 1em;
  max-width: 37rem;
}

div.ct-narrative > hr {
  margin: 1px;
}

div.anslq25-ct-narrative {
  width: 100%;
  overflow: hidden;
  font-size: 0.8em;
  margin-top: 1em;
  max-width: 37rem;
}

div.anslq25-ct-narrative-warning {
  font: bold;
  color: red;
}

div.sysmessage-button {
  display: inline-block;
  position: relative;
  width: 34px;
}

div.sysmessage-button > i {
  color: red;
}

div.sysmessage-badge {
  display: block;
  position: absolute;
  width: 20px;
  height: 12px;
  font-size: 7pt;
  border: solid 1px silver;
  background: yellow;
  text-align: center;
  font-weight: bold;
  top: -4px;
  left: 10px;
  border-radius: 3px;
  color: black;
}

div.sysmessage-button > div.dropdown-panel {
  position: absolute;
  color: black;
  padding: 4px;
  z-index: 500;
}

#orderOfElements {
  display: none;
}

/* Filter dialog: unchecked = excluded (checked = include; don't strike indeterminate/partial selection) */
div.picCheckbox.cb-filter input[type=checkbox]:not(:checked):not(:indeterminate) ~ label,
div.picCheckbox.cb-action input[type=checkbox]:not(:checked):not(:indeterminate) ~ label,
div.picCheckbox.cb-protocol input[type=checkbox]:not(:checked):not(:indeterminate) ~ label,
div.picCheckbox.cb-port input[type=checkbox]:not(:checked):not(:indeterminate) ~ label {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Collapsible action expander affordances (Filter Out Messages dialog) */
div.pnl-protofilter div.picCheckbox.cb-action.cb-collapsible {
  display: flex;
  align-items: center;
}

div.pnl-protofilter div.picCheckbox.cb-action.cb-collapsible label {
  cursor: pointer;
  user-select: none;
}

div.pnl-protofilter div.picCheckbox.cb-action.cb-collapsible span.expander-hit {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 28px;
  min-width: 28px;
  padding: 0 0.4rem;
  margin: 0 0.35rem 0 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.04);
}

div.pnl-protofilter div.picCheckbox.cb-action.cb-collapsible span.expander-hit:hover {
  background: rgba(0, 0, 0, 0.08);
}

div.pnl-protofilter div.picCheckbox.cb-action.cb-collapsible span.expander-hit > i {
  font-size: 1rem;
}

div.pnl-protofilter div.picCheckbox.cb-action.cb-collapsible span.expander-hit > span.expander-count {
  font-size: 0.75rem;
  opacity: 0.7;
}

div.pnl-protofilter div.picCheckbox.cb-action.cb-collapsible span.expander-hit.expanded > span.expander-count {
  display: none;
}

/* Payload Descriptor Table Styles */
div.payload-descriptors {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 2px solid #159FCF;
  overflow-x: auto;
  max-width: 100%;
}

table.payload-descriptor-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0px;
  font-size: 9pt;
  margin-top: 5px;
  table-layout: auto;
}

table.payload-descriptor-table thead {
  color: white;
  font-weight: bold;
  filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#FF159FCF, EndColorStr=#FF13647F);
  background: -ms-linear-gradient(top, #159FCF, #13647F);
  background: -moz-linear-gradient(top, #159FCF, #13647F);
  background: -webkit-linear-gradient(top, #159FCF, #13647F);
  background: linear-gradient(to bottom, #159FCF, #13647F);
}

table.payload-descriptor-table th {
  border: solid 1px white;
  padding: 4px 6px;
  text-align: left;
  font-size: 8pt;
  white-space: nowrap;
}

table.payload-descriptor-table tbody tr {
  cursor: pointer;
  transition: background-color 0.2s;
}

table.payload-descriptor-table tbody tr:hover {
  background-color: #e8f4f8;
}

table.payload-descriptor-table tbody tr.selected {
  background-color: #fde4be;
  font-weight: bold;
}

table.payload-descriptor-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

table.payload-descriptor-table tbody tr.selected:nth-child(even) {
  background-color: #fde4be;
}

table.payload-descriptor-table td {
  border: solid 1px #ddd;
  padding: 3px 6px;
  vertical-align: top;
  font-size: 8pt;
}

table.payload-descriptor-table td.desc-start,
table.payload-descriptor-table td.desc-length {
  text-align: center;
  width: 40px;
}

table.payload-descriptor-table td.desc-name {
  width: 120px;
  font-weight: 500;
}

table.payload-descriptor-table td.desc-description {
  min-width: 150px;
  max-width: 200px;
}

table.payload-descriptor-table td.desc-values {
  font-family: monospace;
  font-size: 7pt;
  max-width: 250px;
  word-wrap: break-word;
}

/* New data columns */
table.payload-descriptor-table td.desc-current,
table.payload-descriptor-table td.desc-previous {
  font-family: 'Courier New', monospace;
  font-size: 8pt;
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  background-color: #f0f8ff;
  max-width: 150px;
}

table.payload-descriptor-table td.desc-decimal,
table.payload-descriptor-table td.desc-ascii {
  font-family: 'Courier New', monospace;
  font-size: 8pt;
  text-align: center;
}

table.payload-descriptor-table td.desc-binary {
  font-family: 'Courier New', monospace;
  font-size: 7pt;
  text-align: center;
  white-space: nowrap;
}

table.payload-descriptor-table td.desc-decoded {
  font-weight: 500;
  background-color: #fffacd;
  min-width: 100px;
}

/* Highlight changed values */
table.payload-descriptor-table td.value-changed {
  background-color: #ffebcd !important;
  font-weight: bold;
  box-shadow: inset 0 0 3px rgba(255, 140, 0, 0.5);
}

/* Highlighted payload bytes */
td.payload-highlighted {
  background-color: #FFD700 !important;
  box-shadow: inset 0 0 3px rgba(255, 165, 0, 0.8);
  font-weight: bold;
}

tr.msg-payload-header > td.payload-highlighted {
  background: #ffa500 !important;
  color: white;
}

/* Inline Expansion Styles */
tr.msgRow.row-expanded {
  background-color: #e8f4f8 !important;
  border-left: 3px solid #159FCF;
  font-weight: bold;
}

/* Make all cells in expanded row top-aligned */
tr.msgRow.row-expanded > td {
  vertical-align: top;
}

/* New: Expansion content that lives INSIDE the row's last cell */
/* This survives virtual list re-renders because it's part of the row's stored HTML */
tr.msgRow.row-expanded > td:last-child {
  position: relative;
}

div.inline-expansion-content {
  display: block;
  position: relative;
  left: 0;
  right: 0;
  margin-top: 5px;
  padding: 10px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 10;
  /* Full-justify the expansion panel under the entire row/table (not just the Payload cell). */
  margin-left: calc(-1 * var(--mmgr-expansion-offset, 0px));
  width: calc(100% + var(--mmgr-expansion-offset, 0px));
  max-width: calc(100% + var(--mmgr-expansion-offset, 0px));
  box-sizing: border-box;
  /* IMPORTANT: Override inherited color from row hover state */
  color: black !important;
}

/* Close button for expansion */
div.expansion-buttons {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 5px;
  z-index: 20;
}

div.expansion-close-btn,
div.expansion-addqueue-btn,
div.expansion-entity-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s;
}

div.expansion-close-btn:hover {
  color: white;
  background: #d9534f;
  border-color: #d43f3a;
}

div.expansion-addqueue-btn:hover {
  color: white;
  background: #5cb85c;
  border-color: #4cae4c;
}

div.expansion-entity-btn:hover {
  color: white;
  background: #337ab7;
  border-color: #2e6da4;
}

/* Ensure expansion content is visible even when row is hovered */
tr.msgRow:hover div.inline-expansion-content,
tr.msgRow.row-expanded div.inline-expansion-content {
  color: black !important;
  background: white !important;
}

/* Ensure the row can contain the expansion properly */
tr.msgRow.row-expanded > td:last-child > span {
  display: block;
}

/* Legacy: old sibling row approach (kept for reference, may be removed) */
tr.expanded-detail-row {
  background-color: #f0f8ff;
  border-left: 3px solid #159FCF;
  position: relative;
  z-index: 100;
}

tr.expanded-detail-row td.expanded-detail-cell {
  padding: 0;
  border: none;
  overflow: visible;
  position: relative;
}

div.inline-message-detail {
  padding: 10px;
  background: white;
  border: 1px solid #ccc;
  margin: 2px;
  width: calc(100% - 4px);
  max-width: 100%;
  box-sizing: border-box;
}

/* Compact Hex Display */
div.compact-hex-header {
  padding: 10px;
  background: linear-gradient(to bottom, #159FCF, #13647F);
  color: white;
  border-radius: 4px 4px 0 0;
  margin-bottom: 10px;
  font-size: 9pt;
}

div.hex-info-row {
  margin-bottom: 5px;
}

div.hex-info-row:last-child {
  margin-bottom: 0;
}

div.compact-hex-header span.hex-label {
  font-weight: bold;
  margin-right: 5px;
  margin-left: 15px;
}

div.compact-hex-header span.hex-label:first-child {
  margin-left: 0;
}

div.compact-hex-header span.hex-value {
  margin-right: 10px;
}

div.compact-hex-header span.hex-byte {
  color: #ffd700;
  font-weight: bold;
}

div.compact-hex-header i.hex-arrow {
  margin: 0 5px;
  color: #ffd700;
}

/* Compact Payload Table (matches original format) */
table.compact-payload-table {
  width: auto;
  max-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  margin-top: 10px;
  background: white;
  font-family: 'Courier New', monospace;
  font-size: 7pt;
}

table.compact-payload-table tbody tr {
  border-bottom: 1px solid #eee;
}

table.compact-payload-table tr.compact-payload-header {
  background: #e8f4f8;
  font-weight: bold;
}

table.compact-payload-table tr.compact-payload-decimal {
  background: white;
}

table.compact-payload-table tr.compact-payload-ascii {
  background: #f9f9f9;
}

table.compact-payload-table tr.compact-payload-hex {
  background: white;
  font-weight: bold;
}

table.compact-payload-table td {
  padding: 1px 3px;
  text-align: center;
  border: 1px solid #ddd;
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  font-size: 7pt;
  transition: all 0.1s;
  white-space: nowrap;
  overflow: hidden;
}

table.compact-payload-table td.compact-byte-header {
  background: #159FCF;
  color: white;
  font-size: 6pt;
  cursor: pointer;
  padding: 0px 2px;
  line-height: 1.2;
}

table.compact-payload-table td.compact-byte-header:hover {
  background: #13647F;
  transform: scale(1.05);
}

table.compact-payload-table td.byte-changed {
  background-color: #ffebcd !important;
  border-color: #ff8c00;
  font-weight: bold;
  box-shadow: inset 0 0 3px rgba(255, 140, 0, 0.5);
}

table.compact-payload-table td.byte-selected {
  background-color: #FFD700 !important;
  border-color: #ffa500;
  box-shadow: inset 0 0 4px rgba(255, 165, 0, 0.8);
  font-weight: bold;
}

table.compact-payload-table td.compact-byte-decimal:hover,
table.compact-payload-table td.compact-byte-ascii:hover,
table.compact-payload-table td.compact-byte-hex:hover {
  background-color: #fffacd !important;
  cursor: pointer;
  transform: scale(1.1);
}

/* Remove old grid styles */
div.compact-hex-grid {
  display: none;
}

div.compact-hex-row {
  display: none;
}

span.compact-hex-byte {
  display: none;
}

/* Inline Payload Section */
div.inline-hex-display {
  margin-bottom: 8px;
  width: 100%;
  overflow-x: auto;
}

div.inline-payload-section {
  margin-top: 8px;
  width: 100%;
  overflow-x: auto;
}

div.inline-payload-section .payload-descriptors {
  margin-top: 0;
  border-top: none;
  width: 100%;
}

div.inline-payload-section table.payload-descriptor-table {
  font-size: 8pt;
  width: 100%;
  max-width: 100%;
}

/* Flash highlight for scrollToMessage */
@keyframes flash-highlight-anim {
  0% { background-color: rgba(0, 217, 255, 0.4); }
  50% { background-color: rgba(0, 217, 255, 0.2); }
  100% { background-color: transparent; }
}

tr.message-row.flash-highlight {
  animation: flash-highlight-anim 1.5s ease-out;
}

/* MessageManager header uses Settings-style tabBar() (picTabs/picTab). */
.mmgrTabHeader {
  flex-shrink: 0;
  /* Keep tab header below popups/modals (which use z-index 100+) */
  position: relative;
  z-index: 1;
}

/* Put tabs + actions on one row, like the main header/settings. */
.picMessageManager div.mmgrTabBar > div.picTabs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  background: #ffffff;
  /* Match control-panel border + shadow so it visually aligns with panels above/below */
  border: solid 1px gray;
  border-radius: 5px;
  box-shadow: 5px 5px 5px rgba(27, 27, 27, 0.4);
}

.picMessageManager div.mmgrTabBar > div.picTabContents {
  display: none;
}

.picMessageManager div.mmgrTabBar {
  width: 100%;
}

/* MessageManager doesn't render tabBar contents directly under tabs, so remove the
   negative margins that normally overlap the contents panel (they create a small gap here). */
.picMessageManager div.mmgrTabBar div.picTab,
.picMessageManager div.mmgrTabBar div.picTabSelected {
  margin-bottom: 0;
}

.picMessageManager .mmgrTabSpacer {
  flex: 1 1 auto;
}

.picMessageManager div.mmgrTabBar span.picTabText > i {
  margin-right: 8px;
}

/* Right-side actions: align with header icon style (simple, hover orange). */
.picMessageManager .view-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 10px;
}

.picMessageManager .view-bar-status {
  font-size: 0.8rem;
  color: slategray;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picMessageManager .view-bar-icon-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.picMessageManager .view-bar-icon-btn:hover {
  color: orange;
  text-shadow: 3px 3px 16px #272634;
}

.picMessageManager .view-bar-icon-btn i {
  font-size: 1rem;
}

/* Choose Files button: match unselected tab styling and invert on hover. */
.picMessageManager .upload-btn.view-bar-upload {
  background: transparent;
  border: solid 1px transparent;
  border-radius: 5px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--cupertino-secondary-label, slategray);
  font-weight: 500;
  text-shadow: 1px 1px 2px gainsboro;
}

.picMessageManager .upload-btn.view-bar-upload:hover {
  background: var(--cupertino-label, #64748b);
  border-color: var(--cupertino-label, #64748b);
  color: #ffffff;
  text-shadow: none;
}

/* View containers */
.view-container {
  display: none;
  flex: 1;
  overflow: hidden;
  min-height: 0; /* Critical for flex scrolling */
}

.view-container.active {
  display: flex;
  flex-direction: column;
}

.view-container[data-view="entityFlow"] .picEntityFlow {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Adjust message container for flex layout */
.messageContainer {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
}

.messagesContentContainer {
  flex: 1;
  display: flex;
  overflow: hidden;
}
