:root {
  --message-font-size: 15px;
}

.message-text {
  font-size: var(--message-font-size);
  line-height: 1.36;
}

.message-sender {
  margin: 0 0 3px;
  color: #aebdca;
  font-size: .72rem;
  font-weight: 760;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-platform="telegram"] .message.incoming .message-sender {
  color: #9bd1ff;
}

[data-platform="whatsapp"] .message.incoming .message-sender {
  color: #91e8b0;
}

.message.outgoing .message-sender {
  color: #9fadb9;
  text-align: right;
}

.messages {
  scroll-behavior: auto;
  overflow-anchor: none;
}

.composer {
  align-items: flex-end;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 42px;
  max-height: 132px;
  height: 42px;
  margin: 0;
  border: 0;
  border-radius: 21px;
  padding: 10px 15px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  font: inherit;
  line-height: 1.35;
  resize: none;
  overflow-y: hidden;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  -webkit-appearance: none;
  appearance: none;
}

.composer textarea:focus {
  box-shadow: inset 0 0 0 1px rgba(51,144,236,.55);
}

.composer textarea::placeholder {
  color: #8495a6;
}

.conversation-avatar.has-photo,
.chat-avatar.has-photo {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: transparent;
  text-shadow: none;
}

.message-state.sent,
.message-state.delivered {
  color: #a9bac9;
  letter-spacing: -0.16em;
  padding-right: 0.16em;
}

.message-state.read {
  color: #67b7ff;
  letter-spacing: -0.16em;
  padding-right: 0.16em;
}

.message-state.unknown {
  color: #f2c96d;
}

.message-state.failed {
  color: #ff8585;
}

.font-settings-row {
  align-items: center;
}

.font-size-control {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(110px, 170px) 42px;
  align-items: center;
  gap: 9px;
}

.font-size-control input[type="range"] {
  width: 100%;
  accent-color: var(--telegram);
}

.font-size-control output {
  min-width: 42px;
  color: #cdd9e5;
  text-align: right;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  html,
  body,
  .shell,
  .layout {
    height: 100vh;
  }

  .shell,
  .layout {
    min-height: 0;
  }

  .composer:focus-within {
    padding-bottom: 7px;
  }

  .composer textarea {
    min-height: 40px;
    height: 40px;
    padding: 9px 14px;
    border-radius: 20px;
  }
}

@media (max-width: 430px) {
  .font-settings-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .font-size-control {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 42px;
  }
}
