#channel-dialog {
  color: #302139;
  background: #fffaf6;
  border: 1px solid #d8cad5;
  border-radius: 18px;
  box-shadow: 0 16px 54px #26142638;
  width: min(610px, calc(100vw - 24px));
  max-height: min(84dvh, 800px);
  padding: 0;
}
#channel-dialog::backdrop { background: #20142678; }
#channel-dialog .channel-shell { padding: 18px 20px; }
#channel-dialog .channel-head, #channel-dialog .channel-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
#channel-dialog .channel-head { flex-wrap: nowrap; }
#channel-heading { flex: 1; overflow-wrap: anywhere; font-size: 1.25rem; margin: 0; }
#channel-body { margin-top: 14px; }
#channel-dialog h3 { font-size: 1.02rem; margin: 12px 0 7px; }
#channel-dialog .channel-row h3 { flex: 1; }
#channel-dialog .channel-form, #channel-dialog .channel-field, #channel-dialog .channel-selection {
  display: grid; gap: 6px;
}
#channel-dialog .channel-form, #channel-dialog .channel-selection { margin: 12px 0; gap: 10px; }
#channel-dialog .channel-field label { font-weight: 600; font-size: .92rem; }
#channel-dialog input, #channel-dialog textarea, #channel-dialog select {
  font: inherit; padding: 8px 10px; border: 1px solid #baaab5;
  border-radius: 8px; background: #fff; color: inherit; max-width: 100%; width: 100%; box-sizing: border-box;
}
#channel-dialog textarea { resize: vertical; }
#channel-dialog .channel-form > button, #channel-dialog .channel-selection > button { justify-self: start; }
#channel-dialog ul, #channel-dialog ol { list-style: none; margin: 8px 0 14px; padding: 0; }
#channel-dialog small, #channel-dialog time, #channel-role { color: #6a586e; font-size: .84rem; }
#channel-dialog .channel-list li { border-bottom: 1px solid #e6dce2; }
#channel-dialog .channel-list small { display: block; }
#channel-dialog .channel-entry {
  display: block; padding: 9px 4px; border: 0; border-radius: 4px; width: 100%;
  text-align: left; font: inherit; font-weight: 650; background: transparent; color: inherit; overflow-wrap: anywhere;
}
#channel-dialog .channel-entry:hover { background: #f4eaf2; }
#channel-dialog .channel-form button { min-height: 36px; }
#channel-dialog .channel-list li:only-child, #channel-dialog .channel-posts li:only-child { overflow-wrap: anywhere; }
#channel-dialog .channel-post { padding: 12px 0; border-bottom: 1px solid #e6dce2; overflow-wrap: anywhere; }
#channel-dialog .channel-post:focus { outline: 2px solid #693957; outline-offset: -2px; }
#channel-dialog .channel-post time { margin-inline-start: 10px; }
#channel-dialog .channel-text { white-space: pre-wrap; margin: 5px 0; }
#channel-dialog .channel-document { display: flex; gap: 8px; align-items: baseline; }
#channel-dialog .channel-file { color: #693957; }
#channel-status { margin: 6px 0 0; }
#channel-stats-summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px; margin: 0; padding: 12px;
  border: 1px solid #e6dce2; border-radius: 8px;
}
#channel-stats-summary dd { margin: 0; text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
@media(max-width:550px) {
  #channel-dialog { width: calc(100vw - 16px); max-height: 92dvh; }
  #channel-dialog .channel-shell { padding: 14px; }
  #channel-dialog button { min-height: 40px; }
}

@media(max-width:420px) {
  #channel-dialog .channel-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  #channel-back { grid-area: 1 / 1; justify-self: start; }
  #channel-close { grid-area: 1 / 2; }
  #channel-heading { grid-area: 2 / 1 / 3 / -1; }
}
