/* R51: quiet action hierarchy and predictable interactive states.
   Deliberately excludes video/audio and their native controls.
   M02 2026-09-14: радиусы/интерлиньяж выровнены с фактическим финальным
   каскадом (design-r55 переопределяет эти же селекторы): 18px→r55-menu-radius
   (16), 11px→r55-menu-item-radius (10), 1.35→--lh-action. Вычисленные
   значения не изменились; файл больше не contradиктует финалу. */
.msg-act__menu {
  max-width:calc(100vw - 24px);
  max-height:min(440px,60dvh);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  /* M06 / review-visual №1: контейнер .msg-act получает inline max-height по видимой
     области (adaptive-viewport); список — единственный гибкий элемент: он сжимается
     и скроллится внутри, панель реакций и подсказка не сжимаются. */
  flex:1 1 auto;
  min-height:0;
  padding:5px;
  border:1px solid var(--border,#dce2eb);
  border-radius:var(--r55-menu-radius, 16px);
  box-shadow:0 12px 32px rgb(20 30 50 / .14);
}
/* Меню — гибкий элемент; остальные части .msg-act фиксируются по высоте. */
.msg-act > .msg-act__picker,
.msg-act > .r55-menu-keyhint { flex:0 0 auto; }
.msg-act__menu > button {
  min-height:44px!important;
  min-width:44px;
  height:auto!important;
  width:100%;
  padding:10px 12px!important;
  white-space:normal!important;
  overflow-wrap:anywhere;
  line-height:var(--lh-action, 1.35);
  text-align:left;
  border-radius:var(--r55-menu-item-radius, 10px);
  transform:none!important;
  transition:background-color 140ms ease,color 140ms ease!important;
}
.msg-act__menu > button[data-act="del"] {
  color:var(--danger,#b3344d)!important;
  border-top:1px solid var(--border,#dce2eb);
  margin-top:4px;
}
/* Attachment choices are peers; reserve solid accent for actual submission. */
.vy-ask__card .vy-ask__btn[data-attachment]:not([data-attachment="cancel"]) {
  min-height:48px;
  height:auto;
  white-space:normal;
  line-height:var(--lh-action, 1.35);
  color:var(--text,#253149)!important;
  background:var(--surface-2,#f2f4f8)!important;
  border:1px solid var(--border,#dce2eb)!important;
  box-shadow:none!important;
  transform:none!important;
}
.vy-ask__card:has([data-attachment]) {
  max-width:min(420px,calc(100vw - 24px));
  max-height:calc(100dvh - 32px);
  overflow-y:auto;
  overscroll-behavior:contain;
  box-sizing:border-box;
}
/* Keep glyphs crisp and centered even when a button label is long. */
:is(.msg-act__menu,.vy-ask__card,.record-bar__controls) button > svg {
  flex-shrink:0;
  vertical-align:middle;
}
:is(.msg-act__menu,.vy-ask__card,.record-bar__controls) button:focus-visible {
  outline:2px solid var(--accent,#7161d8)!important;
  outline-offset:2px!important;
}
:is(.msg-act__menu,.vy-ask__card,.record-bar__controls) button:disabled {
  opacity:.55!important;
  cursor:not-allowed!important;
  transform:none!important;
  scale:1!important;
  box-shadow:none!important;
}
:is(.msg-act__menu,.vy-ask__card,.record-bar__controls) button[aria-busy="true"] {
  cursor:progress!important;
}
@media(hover:hover) {
  .msg-act__menu > button:not(:disabled):hover,
  .vy-ask__card .vy-ask__btn[data-attachment]:not(:disabled):hover {
    background:color-mix(in srgb,var(--accent,#7161d8) 9%,var(--surface,#fff))!important;
  }
}
@media(prefers-reduced-motion:reduce) {
  :is(.msg-act__menu,.vy-ask__card,.record-bar__controls) button {
    animation:none!important;
    transition:none!important;
  }
}

/* A 44px name target also frames its subtitle, instead of stacking a 44px
   button above another 18px line. Both text lines now share the avatar centre. */
#app #thread-header {
  box-sizing:border-box;
  align-items:center;
  gap:4px;
  height:auto;
  min-height:calc(72px + env(safe-area-inset-top,0px));
  padding-block:calc(8px + env(safe-area-inset-top,0px)) 8px;
  padding-inline:max(8px,env(safe-area-inset-left,0px)) max(8px,env(safe-area-inset-right,0px));
}
#app #thread-header .thread-header__info {
  position:relative;
  flex:1 1 0;
  min-width:0;
  height:44px;
  margin:0;
  overflow:visible;
}
#app #thread-header #thread-name {
  display:block;
  box-sizing:border-box;
  width:100%;
  min-width:0;
  min-height:44px;
  height:44px;
  padding:0 0 18px;
  margin:0;
  line-height:26px;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#app #thread-header #thread-status {
  position:absolute;
  top:26px;
  inset-inline:0;
  min-width:0;
  height:18px;
  margin:0;
  padding:0;
  line-height:18px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  pointer-events:none;
}
#app #thread-header .thread-header__info:not(:has(#thread-status:not(:empty))) #thread-name {
  padding-bottom:0;
  line-height:44px;
}
#app #thread-header > .vy2-header-avatar {
  box-sizing:border-box;
  flex:0 0 36px;
  width:36px;
  height:36px;
  padding:0;
}
#app #thread-header > .vy2-header-avatar :is(.vy2-avatar,.chat-row__avatar) {
  box-sizing:border-box;
  width:100%;
  height:100%;
  min-width:0;
  max-width:100%;
  border-radius:inherit;
}
#app #thread-header > :is(.btn-back,.thread-tools),
#app #thread-header .thread-header__actions > .btn-icon {
  flex:0 0 44px;
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
}
#app #thread-header .thread-header__actions { margin:0;gap:0; }

/* The desktop chat-list header also contains unread, calls, new-chat and menu
   controls. Its decorative signature was being clipped between those targets. */
#app #panel-list > .list-header .list-header__title > .vy-msg-signature {
  display:none;
}
