/* The message field of every talk (kit/messagefield.js; 15.2972: «все диалоги и сообщения… посади на один единый код»).
   15.2849 (23.11: «Поле для ввода в сообщениях переработай на новый манер. Сделай как в нормальных мессенджерах»):
   Telegram's composer - a rounded box floats on the chat's ground, the answered message and the attachments inside it
   over the words, the clip inside at the right, a round send button beside it that stands always and lights up when
   there is something to send. The place sets the padding around it; `.inset` - inside a card or a pop. */
.msgr-compose {
  --h-compose: 44px;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-100);
}
.msgr-compose.inset { --h-compose: var(--h-field); }
.msgr-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: var(--bw) solid transparent;
  border-radius: var(--r-l);
  background: var(--card);
  box-shadow: var(--sh-raised);
}
/* inside a card: the fill of the program's filled fields (the search field's), no shadow */
.msgr-compose.inset > .msgr-box { background: var(--a-100); box-shadow: none; }
:root[data-theme="dark"] .msgr-compose:not(.inset) > .msgr-box { border-color: var(--line); }

/* the field: one line high, growing with its words (a Line comment's edit takes it alone, framed as any field) */
.msgr-text {
  flex: 1;
  min-width: 0;
  height: var(--h-field);
  min-height: var(--h-field);
  max-height: 160px;
  padding-block: calc((var(--h-field) - var(--lh)) / 2 - var(--bw));
  resize: none;
}
.msgr-field-row { display: flex; align-items: flex-end; min-width: 0; }
.msgr-field-row > .msgr-text.input {
  height: var(--h-compose);
  min-height: var(--h-compose);
  max-height: none;
  overflow-y: hidden;
  padding-block: calc((var(--h-compose) - var(--lh)) / 2);
  padding-inline: var(--sp-200) var(--sp-050);
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}
.msgr-compose.inset .msgr-field-row > .msgr-text.input { padding-inline: var(--sp-150) var(--sp-050); }
.msgr-field-row > .msgr-attach {
  flex: none;
  width: var(--h-compose);
  height: var(--h-compose);
  padding: 0;
  justify-content: center;
  border-radius: var(--r-full);
  color: var(--ink3);
}

/* the round send, in the accent always (15.3025: «Кнопку отправки сделай в акценте»); with nothing to send it waits a
   shade quieter */
.msgr-send {
  flex: none;
  display: inline-grid; place-items: center;
  width: var(--h-compose);
  height: var(--h-compose);
  padding: 0;
  overflow: hidden;
  border: var(--bw) solid transparent; border-radius: var(--r-full);
  background: var(--acc-btn-grad, var(--acc-btn)); color: var(--acc-btn-ink);
  box-shadow: var(--sh-raised);
  cursor: pointer;
  transition: background var(--dur-fold) var(--ease-out), color var(--dur-fold) var(--ease-out);
}
@media (hover: hover) { .msgr-send:not(.idle):not(:disabled):hover { filter: brightness(1.08); } }
.msgr-send.idle { box-shadow: none; }
.msgr-compose.inset > .msgr-send { box-shadow: none; }
.msgr-send:disabled { opacity: .6; }
[data-motion="calm"] .msgr-send { transition: none; }
@media (prefers-reduced-motion: reduce) { .msgr-send { transition: none; } }
