.proxy-fields {
  border: 1px solid var(--line);
  border-radius: 13px;
  margin: 20px 0 4px;
  padding: 4px 16px 12px;
  text-align: left;
}

.proxy-fields legend {
  padding: 0 7px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.proxy-fields p,
.network-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.proxy-fields label {
  margin: 12px 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dialog-actions.spread {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
}

.instance-actions {
  flex-wrap: wrap;
}

.instance-actions .button {
  min-width: 82px;
}

dialog .dialog-card {
  max-height: calc(100vh - 32px);
  overflow: auto;
}

@media (max-width: 480px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .dialog-actions.spread {
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions.spread span {
    display: none;
  }
}

/* WeChat-like conversation rows: the avatar is the unread anchor, while the
   latest activity drives the order of the list. */
.peer {
  position: relative;
  gap: 12px;
  min-height: 66px;
}

.peer-avatar {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.peer-avatar .contact-avatar {
  width: 40px;
  height: 40px;
}

.peer-body {
  min-width: 0;
  flex: 1;
}

.peer-body strong,
.peer-body small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-body small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.peer-meta {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 2px 0;
}

.peer-meta time {
  color: #98a2b3;
  font-size: 10px;
  white-space: nowrap;
}

.unread-dot {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 99px;
  color: #fff;
  background: #f04438;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(240, 68, 56, .28);
}

.bubble-row {
  align-items: flex-end;
  gap: 8px;
}

.bubble-row.outgoing {
  flex-direction: row-reverse;
}

.bubble-row > .contact-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  margin-bottom: 1px;
}

@media (max-width: 480px) {
  .peer {
    min-height: 62px;
  }

  .peer-meta time {
    font-size: 9px;
  }
}
