/* The customer column: the chat of the selected place.
   Black and white, businesslike (textee). */

.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  /* nothing inside may widen the column */
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.chat__log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.chat__message {
  display: flex;
}

.chat__message--mine {
  justify-content: flex-end;
}

.chat__message--theirs {
  justify-content: flex-start;
}

.chat__message--service {
  justify-content: center;
}

.chat__bubble {
  max-width: 78%;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  padding: 6px 10px;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.45;
}

.chat__message--mine .chat__bubble {
  background: #111;
  color: #fff;
}

.chat__message--service .chat__bubble {
  border: none;
  background: transparent;
  color: #666;
  font-size: 12px;
  text-align: center;
  max-width: 88%;
}

.chat__bubble--pending {
  opacity: 0.5;
}

.chat__line {
  margin: 0;
}

.chat__line + .chat__line {
  margin-top: 4px;
}

.chat__composer {
  display: flex;
  align-items: flex-end;
  border-top: 1px solid #111;
  background: #fff;
}

.chat__input {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
  background: transparent;
}

.chat__send {
  cursor: pointer;
  padding: 10px 12px;
  border-left: 1px solid #111;
  font-size: 12px;
  user-select: none;
  white-space: nowrap;
}

.chat__send:hover {
  background: #111;
  color: #fff;
}

.chat--empty {
  height: 100%;
}

/* the reader's scroll is sacred: the jump button offers the tail */
.chat {
  position: relative;
}

.chat__jump {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

/* the gate before the signature */
.chat__gate {
  border-top: 1px solid #111;
  background: #fff;
  padding: 12px;
  font-size: 12px;
  color: #666;
  text-align: center;
}

/* the stroke: the only signing mechanic (textee/signature.md) */
.sign {
  position: relative;
  border-top: 1px solid #111;
  border: 1px solid #111;
  background: #fff;
  height: 44px;
  margin: 8px;
  touch-action: none;
  user-select: none;
  overflow: hidden;
}

.sign__thumb {
  position: absolute;
  left: 4px;
  top: 3px;
  width: 36px;
  height: 36px;
  background: #111;
  cursor: grab;
  touch-action: none;
  z-index: 1;
}

.sign__thumb:active {
  cursor: grabbing;
}

.sign__hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #666;
  pointer-events: none;
}

/* the selection mode: the long press picks the bubbles to carry out */
.chat__bubble--selected {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.chat__transferred {
  padding: 6px 12px;
  font-size: 11px;
  color: #666;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.chat__carry {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid #111;
  background: #fff;
  padding: 8px;
}

.chat__carry-select {
  flex: 1;
  /* a select's intrinsic min-width is its longest option:
     unclamped it blows the column wide open */
  min-width: 0;
  max-width: 100%;
  font-family: inherit;
  font-size: 12px;
  border: 1px solid #111;
  background: #fff;
  padding: 6px;
}

.chat__carry-count {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
}
