.channels-section {
  display: grid;
  gap: 1rem;
}

.channel-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.channel-card {
  display: grid;
  gap: 0.75rem;
}

.channel-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.channel-card h2,
.channel-dialog h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.channel-native pre {
  max-height: 18rem;
  overflow: auto;
}

.channel-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto 0 auto auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: var(--shadow);
}

.channel-dialog::backdrop {
  background: var(--overlay);
}

.channel-drawer-form {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
}

.channel-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.channel-field {
  display: grid;
  gap: 0.35rem;
}

.channel-field input,
.channel-field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.channel-field input[readonly] {
  background: var(--surface-muted);
  color: var(--muted);
  cursor: default;
}

.channel-field code {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.channel-check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 600;
}

.channel-check input {
  width: auto;
}

.channel-field:has(input:disabled),
.channel-check:has(input:disabled) {
  opacity: 0.55;
}

.channel-field input:disabled,
.channel-check input:disabled {
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .channel-field input,
  .channel-field select {
    font-size: 16px;
  }

  .channel-heading,
  .channel-card-row,
  .channel-drawer-head {
    grid-template-columns: 1fr;
  }

  .channel-card-row,
  .channel-drawer-head {
    display: grid;
  }

  .channel-actions {
    justify-content: flex-start;
  }

  .channel-dialog {
    width: 100vw;
    max-height: 92vh;
    margin: auto 0 0;
  }
}
