/* Configure Pipe Support Database dialog */

.support-db-dialog {
  width: min(960px, calc(100vw - 2rem));
  max-height: calc(100vh - 2.5rem);
}

.support-db-dialog[open] {
  display: flex;
  flex-direction: column;
  /* Keep visible so the right-click menu is not clipped. */
  overflow: visible;
}

.support-db-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem 1rem 0.75rem;
  overflow: hidden;
  min-height: 0;
  flex: 1;
}

.support-db-dialog-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #5b6b7c;
}

.support-db-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
  gap: 0.85rem;
  min-height: 0;
  flex: 1;
  height: min(62vh, 560px);
  max-height: min(62vh, 560px);
  overflow: hidden;
}

.support-db-group-panel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.55rem;
}

.support-db-group-heading {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5b6b7c;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.support-db-group-list {
  list-style: none;
  margin: 0;
  padding: 0.15rem;
  overflow-x: hidden;
  overflow-y: scroll;
  min-height: 0;
  flex: 1;
  border: 1px solid #d5dbe3;
  border-radius: 6px;
  background: #fff;
}

.support-db-group-item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.88rem;
  color: #1f2a37;
  padding: 0.45rem 0.55rem;
  border-radius: 5px;
  cursor: pointer;
}

.support-db-group-item:hover,
.support-db-group-item:focus-visible {
  background: #eef4fb;
  outline: none;
}

.support-db-group-item.is-selected {
  background: #1e3a5f;
  color: #fff;
}

.support-db-form-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  background: #fff;
  overflow-x: hidden;
  overflow-y: scroll;
}

.support-db-group-form {
  padding: 0.85rem 1rem;
}

.support-db-form-empty {
  margin: 0;
  font-size: 0.9rem;
  color: #5b6b7c;
}

.support-db-form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.support-db-form-fields.hidden,
.support-db-form-empty.hidden {
  display: none;
}

.support-db-field {
  display: grid;
  grid-template-columns: minmax(9.5rem, 12.5rem) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
}

.support-db-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #445066;
  padding-top: 0.45rem;
  line-height: 1.3;
  word-break: break-word;
}

.support-db-field-input,
.support-db-field-textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c5ced9;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  font-size: 0.875rem;
  color: #1f2a37;
  font-family: inherit;
}

.support-db-field-textarea {
  min-height: 4.2rem;
  resize: vertical;
  line-height: 1.4;
}

.support-db-field-input:focus,
.support-db-field-textarea:focus {
  outline: 2px solid #7aa7d9;
  outline-offset: 1px;
}

.support-db-context-menu {
  position: fixed;
  z-index: 80;
  min-width: 11.5rem;
  background: #fff;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  padding: 0.25rem;
}

.support-db-context-menu.hidden {
  display: none;
}

.support-db-context-item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: #1f2a37;
  text-align: left;
  font-size: 0.88rem;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}

.support-db-context-item:hover,
.support-db-context-item:focus-visible {
  background: #eef4fb;
  outline: none;
}

.support-db-context-item--danger {
  color: #b42318;
}

.support-db-context-item--danger:hover,
.support-db-context-item--danger:focus-visible {
  background: #fdecec;
}

.support-db-dialog-status {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.85rem;
  color: #5b6b7c;
}

.support-db-dialog-status.is-error {
  color: #b42318;
}

.support-db-field-textarea--input-fields {
  cursor: pointer;
}

.support-db-input-fields-dialog {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2.5rem);
  /* Sit above the parent admin dialog top-layer content when nested. */
  z-index: 100;
}

.support-db-input-fields-dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.support-db-input-fields-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem 1rem 0.75rem;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.support-db-input-fields-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #5b6b7c;
}

.support-db-input-fields-list {
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  overflow: auto;
  max-height: min(52vh, 420px);
  background: #fff;
}

.support-db-input-fields-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.support-db-input-fields-table th,
.support-db-input-fields-table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid #e4e9ef;
  text-align: left;
  vertical-align: middle;
}

.support-db-input-fields-table th {
  position: sticky;
  top: 0;
  background: #eef3f8;
  color: #1f2a37;
  font-weight: 600;
  z-index: 1;
}

.support-db-input-fields-table tr:hover td {
  background: #f5f8fc;
}

.support-db-input-fields-check {
  width: 2rem;
  text-align: center;
}

.support-db-input-fields-check input {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.support-db-input-fields-id {
  font-family: Consolas, "Courier New", monospace;
  color: #1e3a5f;
  white-space: nowrap;
}

.support-db-input-fields-label {
  color: #1f2a37;
}

@media (max-width: 720px) {
  .support-db-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .support-db-group-panel,
  .support-db-form-panel {
    height: 14rem;
  }

  .support-db-field {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .support-db-field-label {
    padding-top: 0;
  }
}
