#button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  justify-items: stretch;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

/* .button-row {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
} */

#button-grid .action-btn {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  font-size: 1em;
  margin: 0;
  font-weight: 500;
}

.button-row .action-btn:first-child { margin-left: 0; }
.button-row .action-btn:last-child { margin-right: 0; }

.action-btn {
  border: 2px solid #888;
  border-radius: 8px;
  background: inherit; /* Keeps the background consistent with your theme */
}

.no-select {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Internet Explorer/Edge */
    user-select: none;         /* Standard */
}

.swap-highlight {
  outline: 2px dashed #ff3860;
  outline-offset: -4px;
}

/* Hide the down arrow for the #cids multi-select on all browsers */
#cids {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 1px solid #b5b5b5;
  scrollbar-width: thin;
  scrollbar-color: #3273dc #222;
  overflow-y: auto;
}
#cids:focus {
  outline: none;
}
#cids::-ms-expand {
  display: none !important;
}
#cids::-webkit-scrollbar {
  width: 8px;
  background: #222;
  border-radius: 8px;
}
#cids::-webkit-scrollbar-thumb {
  background: #3273dc;
  border-radius: 8px;
}
#cids::-webkit-scrollbar-thumb:hover {
  background: #276cda;
}

#connections-list {
  background: none;
  border-radius: 10px;
  padding: 0;
  margin: 0;
  /* max-height: 400px; */
  overflow-y: visible;
  box-shadow: none;
}
.connection-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  font-size: 1.00em;
  font-weight: 400;
  color: #222;
  background: #fff;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.connection-row.selected {
  /* background: #1976d2; */
  /* color: #fff; */
  /* font-weight: 700; */
}
.connection-row.selected .connection-label {
  /* color: #fff; */
}
.connection-row:hover {
  /* background: #e3e9f7; */
}
.connection-checkbox {
  margin-right: 0.75rem;
  accent-color: #1976d2;
  width: 1.2em;
  height: 1.2em;
}
.connection-label {
  flex: 1 1 auto;
  color: #222;
  font-weight: 500;
  word-break: break-all;
}
.connection-row.selected .connection-checkbox {
  border-color: #fff;
}
.connection-computer-icon {
  margin-right: 0.75rem;
  color: #1976d2;
  font-size: 1.1em;
}
.select-all-row { display: none; }

#select-all-btn {
  background: #f5f5f5;
  color: #222;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.00em;
  padding: 0.5em 1.5em;
  box-shadow: 0 2px 8px rgba(60,60,60,0.06);
  transition: background 0.18s, box-shadow 0.18s, color 0.18s;
  margin-bottom: 0.5rem;
  outline: none;
}
#select-all-btn:hover, #select-all-btn:focus, #select-all-btn:active {
  background: #ececec;
  color: #222;
  box-shadow: 0 2px 8px rgba(60,60,60,0.06);
}
#select-all-btn:focus {
  outline: none;
  box-shadow: none;
}

#macro-context-menu {
  font-size: 1em;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  border: 1px solid #ddd;
  min-width: 140px;
  padding: 0.25em 0;
  z-index: 1000;
}
.macro-menu-item {
  padding: 0.5em 1em;
  cursor: pointer;
  transition: background 0.15s;
}
.macro-menu-item:hover {
  background: #f5f5f5;
}

.macro-highlight {
  border: 2px solid #1976d2 !important;
  box-sizing: border-box;
}

.output-box {
  width: 100%;
  height: 350px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  margin-bottom: 1.5rem;
  overflow-y: auto;
  padding: 1em;
  background: #f5f5f5;
  user-select: none;
  font-family: monospace;
  font-size: 1em;
  color: #222;
  white-space: pre-line;
}