@media (max-width: 700px) {
  #app[data-view='chats'].chat-open .chatpanel {
    margin: 0;
    border-radius: 0;
  }

  #app[data-view='chats'] .chathead,
  #app[data-view='chats'] .composer,
  #app[data-view='chats'][data-platform='telegram'] .telegram-main > :is(header, .telegram-composer) {
    width: calc(100% - 12px);
    padding-inline: 5px;
    margin-block: 5px;
  }

  #app[data-view='chats'] .chathead,
  #app[data-view='chats'][data-platform='telegram'] .telegram-main > header {
    min-height: 48px;
    padding-block: 3px;
    gap: 6px;
  }

  #app[data-view='chats'] .chat-avatar { display: grid; flex: none; }
  #app[data-view='chats'] :is(.chatidentity, .telegram-chat-identity) { min-width: 0; }

  #app[data-view='chats'] #messages,
  #app[data-view='chats'][data-platform='telegram'] .telegram-messages {
    padding: 6px 10px;
  }
  #app[data-view='chats'] .load-older-button { margin-block: 2px 4px; padding: 4px 10px; }
  #app[data-view='chats'] .historybar { padding-block: 4px; }

  #app[data-view='chats'] #messages > .bubble {
    margin-inline: 0;
    max-width: calc(100% - 38px);
    padding: 5px 8px 4px;
  }

  #app[data-view='chats'] #messages > .bubble.group-sender {
    margin-inline-start: var(--group-sender-offset);
    max-width: calc(100% - var(--group-sender-offset) - 36px);
  }

  #app[data-view='chats'][data-platform='telegram'] .telegram-message {
    max-width: 87%;
    padding: 5px 8px;
  }

  #app[data-view='chats']:not([data-platform='telegram']) .composer { padding: 0; }
  #app[data-view='chats']:not([data-platform='telegram']) .composerrow,
  #app[data-view='chats'][data-platform='telegram'] .telegram-main > .telegram-composer {
    min-height: 46px;
    padding: 2px 3px;
    gap: 2px;
  }

  #app[data-view='chats']:not([data-platform='telegram']) .composerrow > textarea {
    flex: 1 1 0;
    min-height: 40px;
    max-height: min(105px, 25dvh);
    padding: 9px 4px;
    line-height: 20px;
  }

  #app[data-view='chats'] .composerrow > textarea:placeholder-shown { field-sizing: fixed; height: 40px; }
  #app[data-view='chats'] .composerrow > textarea::placeholder { white-space: nowrap; text-overflow: ellipsis; }

  #app[data-view='chats'] :is(.composerrow, .telegram-composer) :is(.iconbutton, .sendbutton, .telegram-attach, .telegram-icon-button, .telegram-voice-start, .telegram-send) {
    flex: none;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }

  #app[data-view='chats'][data-platform='telegram'] .telegram-composer input[name='text'] {
    flex: 1 1 0;
    min-height: 40px;
    padding: 6px;
    font-size: 16px;
  }

  #profilePanel .profile-inner { padding: 12px 10px 16px; }
  #profilePanel .profile-topbar { padding-bottom: 9px; margin-bottom: 10px; gap: 6px; }
  #profilePanel .profile-topbar h2 { font-size: 1.45rem; }
  #profilePanel .profile-top-actions { gap: 4px; }
  #profilePanel .profile-top-actions > button { padding-inline: 7px; font-size: .75rem; }
  #profilePanel :is(.profile-grid, .profile-categories, .profile-utilities-card) { gap: 8px; }
  #profilePanel :is(.profile-identity, .profile-business-section, .profile-lines-card, .profile-cat-card) { padding: 10px 12px; }
  #profilePanel .profile-avatar { width: 42px; height: 42px; }
  #profilePanel .profile-utility-row { flex-direction: row; align-items: center; padding: 8px 10px; }
  #profilePanel .profile-utilities-card { grid-template-columns: minmax(0, 1fr); }
  #profilePanel .profile-lines-head { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 5px; }
  #profilePanel .profile-lines-head #openCreateLine { width: auto; }
  #profilePanel .profile-lines-help { margin-bottom: 8px !important; }

  #app #attachmentDialog { max-height: calc(100dvh - 16px); }
  .attachment-dialog :is(header, footer, .attachment-stage) { padding: 8px 10px; }
  .attachment-dialog footer textarea { min-height: 40px; }
}
