/* chat_actions.css (FGChatSel 2026-06-06) */

/* ===== выделенный бабл ===== */
.fgcs-host .ch-group-bubble.fgcs-selected,
.fgcs-host .ch-msg.fgcs-selected,
.fgcs-host .ch-saved-bubble.fgcs-selected{
  box-shadow: 0 0 0 2px #0a84ff;
  position: relative;
}
.fgcs-host .ch-group-bubble,
.fgcs-host .ch-msg,
.fgcs-host .ch-saved-bubble {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  /* (tap-highlight 2026-06-07) убираем прямоугольный Android tap-highlight,
     иначе по углам бабла видны тёмные квадраты, не уважающие border-radius. */
  -webkit-tap-highlight-color: transparent;
}

/* ===== верхняя плашка ===== */
.fgcs-topbar{
  position: fixed;
  left: 0; right: 0;
  top: 0;
  z-index: 10500;
  display: flex; align-items: center;
  gap: 6px;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: #1c1c1e;
  color: #fff;
  border-bottom: 0.5px solid rgba(120,120,128,0.32);
  font-family: inherit;
}
body[data-theme=light] .fgcs-topbar{
  background: #f6f6f8;
  color: #000;
  border-bottom-color: rgba(60,60,67,0.18);
}
.fgcs-topbar .fgcs-tb-btn{
  background: transparent;
  border: 0;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: inherit;
  border-radius: 50%;
  padding: 0;
}
.fgcs-topbar .fgcs-tb-btn:hover{ background: rgba(120,120,128,0.18); }
.fgcs-topbar .fgcs-tb-count{
  font-size: 17px;
  font-weight: 600;
  margin: 0 4px 0 2px;
  min-width: 24px;
}
.fgcs-topbar .fgcs-tb-spacer{ flex: 1; }

/* ===== нижняя плашка (TG-style pill-кнопки) ===== */
.fgcs-bottombar{
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 10500;
  display: flex;
  gap: 12px;
  background: var(--tg-theme-secondary-bg-color, #1c1c1e);
  color: #fff;
  border-top: 0.5px solid rgba(120,120,128,0.22);
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
body[data-theme=light] .fgcs-bottombar{
  background: #f6f6f8;
  color: #000;
}
.fgcs-bottombar .fgcs-bb-btn{
  flex: 1;
  background: rgba(80,80,90,0.45);
  border: 0;
  display: flex;
  flex-direction: row;
  align-items: center; justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 24px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
}
body[data-theme=light] .fgcs-bottombar .fgcs-bb-btn{
  background: rgba(120,120,128,0.18);
  color: #000;
}
.fgcs-bottombar .fgcs-bb-btn:hover{ filter: brightness(1.1); }

/* ===== чекбокс-кружок absolute overlay слева — чат не двигается ===== */
.fgcs-host{ position: relative; }
.fgcs-host .fgcs-check-abs{
  position: absolute;
  left: 8px;
  width: 22px; height: 22px;
  border: 1.5px solid rgba(255,255,255,0.55);
  border-radius: 50%;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .12s, border-color .12s;
  pointer-events: none;
  z-index: 5;
}
body[data-theme=light] .fgcs-host .fgcs-check-abs{
  border-color: rgba(60,60,67,0.45);
}
.fgcs-host .fgcs-check-abs svg{ opacity: 0; transition: opacity .12s; }
.fgcs-host .fgcs-check-abs.on{
  background: #34c759;
  border-color: #34c759;
}
.fgcs-host .fgcs-check-abs.on svg{ opacity: 1; }
/* в select-mode сам бабл без обводки (выделение видно через чекбокс) */
.fgcs-host .ch-group-bubble.fgcs-selected,
.fgcs-host .ch-msg.fgcs-selected,
.fgcs-host .ch-saved-bubble.fgcs-selected{
  box-shadow: none;
}

/* ===== контекстное меню (ПК) ===== */
.fgcs-ctxmenu{
  position: fixed;
  z-index: 10600;
  background: #2c2c2e;
  color: #fff;
  border-radius: 10px;
  padding: 6px 0;
  min-width: 200px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  font-family: inherit;
  font-size: 14px;
  user-select: none;
}
body[data-theme=light] .fgcs-ctxmenu{
  background: #fff;
  color: #000;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
.fgcs-ctxmenu .fgcs-ctx-item{
  padding: 8px 16px;
  cursor: pointer;
}
.fgcs-ctxmenu .fgcs-ctx-item:hover{
  background: rgba(120,120,128,0.20);
}
body[data-theme=light] .fgcs-ctxmenu .fgcs-ctx-item:hover{
  background: rgba(60,60,67,0.08);
}

/* mobile action sheet — bottom slide-up (fgcs mobile-cleanup 2026-06-06) */
.fgcs-ctxmenu.fgcs-ctxmenu--sheet{
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  top: auto;
  width: auto;
  min-width: 0;
  border-radius: 14px;
  padding: 4px 0;
  animation: fgcsSheetIn .18s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes fgcsSheetIn{
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.fgcs-ctxmenu.fgcs-ctxmenu--sheet .fgcs-ctx-item{
  padding: 14px 18px;
  font-size: 16px;
  border-bottom: 0.5px solid rgba(120,120,128,0.18);
}
body[data-theme=light] .fgcs-ctxmenu.fgcs-ctxmenu--sheet .fgcs-ctx-item{
  border-bottom-color: rgba(60,60,67,0.12);
}
.fgcs-ctxmenu.fgcs-ctxmenu--sheet .fgcs-ctx-item:last-child{
  border-bottom: 0;
}

/* ===== reply/edit bar над composer ===== */
.fgcs-reply-bar,
.fgcs-edit-bar{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--tg-theme-secondary-bg-color, #2c2c2e);
  border-top: 0.5px solid rgba(120,120,128,0.22);
  font-family: inherit;
  font-size: 13px;
  color: var(--tg-theme-text-color, #fff);
}
body[data-theme=light] .fgcs-reply-bar,
body[data-theme=light] .fgcs-edit-bar{
  background: #f2f2f7;
  border-top-color: rgba(60,60,67,0.18);
  color: #000;
}
.fgcs-reply-bar .fgcs-rb-icon,
.fgcs-edit-bar  .fgcs-rb-icon{
  flex-shrink: 0;
  width: 22px; display: flex; align-items: center; justify-content: center;
}
.fgcs-reply-bar .fgcs-rb-body,
.fgcs-edit-bar  .fgcs-rb-body{
  flex: 1; min-width: 0;
  border-left: 2px solid #0a84ff;
  padding-left: 8px;
}
.fgcs-reply-bar .fgcs-rb-from,
.fgcs-edit-bar  .fgcs-rb-from{
  color: #0a84ff;
  font-weight: 600;
  font-size: 12px;
}
.fgcs-reply-bar .fgcs-rb-text,
.fgcs-edit-bar  .fgcs-rb-text{
  font-size: 12px;
  color: var(--tg-theme-hint-color, #9aa1ab);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fgcs-reply-bar .fgcs-rb-x,
.fgcs-edit-bar  .fgcs-rb-x{
  flex-shrink: 0;
  background: transparent; border: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--tg-theme-hint-color, #9aa1ab);
  cursor: pointer;
}

/* ===== forward overlay ===== */
.fgcs-forward-overlay{
  position: fixed; inset: 0;
  z-index: 10550;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center; justify-content: center;
  padding: 16px;
}
.fgcs-forward-overlay .fgcs-fw-card{
  background: #1c1c1e;
  color: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  border-radius: 14px;
  padding: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
body[data-theme=light] .fgcs-forward-overlay .fgcs-fw-card{
  background: #fff;
  color: #000;
}
.fgcs-forward-overlay .fgcs-fw-head{
  display: flex; align-items: center;
  padding: 10px 12px;
  gap: 8px;
  border-bottom: 0.5px solid rgba(120,120,128,0.22);
}
.fgcs-forward-overlay .fgcs-fw-x{
  background: transparent; border: 0;
  width: 32px; height: 32px;
  color: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.fgcs-forward-overlay .fgcs-fw-title{
  font-size: 15px; font-weight: 600;
}
.fgcs-forward-overlay .fgcs-fw-search{
  margin: 8px 12px;
  padding: 8px 12px;
  border: 1px solid rgba(120,120,128,0.24);
  background: rgba(120,120,128,0.10);
  color: inherit;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}
.fgcs-forward-overlay .fgcs-fw-list{
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.fgcs-forward-overlay .fgcs-fw-row{
  padding: 10px 14px;
  cursor: pointer;
  border-top: 0.5px solid rgba(120,120,128,0.14);
}
.fgcs-forward-overlay .fgcs-fw-row:hover{
  background: rgba(120,120,128,0.16);
}
.fgcs-forward-overlay .fgcs-fw-row-title{
  font-size: 14px; font-weight: 500;
}
.fgcs-forward-overlay .fgcs-fw-row-sub{
  font-size: 12px;
  color: var(--tg-theme-hint-color, #9aa1ab);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.fgcs-forward-overlay .fgcs-fw-loading{
  padding: 24px;
  text-align: center;
  color: var(--tg-theme-hint-color, #9aa1ab);
}

/* ===== маркер «изм.» в bub-meta после edit ===== */
.bub-meta .bub-edited{
  font-style: italic;
  opacity: .85;
  font-size: 10px;
}

/* ===== reply-цитата внутри бабла (TG-style) ===== */
.bub-reply{
  display: block;
  border-left: 3px solid rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.10);
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.3;
  max-width: 100%;
}
.bub-reply .bub-reply-from{
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bub-reply .bub-reply-text{
  opacity: 0.85;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* для theirs (серый бабл) — акцентная полоска синяя, текст по теме */
.ch-group-bubble.theirs .bub-reply,
.ch-msg.theirs .bub-reply{
  border-left-color: #0a84ff;
  background: rgba(10,132,255,0.10);
}
.ch-group-bubble.theirs .bub-reply .bub-reply-from,
.ch-msg.theirs .bub-reply .bub-reply-from{
  color: #0a84ff;
}
.ch-group-bubble.theirs .bub-reply .bub-reply-text,
.ch-msg.theirs .bub-reply .bub-reply-text{
  color: var(--tg-theme-text-color, #fff);
}
body[data-theme=light] .ch-group-bubble.theirs .bub-reply .bub-reply-text,
body[data-theme=light] .ch-msg.theirs .bub-reply .bub-reply-text{
  color: #000;
}
