/* =========================================================
   vAvtobyse 2.9.19 — STAGE 2A / MULTI-QUOTE
   Scope: multi-message quote selection + compact composer preview.
   No DB schema changes. Keeps single-message reply behavior intact.
   ========================================================= */

.multi-quote-preview{
  margin:6px 7px 0;
  padding:7px 8px 7px 10px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 30px;
  gap:8px;
  align-items:start;
  border:1px solid color-mix(in srgb,var(--th-accent,#d2aa3d) 48%,var(--th-border,#5d676c));
  border-left:4px solid var(--th-accent,#d2aa3d);
  border-radius:9px;
  background:color-mix(in srgb,var(--th-panel,#2c363b) 88%,var(--th-accent,#d2aa3d) 12%);
  color:var(--th-text,#eef0eb);
  box-shadow:inset 0 1px rgba(255,255,255,.03);
}
.multi-quote-preview.hidden{display:none!important}
.multi-quote-preview-main{min-width:0}
.multi-quote-preview-title{
  margin:0 0 4px;
  color:var(--th-accent,#e6bd49);
  font:700 11px/14px Tahoma,Verdana,sans-serif;
  letter-spacing:.01em;
}
.multi-quote-preview-items{display:grid;gap:3px;min-width:0}
.multi-quote-preview-item{
  min-width:0;
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:6px;
  align-items:baseline;
  font:400 10px/14px Tahoma,Verdana,sans-serif;
  color:var(--th-muted,#aeb6b7);
}
.multi-quote-preview-item strong{
  max-width:120px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--th-text,#eef0eb);
}
.multi-quote-preview-item span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.multi-quote-preview-more{font:700 10px/13px Tahoma,Verdana,sans-serif;color:var(--th-muted,#aeb6b7)}
.multi-quote-preview-close{
  width:28px;height:28px;min-width:28px;
  display:grid;place-items:center;
  padding:0;border:1px solid var(--th-border,#59656a);border-radius:8px;
  background:var(--th-input,#273136);color:var(--th-text,#eef0eb);
  font:700 14px/1 Tahoma,Verdana,sans-serif;
  cursor:pointer;
}
.multi-quote-preview-close:hover{border-color:var(--th-accent,#d2aa3d);background:var(--th-hover,#333d42)}

/* The outgoing body uses the existing > quote syntax, but make multiple blocks
   read as one intentional quote stack instead of pasted plain text. */
.message-inline-quote{
  margin:0 0 6px!important;
  padding:6px 8px!important;
  border-left:3px solid var(--th-accent,#d2aa3d)!important;
  border-radius:5px!important;
  background:color-mix(in srgb,var(--th-panel,#2c363b) 80%,var(--th-accent,#d2aa3d) 20%)!important;
  overflow:hidden;
}
.message-inline-quote:last-child{margin-bottom:0!important}
.message-inline-quote-author{
  color:var(--th-accent,#e6bd49)!important;
  font-weight:700!important;
  font-size:10px!important;
  line-height:13px!important;
}
.message-inline-quote-text{
  color:var(--th-text,#eef0eb)!important;
  opacity:.86;
  font-size:10px!important;
  line-height:14px!important;
  overflow-wrap:anywhere;
}

/* Selection is a deliberate mode: quote is visually the primary secondary action. */
#selectionBar #quoteSelectedBtn{
  border-color:color-mix(in srgb,var(--th-accent,#d2aa3d) 60%,var(--th-border,#59656a))!important;
  color:var(--th-text,#eef0eb)!important;
}
#selectionBar #quoteSelectedBtn::before{content:"↪ ";color:var(--th-accent,#e6bd49)}

@media (min-width:821px){
  body.vav-multi-quote-active.vav-shell-mode .composer{
    max-height:210px!important;
  }
  body.vav-multi-quote-active.vav-shell-mode .multi-quote-preview{
    margin:5px 7px 0!important;
    max-height:82px!important;
    overflow:hidden!important;
  }
}

@media (max-width:820px){
  html.vav-mobile-layout body.vav-shell-mode .multi-quote-preview{
    margin:5px 7px 0!important;
    padding:6px 7px 6px 9px!important;
    grid-template-columns:minmax(0,1fr) 28px!important;
    gap:6px!important;
    max-height:104px!important;
    overflow:hidden!important;
    border-radius:10px!important;
  }
  html.vav-mobile-layout body.vav-shell-mode .multi-quote-preview-close{
    width:27px!important;height:27px!important;min-width:27px!important;
  }
  html.vav-mobile-layout body.vav-shell-mode .multi-quote-preview-item{
    grid-template-columns:minmax(72px,auto) minmax(0,1fr)!important;
    font-size:10px!important;
  }
  html.vav-mobile-layout body.vav-shell-mode .multi-quote-preview-item strong{max-width:110px!important}
  html.vav-mobile-layout.vav-stage1b-focus body.vav-shell-mode .multi-quote-preview,
  html.vav-mobile-layout.vav-stage1b-keyboard body.vav-shell-mode .multi-quote-preview{
    max-height:min(88px,17vh)!important;
  }
}

/* =========================================================
   STAGE 2A HOTFIX — MOBILE LONG-PRESS / NATIVE TEXT SELECTION
   The app owns long-press on message rows. On coarse/mobile input,
   suppress Chromium/Android word selection + contextual lookup so the
   vAvtobyse message menu opens cleanly. Desktop text selection is kept.
   ========================================================= */
@media (pointer:coarse), (max-width:820px){
  html.vav-mobile-layout body.vav-shell-mode .message-row.has-message-actions,
  html.vav-mobile-layout body.vav-shell-mode .message-row.has-message-actions .message-content,
  html.vav-mobile-layout body.vav-shell-mode .message-row.has-message-actions .message-bubble,
  html.vav-mobile-layout body.vav-shell-mode .message-row.has-message-actions .message-author,
  html.vav-mobile-layout body.vav-shell-mode .message-row.has-message-actions .message-text,
  html.vav-mobile-layout body.vav-shell-mode .message-row.has-message-actions .message-inline-quote,
  html.vav-mobile-layout body.vav-shell-mode .message-row.has-message-actions .image-message{
    -webkit-user-select:none!important;
    user-select:none!important;
    -webkit-touch-callout:none!important;
  }
  html.vav-mobile-layout body.vav-shell-mode .message-row.has-message-actions{
    -webkit-tap-highlight-color:transparent;
    touch-action:pan-y;
  }
}
