/* Mavicovod Chat — поле ввода, голосовые, эмодзи, стикеры, GIF (в стиле Telegram) */

/* ---------- Поле ввода ---------- */
.panel-bottom-comments .comments.mv-cmp {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.mv-cmp svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mv-cmp-btn {
  position: static !important;
  flex: 0 0 40px;
  width: 40px; height: 44px;
  display: grid; place-items: center;
  padding: 0; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
  border-radius: 50%;
  transition: color .15s, background .15s;
}
.mv-cmp-btn:hover, .mv-cmp.is-pan .mv-cmp-emoji { color: var(--accent); }
.mv-cmp-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  border-radius: 22px;
  background: var(--surface-2, rgba(127,127,127,.12));
  border: 1px solid var(--line);
  transition: border-color .15s;
}
.mv-cmp-field:focus-within { border-color: var(--accent); }
.panel-bottom-comments .mv-cmp .comments-textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px !important;
  max-height: 150px !important;
  margin: 0 !important;
  padding: 11px 4px 11px 16px !important;
  border: 0 !important;
  border-radius: 22px !important;
  background: transparent !important;
  color: var(--text) !important;
  font-size: 15.5px !important;
  line-height: 1.35 !important;
  resize: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  overflow-y: auto;
}
.mv-cmp-field .mv-cmp-emoji { flex: 0 0 42px; height: 42px; }

.panel-bottom-comments .mv-cmp .mv-cmp-send,
.mv-cmp-mic {
  flex: 0 0 44px;
  width: 44px !important; height: 44px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center;
  background: var(--accent) !important;
  color: #fff !important;
  cursor: pointer;
  transition: transform .15s;
}
.mv-cmp .mv-cmp-send svg { fill: currentColor; stroke: none; width: 22px; height: 22px; margin-left: 3px; }
.mv-cmp-mic { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mv-cmp-mic svg { width: 23px; height: 23px; }
.mv-cmp:not(.has-text) .mv-cmp-send { display: none !important; }
.mv-cmp.has-text .mv-cmp-mic { display: none !important; }
.mv-cmp-send:active, .mv-cmp-mic:active { transform: scale(.92); }

/* ---------- Запись голосового ---------- */
.mv-rec, .mv-rec-lock { display: none; }
.mv-cmp.is-rec .mv-rec {
  position: absolute;
  left: 0; right: 52px; top: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 12px;
  border-radius: 22px;
  background: var(--header, var(--surface));
  transform: translateX(var(--rec-dx, 0));
}
.mv-cmp.is-rec .mv-rec[hidden] { display: flex; }
.mv-rec-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: #FF3B4E; animation: mv-blink 1s infinite; }
.mv-rec-time { flex: 0 0 auto; min-width: 38px; font: 600 15px/1 var(--font, system-ui); font-variant-numeric: tabular-nums; color: var(--text); }
.mv-rec-wave { flex: 1 1 auto; min-width: 40px; height: 30px; }
.mv-rec-hint { flex: 0 0 auto; font-size: 13.5px; color: var(--muted); white-space: nowrap; animation: mv-nudge 1.6s infinite; }
.mv-cmp.is-cancel .mv-rec-hint { color: #FF3B4E; }
.mv-rec-del, .mv-rec-send { display: none; }
.mv-cmp.is-locked .mv-rec-hint { display: none; }
.mv-cmp.is-locked .mv-rec-del,
.mv-cmp.is-locked .mv-rec-send {
  display: grid; place-items: center;
  flex: 0 0 40px; width: 40px; height: 40px;
  padding: 0; border: 0; border-radius: 50%;
  cursor: pointer;
}
.mv-cmp.is-locked .mv-rec-del { background: transparent; color: #FF3B4E; }
.mv-cmp.is-locked .mv-rec-send { background: var(--accent); color: #fff; }
.mv-cmp.is-locked .mv-rec-send svg { fill: currentColor; stroke: none; width: 20px; height: 20px; margin-left: 2px; }
.mv-cmp.is-locked .mv-rec { right: 0; }
.mv-cmp.is-locked .mv-cmp-mic { visibility: hidden; }
.mv-cmp.is-rec:not(.is-locked) .mv-cmp-mic { transform: scale(1.55); background: #FF3B4E !important; box-shadow: 0 0 0 10px rgba(255, 59, 78, .18); z-index: 4; }
.mv-cmp.is-rec-wait .mv-cmp-mic { opacity: .7; }
.mv-cmp.is-rec:not(.is-locked) .mv-rec-lock {
  position: absolute;
  right: 4px; bottom: 72px;
  z-index: 4;
  display: grid; justify-items: center;
  width: 36px; padding: 8px 0 6px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--pop-shadow, 0 6px 20px rgba(0,0,0,.2));
  color: var(--muted);
  animation: mv-up 1.4s infinite;
}
.mv-rec-lock svg { width: 18px; height: 18px; }
.mv-rec-lock i { font-style: normal; font-size: 12px; line-height: 1; margin-top: 2px; }
.mv-cmp.is-sending .mv-cmp-mic { animation: mv-pulse 1s infinite; pointer-events: none; }

@keyframes mv-blink { 50% { opacity: .25; } }
@keyframes mv-nudge { 50% { transform: translateX(-5px); } }
@keyframes mv-up { 50% { transform: translateY(-5px); } }
@keyframes mv-pulse { 50% { opacity: .5; } }

.mv-toast {
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 20;
  transform: translateX(-50%);
  padding: 8px 14px; border-radius: 99px;
  background: rgba(20, 24, 32, .92); color: #fff; font-size: 13.5px; white-space: nowrap;
  transition: opacity .4s;
}
.mv-toast.is-out { opacity: 0; }

/* ---------- Голосовое в переписке: длинное и низкое ---------- */
.mv-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(340px, 64vw);
  margin: 0;
  padding-right: 52px;
  color: var(--accent);
  box-sizing: border-box;
}
.mail-message-my-form .mv-voice { color: var(--bubble-my-ink, currentColor); }
.mv-voice-play {
  flex: 0 0 36px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff;
  cursor: pointer;
}
.mv-voice-play svg { width: 18px; height: 18px; fill: currentColor; }
.mv-voice-play .mv-i-play { margin-left: 2px; }
.mv-voice .mv-i-pause, .mv-voice.is-playing .mv-i-play { display: none; }
.mv-voice.is-playing .mv-i-pause { display: block; }
.mv-voice-body { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.mv-voice-wave { display: block; flex: 1 1 auto; min-width: 60px; height: 22px; cursor: pointer; }
.mv-voice-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; font-size: 12px; opacity: .85; }
.mv-voice-time { font-variant-numeric: tabular-nums; min-width: 28px; }
.mv-voice-lock { display: none; }
.mv-voice-speed {
  padding: 0 6px;
  border: 0; border-radius: 99px;
  background: color-mix(in srgb, currentColor 16%, transparent);
  color: inherit;
  font: 700 10.5px/1.6 var(--font, system-ui);
  cursor: pointer;
}
/* время сообщения — в той же строке, справа */
.mail-message-my-form:has(.mv-voice), .mail-message-user-form:has(.mv-voice) {
  position: relative;
  padding: 6px 10px 6px 6px !important;
}
.mail-message-my-form:has(.mv-voice) > .mess_time,
.mail-message-user-form:has(.mv-voice) > .mess_time {
  position: absolute;
  right: 8px; bottom: 6px;
  margin: 0;
  display: flex; align-items: center; gap: 0;
  line-height: 1;
}
.mail-message-my-form:has(.mv-voice) > .mess_time i,
.mail-message-user-form:has(.mv-voice) > .mess_time i { font-size: 14px !important; width: 10px !important; }
.mail-message-my-form:has(.mv-voice) > br, .mail-message-user-form:has(.mv-voice) > br { display: none; }

/* ---------- Стикеры и GIF в переписке ---------- */
.mv-sticker { display: block; width: 150px; max-width: 46vw; height: auto; image-rendering: auto; }
.mv-gif { display: block; max-width: min(280px, 70vw); max-height: 280px; border-radius: 12px; }
.mail-message-my-form:has(> .mv-sticker),
.mail-message-user-form:has(> .mv-sticker) {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.mail-message-my-form:has(> .mv-gif),
.mail-message-user-form:has(> .mv-gif) { padding: 4px !important; }
.mail-message-my-form:has(> .mv-sticker) .mess_time,
.mail-message-user-form:has(> .mv-sticker) .mess_time {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .35);
  color: #fff !important;
  opacity: 1 !important;
}
.mail-message-my-form:has(> .mv-gif) .mess_time { padding: 0 6px; }

/* ---------- Панель эмодзи / стикеров / GIF ---------- */
.mv-pan {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  height: min(380px, 52vh);
  background: var(--surface);
  color: var(--text);
  border-radius: 16px;
  box-shadow: var(--pop-shadow, 0 12px 36px rgba(0,0,0,.25));
  overflow: hidden;
  animation: mv-pan-in .16s ease-out;
}
.mv-pan[hidden] { display: none; }
@keyframes mv-pan-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 799.98px) {
  .mv-pan { border-radius: 16px 16px 0 0; height: min(340px, 46vh); }
}
.mv-pan-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mv-pan-page { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mv-pan-page[hidden] { display: none; }
.mv-pan-cats {
  flex: 0 0 auto;
  display: flex; gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.mv-pan-cats button {
  flex: 0 0 34px; width: 34px; height: 34px;
  display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 9px;
  background: transparent;
  font-size: 19px; line-height: 1;
  cursor: pointer;
  filter: grayscale(.6); opacity: .75;
}
.mv-pan-cats button img { width: 26px; height: 26px; object-fit: contain; }
.mv-pan-cats button:hover, .mv-pan-cats button.is-on { background: var(--accent-soft, rgba(0,119,255,.1)); filter: none; opacity: 1; }
.mv-pan-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 10px; scrollbar-width: thin; }
.mv-pan-h { position: sticky; top: -4px; z-index: 1; padding: 8px 4px 4px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.mv-emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.mv-emo-i {
  height: 40px;
  padding: 0; border: 0; border-radius: 10px;
  background: transparent;
  font-size: 27px; line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  cursor: pointer;
  transition: transform .1s;
}
.mv-emo-i:hover { background: var(--accent-soft, rgba(0,119,255,.1)); transform: scale(1.15); }
.mv-st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 4px; }
.mv-st-i { aspect-ratio: 1; padding: 6px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.mv-st-i:hover { background: var(--accent-soft, rgba(0,119,255,.1)); }
.mv-st-i img { width: 100%; height: 100%; object-fit: contain; }
.mv-gif-search { flex: 0 0 auto; padding: 8px; }
.mv-gif-search[hidden] { display: none; }
.mv-gif-search input {
  width: 100%; box-sizing: border-box;
  height: 36px; padding: 0 14px !important;
  border: 0 !important; border-radius: 18px !important;
  background: var(--surface-2, rgba(127,127,127,.12)) !important;
  color: var(--text) !important; font-size: 14.5px !important;
}
.mv-gif-grid { columns: 2 130px; column-gap: 4px; }
.mv-gif-i { display: block; width: 100%; margin: 0 0 4px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: pointer; break-inside: avoid; }
.mv-gif-i img { display: block; width: 100%; height: auto; }
.mv-pan-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.mv-pan-tabs {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}
.mv-pan-tabs button {
  height: 32px; padding: 0 14px;
  border: 0; border-radius: 99px;
  background: transparent; color: var(--muted);
  font: 600 13.5px var(--font, system-ui);
  cursor: pointer;
}
.mv-pan-tabs button.is-on { background: var(--accent-soft, rgba(0,119,255,.1)); color: var(--accent); }
.mv-pan-tabs .mv-pan-x { position: absolute; right: 8px; width: 32px; padding: 0; font-size: 15px; }
.mv-pan-tabs { position: relative; }

/* ---------- Галочки статуса сообщения ---------- */
.mv-tick { display: inline-flex; align-items: center; vertical-align: -2px; margin: 0 1px 0 3px; }
.mv-tick svg { width: 17px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mv-tick.is-sent .mv-tick-2 { display: none; }
.mv-tick.is-sent svg { width: 13px; }
.mv-tick.is-read { color: #3DA2FF; opacity: 1; }
.mail-message-my-form .mess_time .mv-tick.is-read { color: #3DA2FF; }
html:not(:has(#design-stylesheet)) .mail-message-my-form .mess_time .mv-tick.is-read { color: #0A7BFF; }
.mail-mess-eye .mv-tick { margin: 0; }
.mail-mess-eye:has(.mv-tick) { background: transparent !important; color: var(--muted) !important; }
.mail-mess-eye .mv-tick.is-read { color: #3DA2FF; }
.mail-message-eye { display: none !important; }
.mail-message-my-form .mess_time { opacity: 1 !important; color: color-mix(in srgb, var(--bubble-my-ink, #000) 55%, transparent) !important; }
.mail-message-my-form .mess_time .mv-tick.is-read { color: #0A84FF !important; }
html:has(#design-stylesheet) .mail-message-my-form .mess_time .mv-tick.is-read { color: #5AB8FF !important; }
/* старый значок «глаз» больше не нужен */
.mail-message-eye, .mail-message-my > .mail-message-eye { display: none !important; }
a.mv-cmp-btn { text-decoration: none !important; }

/* ---------- Оформление в сообщениях (как в Telegram) ---------- */
.mv-quote {
  display: block;
  position: relative;
  margin: 3px 0 5px;
  padding: 5px 26px 5px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 4px 8px 8px 4px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: .95em;
  line-height: 1.4;
}
.mv-quote::after { content: '❞'; position: absolute; right: 7px; top: 3px; font-size: 14px; opacity: .45; color: var(--accent); }
.mail-message-my-form .mv-quote { border-left-color: currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }
.mail-message-my-form .mv-quote::after { color: currentColor; }
.mv-code {
  padding: 1px 5px;
  border-radius: 5px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
  white-space: pre-wrap;
  cursor: copy;
}
.mv-spoiler {
  border-radius: 4px;
  background: currentColor;
  color: transparent !important;
  cursor: pointer;
  transition: background .25s, color .25s;
  -webkit-user-select: none; user-select: none;
  background-image: radial-gradient(circle, rgba(255,255,255,.35) 1px, transparent 1.2px);
  background-size: 4px 4px;
}
.mv-spoiler * { color: transparent !important; }
.mv-spoiler.is-open { background: color-mix(in srgb, currentColor 10%, transparent); color: inherit !important; -webkit-user-select: text; user-select: text; cursor: text; }
.mv-spoiler.is-open * { color: inherit !important; }
.mv-spoiler { background-color: color-mix(in srgb, var(--text, #888) 55%, transparent); }

/* Ответ на сообщение внутри пузыря */
.mail-message-my-form .messages_reply.mv-reply,
.mail-message-user-form .messages_reply.mv-reply,
.messages_reply.mv-reply {
  display: block;
  margin: 0 0 5px;
  padding: 4px 10px 5px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 4px 8px 8px 4px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 13.5px;
  line-height: 1.3;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
}
.mv-reply b { display: block; color: var(--accent); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-reply span { display: block; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-message-my-form .mv-reply { border-left-color: currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }
.mail-message-my-form .mv-reply b { color: inherit; }
.mv-reply.is-gone { cursor: default; opacity: .7; }
.mv-reply.is-gone b { font-weight: 500; font-style: italic; }

/* Подсветка исходного сообщения и свайп */
[id^="blink"].mv-flash .mail-message-my-form,
[id^="blink"].mv-flash .mail-message-user-form { animation: mv-flash 1.2s ease-out; }
@keyframes mv-flash { 0%, 40% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.mail-message-my-form, .mail-message-user-form { position: relative; }
.mv-swipe-ready::after {
  content: '↩';
  position: absolute; right: -34px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 14px;
}

/* Плашка «В ответ …» над полем ввода */
.reply.mv-reply-bar {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  padding: 6px 8px 6px 10px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
.mv-reply-ico { flex: 0 0 22px; width: 22px; height: 22px; fill: var(--accent); }
.mv-reply-txt { flex: 1 1 auto; min-width: 0; padding-left: 10px; border-left: 2px solid var(--accent); line-height: 1.3; }
.mv-reply-txt b { display: block; color: var(--accent); font-size: 13.5px; font-weight: 650; }
.mv-reply-txt span { display: block; font-size: 13.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply.mv-reply-bar .reply-close { position: static !important; flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); cursor: pointer; }
.reply.mv-reply-bar .reply-close:hover { background: var(--surface-2); color: var(--text); }

/* Панель оформления над полем ввода */
.mv-fmt {
  position: fixed;
  z-index: 1300;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: #1F2633;
  box-shadow: 0 8px 26px rgba(0,0,0,.3);
  animation: mv-pan-in .12s ease-out;
}
.mv-fmt[hidden] { display: none; }
.mv-fmt button {
  min-width: 34px; height: 34px;
  display: grid; place-items: center;
  padding: 0 6px; border: 0; border-radius: 8px;
  background: transparent; color: #fff;
  font: 600 15px var(--font, system-ui);
  cursor: pointer;
}
.mv-fmt button:hover { background: rgba(255,255,255,.14); }
.mv-fmt button code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: none; color: inherit; }
.mv-fmt button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mv-fmt-sp { letter-spacing: -1px; opacity: .8; }

/* Кнопка «Цитировать» у выделенного текста */
.mv-qbtn {
  position: fixed;
  z-index: 1300;
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 0; border-radius: 99px;
  background: #1F2633; color: #fff;
  font: 600 13.5px var(--font, system-ui);
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
  cursor: pointer;
}
.mv-qbtn[hidden] { display: none; }
.mv-qbtn svg { width: 16px; height: 16px; fill: currentColor; }

/* ===================== Групповые чаты ===================== */
.gc-wrap { max-width: 760px; margin: 0 auto; }
.gc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; }
.gc-head h1, .gc-head h2 { margin: 0; font-size: 20px; }
.gc-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--accent, #2F9BFF); color: #fff !important; font-weight: 600; font-size: 14px; text-decoration: none; }
.gc-list { display: flex; flex-direction: column; }
.gc-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: inherit !important; text-decoration: none; border-bottom: 1px solid var(--line, rgba(127,127,127,.15)); transition: background .12s; }
.gc-item:hover { background: var(--surface-2, rgba(127,127,127,.08)); }
.gc-item-body { flex: 1; min-width: 0; }
.gc-item-top { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.gc-item-top > b, .gc-item-top > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-item-top time, .gc-item-top .gc-time { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted, #8a94a6); flex: none; }
.gc-item-last { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 13.5px; color: var(--muted, #8a94a6); }
.gc-item-last > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-chan, .gc-mute { font-size: 12px; opacity: .7; flex: none; }
.gc-badge { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent, #2F9BFF); color: #fff; font: 700 12px/22px system-ui; text-align: center; }
.gc-badge.is-muted { background: #9aa3b2; }
.gc-ava { flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; text-transform: uppercase; user-select: none; }
.gc-empty { padding: 50px 20px; text-align: center; color: var(--muted, #8a94a6); }
.gc-empty b { display: block; font-size: 17px; color: var(--text, inherit); margin-bottom: 6px; }

/* Шапка чата */
.gc-chat { position: relative; padding-bottom: 76px; }
.gc-bar { position: sticky; top: var(--top-h, 56px); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--header, var(--surface)); border-bottom: 1px solid var(--line, rgba(127,127,127,.15)); }
.gc-back { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text) !important; }
.gc-back:hover, .gc-bar-btn:hover { background: var(--surface-2, rgba(127,127,127,.1)); }
.gc-bar-info { flex: 1; min-width: 0; display: block; background: none; border: 0; padding: 0; color: var(--text, inherit); text-align: left; cursor: pointer; font: inherit; }
.gc-bar-info b { display: block; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-bar-info span, .gc-bar-info small { display: block; font-size: 13px; color: var(--muted, #8a94a6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-bar-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--muted, inherit); }
.gc-bar-btn:hover { color: var(--text); }
/* Закреплённое */
.gc-pin { position: sticky; top: calc(var(--top-h, 56px) + 57px); z-index: 29; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 14px; background: var(--header, var(--surface)); border-bottom: 1px solid var(--line, rgba(127,127,127,.15)); cursor: pointer; }
.gc-pin[hidden] { display: none; }
.gc-pin::before { content: ''; flex: none; width: 3px; align-self: stretch; border-radius: 2px; background: var(--accent, #2F9BFF); }
.gc-pin-ico { flex: none; color: var(--accent); font-style: normal; order: 3; opacity: .7; }
.gc-pin > span { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.3; }
.gc-pin b { display: block; color: var(--accent, #2F9BFF); font-size: 13px; }
.gc-pin em { display: block; font-style: normal; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-pin-x { order: 4; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--muted, #8a94a6); cursor: pointer; }
.gc-pin-x:hover { background: var(--surface-2, rgba(127,127,127,.1)); }

/* Сообщения */
.gc-list-msgs { padding: 6px 8px 10px; }
.gc-more { text-align: center; padding: 10px 0 2px; }
.gc-more .gc-btn, .gc-more button { height: 32px; border: 0; border-radius: 99px; padding: 0 16px; background: var(--surface-2, rgba(127,127,127,.12)); color: var(--text, inherit) !important; font: 600 13px var(--font, system-ui); cursor: pointer; }
.gc-day { display: flex; justify-content: center; margin: 14px 0 8px; position: sticky; top: calc(var(--top-h, 56px) + 62px); z-index: 5; pointer-events: none; }
.gc-day span { padding: 4px 12px; border-radius: 99px; background: var(--surface-2, rgba(0,0,0,.28)); color: var(--text-2, var(--muted)); font-size: 12.5px; font-weight: 600; box-shadow: var(--card-shadow, none); }
.gc-row { position: relative; display: flex; align-items: flex-start; gap: 8px; margin-top: 2px; }
.gc-row.is-first { margin-top: 10px; }
.gc-row.is-mine { flex-direction: row-reverse; }
.gc-row > .mail-message-my, .gc-row > .mail-message-user { max-width: min(80%, 540px); margin: 0 !important; float: none !important; width: auto !important; text-align: left; }
.gc-row .mail-message-my-form, .gc-row .mail-message-user-form { display: block; min-width: 76px; }
.gc-row:not(.is-first).is-mine .mail-message-my-form { border-top-right-radius: 8px !important; }
.gc-row:not(.is-first):not(.is-mine) .mail-message-user-form { border-top-left-radius: 8px !important; }
.gc-row .mess_time { display: flex !important; justify-content: flex-end; align-items: center; gap: 3px; margin-top: 2px; font-size: 11.5px; float: none !important; }
.gc-uava { flex: none; width: 36px; }
.gc-uava img, .gc-uava .avatar, .gc-uava a > * { width: 36px !important; height: 36px !important; border-radius: 50% !important; object-fit: cover; display: block; }
.gc-author { font-weight: 700; font-size: 13.5px; line-height: 1.3; margin-bottom: 2px; }
.gc-act { align-self: center; flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s; }
.gc-act svg { width: 18px; height: 18px; fill: currentColor; }
.gc-row:hover .gc-act, .gc-act:focus-visible { opacity: 1; }
.gc-act:hover { background: var(--surface-2, rgba(127,127,127,.12)); color: var(--text); }
@media (pointer: coarse) { .gc-act { display: none; } }
.gc-reply-hook { display: none !important; }
.gc-row .mv-reply { border-left-color: var(--gc-c, var(--accent)) !important; }
.gc-row .mv-reply b { color: var(--gc-c, var(--accent)); }
.gc-row.mv-flash .mail-message-my-form, .gc-row.mv-flash .mail-message-user-form { animation: mv-flash 1.2s ease-out; }
.gc-readonly { margin: 10px; padding: 12px; border-radius: 12px; text-align: center; background: var(--surface-2, rgba(127,127,127,.1)); color: var(--muted, #8a94a6); font-size: 14px; }
.gc-chat > .list2 { padding: 60px 20px; }

/* Меню сообщения */
.gc-menu { position: fixed; z-index: 1400; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--surface, #fff); color: var(--text, #111); box-shadow: 0 12px 34px rgba(0,0,0,.25); animation: mv-pan-in .12s ease-out; }
.gc-menu[hidden] { display: none; }
.gc-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: inherit; font: 500 14.5px system-ui; text-align: left; cursor: pointer; }
.gc-menu button:hover { background: var(--surface-2, rgba(127,127,127,.12)); }
.gc-menu button.is-danger { color: #e5484d; }

/* Окна */
.gc-modal { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.45); }
.gc-modal-card { position: relative; width: min(420px, 100%); max-height: 80vh; overflow: auto; padding: 18px 18px 12px; border-radius: 16px; background: var(--surface, #fff); color: var(--text, #111); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.gc-modal-card h3 { margin: 0 34px 6px 0; font-size: 18px; }
.gc-modal-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted, #8a94a6); font-size: 16px; cursor: pointer; }
.gc-modal-x:hover { background: var(--surface-2, rgba(127,127,127,.12)); }
.gc-sec { margin: 12px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #8a94a6); }
.gc-muted { color: var(--muted, #8a94a6); font-size: 13.5px; margin: 4px 0; }
.gc-user { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 8px; color: inherit !important; text-decoration: none; font-size: 14.5px; }
.gc-user:hover { background: var(--surface-2, rgba(127,127,127,.1)); }
.gc-user em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--accent, #2F9BFF); }
.gc-user .mv-tick { margin-left: auto; }
.gc-user.is-dim { opacity: .6; }
.gc-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa3b2; flex: none; }
.gc-dot.is-on { background: #34c759; }
.gc-toast { position: fixed; left: 50%; bottom: 90px; z-index: 1600; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: #1F2633; color: #fff; font-size: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.3); transition: opacity .4s; }
.gc-toast.is-out { opacity: 0; }

/* Админка групп */
.gca-group { display: flex; align-items: center; gap: 12px; }
.gca-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gca-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 99px; background: rgba(127,127,127,.12); font-size: 13px; }
.gca-chip a { text-decoration: none; }
.gca-chip.is-mod { background: rgba(47,155,255,.15); }

.gc-bar-btn .gc-ic-off, .gc-bar-btn.is-muted .gc-ic-on { display: none; }
.gc-bar-btn.is-muted .gc-ic-off { display: inline; }

/* ---------- Группы: разделы, метки, открытые группы ---------- */
.gc-sec { margin-bottom: 18px; }
.gc-sec-title { display: flex; align-items: center; gap: 8px; margin: 4px 2px 10px; font-size: 15px; font-weight: 700; color: var(--text, inherit); }
.gc-sec-title i { color: var(--accent, #2F9BFF); }
.gc-sec-title small { font-weight: 400; font-size: 12.5px; color: var(--muted, #8a94a6); }
.gc-label { display: inline-flex; align-items: center; height: 19px; padding: 0 8px; border-radius: 99px; font-style: normal; font-size: 11.5px; font-weight: 600; white-space: nowrap; flex: none;
  color: var(--gc-l, #2F9BFF); background: color-mix(in srgb, var(--gc-l, #2F9BFF) 14%, transparent); }
.gc-bar-info b .gc-label { margin-left: 4px; vertical-align: 1px; }
.gc-item-period { display: flex; align-items: center; gap: 5px; margin-top: 1px; font-size: 12px; color: var(--muted, #8a94a6); }
.gc-item.is-guest { opacity: .92; }
.gc-join-chip { flex: none; margin-left: 8px; padding: 2px 10px; border-radius: 99px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--accent, #2F9BFF); background: color-mix(in srgb, var(--accent, #2F9BFF) 12%, transparent); }
.gc-join { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.gc-btn-main { height: 34px; }

/* ---------- Закреплённое сообщение в личной переписке ---------- */
.mmp-bar { position: sticky; top: calc(var(--top-h, 56px) + 57px); z-index: 29; display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 7px 8px 7px 12px; border-radius: 12px; background: var(--surface, #fff); box-shadow: var(--card-shadow, 0 1px 3px rgba(0,0,0,.08)); cursor: pointer; }
.mmp-bar[hidden] { display: none; }
.mmp-bar::before { content: ''; flex: none; width: 3px; align-self: stretch; border-radius: 2px; background: var(--accent, #2F9BFF); }
.mmp-ico { flex: none; font-size: 15px; }
.mmp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mmp-t b { font-size: 12.5px; color: var(--accent, #2F9BFF); }
.mmp-t em { font-style: normal; font-size: 13.5px; color: var(--text, inherit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmp-x { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted, #8a94a6) !important; text-decoration: none !important; font-size: 14px; }
.mmp-x:hover { background: var(--surface-2, rgba(127,127,127,.12)); color: var(--text, inherit) !important; }
@media (max-width: 760px) { .mmp-bar { top: calc(var(--top-h, 56px) + 4px); } }
