/* Toast */
.pn-toast-root {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: min(360px, calc(100vw - 32px));
}

.pn-toast {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: 12px;
    background: #2f2f2f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    line-height: 1.35;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    animation: pn-toast-in 0.2s ease;
}

.pn-toast--error {
    border-color: rgba(255, 90, 90, 0.35);
    background: #3a2228;
}

.pn-toast--success {
    border-color: rgba(90, 200, 120, 0.35);
    background: #223a2a;
}

@keyframes pn-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Inbox-style message notifications (top-right) */
.pn-notify-root {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100070;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: min(380px, calc(100vw - 32px));
}

.pn-notify-card {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: #2a2a2a;
    color: #fff;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    transition: opacity 0.2s ease, transform 0.2s ease;
    animation: pn-notify-in 0.22s ease;
}

.pn-notify-card:hover {
    background: #353535;
}

.pn-notify-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #6b4164;
}

.pn-notify-card__text {
    min-width: 0;
    flex: 1;
}

.pn-notify-card__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.92);
}

.pn-notify-card__body {
    font-size: 13px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.82);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@keyframes pn-notify-in {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .pn-notify-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Confirm dialog */
.pn-confirm-root {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10040;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pn-confirm-root.is-open {
    display: flex;
}

.pn-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.pn-confirm-dialog {
    position: relative;
    width: min(420px, 100%);
    background: #333;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px;
    color: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.pn-confirm-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pn-confirm-message {
    font-size: 14px;
    line-height: 1.45;
    opacity: 0.92;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.pn-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pn-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    color: #fff;
}

.pn-btn--ghost {
    background: #444;
}

.pn-btn--ghost:hover {
    background: #555;
}

.pn-btn--primary {
    background: #552C5B;
}

.pn-btn--primary:hover {
    background: #6a3880;
}

.pn-btn--danger {
    background: #8b2e2e;
}

.pn-btn--danger:hover {
    background: #a63636;
}

/* Composer edit bar (Telegram-style) */
.composer-edit-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(85, 44, 91, 0.28);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px 12px 0 0;
}

.composer-edit-bar.is-visible {
    display: flex;
}

.composer-edit-bar__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(85, 44, 91, 0.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
}

.composer-edit-bar__body {
    flex: 1;
    min-width: 0;
}

.composer-edit-bar__title {
    font-size: 13px;
    font-weight: 600;
    color: #c99bd0;
    line-height: 1.2;
}

.composer-edit-bar__preview {
    font-size: 13px;
    opacity: 0.75;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
    margin-top: 2px;
}

.composer-edit-bar__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
}

.composer-edit-bar__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

/* Friends context menu — groups list */
.umSectionLabel {
    padding: 6px 12px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.55;
    user-select: none;
}

.umGroupsList {
    max-height: 180px;
    overflow-y: auto;
}

.umGroupItem {
    display: flex;
    align-items: center;
    gap: 8px;
}

.umGroupBadge {
    width: 10px;
    height: 10px;
    border-radius: 4px;
    flex-shrink: 0;
}

.umGroupTitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.umHint {
    padding: 8px 12px;
    font-size: 13px;
    opacity: 0.65;
    line-height: 1.35;
}

body.page-split-layout #chatComposer .composer-edit-bar,
body.page-split-layout #channelComposer .composer-edit-bar {
    border-radius: 0;
}

/* Пузыри в чатах и каналах (общие классы) */
.msg-bubble__author {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    color: #c9a0ff;
    margin: 0 0 4px;
}

.msg-bubble__channel {
    font-size: 12px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 4px;
}

.msg-bubble__link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.msg-bubble__link:hover,
.msg-bubble__link:focus-visible {
    text-decoration: underline;
    outline: none;
}

.msg-bubble__link--channel {
    color: #d4b8e8;
    font-weight: 600;
}

.msg-bubble__link--author {
    color: #c9a0ff;
    font-weight: 600;
}

.msg-bubble__text {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

.msg-fmt-bold { font-weight: 700; }
.msg-fmt-italic { font-style: italic; }
.msg-fmt-underline { text-decoration: underline; }
.msg-fmt-strike { text-decoration: line-through; opacity: 0.85; }

.msg-fmt-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: rgba(0, 0, 0, 0.28);
    padding: 1px 5px;
    border-radius: 4px;
}

.msg-fmt-pre {
    display: block;
    margin: 6px 0 2px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.32);
    overflow-x: auto;
    white-space: normal;
    word-break: break-word;
}

.msg-fmt-pre__lang {
    display: block;
    margin: 0 0 6px;
    padding: 0 0 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78em;
    font-weight: 600;
    opacity: 0.7;
    text-transform: lowercase;
}

.msg-fmt-pre code.msg-fmt-code--block {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
    background: none;
    padding: 0;
    border-radius: 0;
}

.msg-fmt-pre .msg-fmt-bold,
.msg-fmt-code .msg-fmt-bold { font-weight: 700; }

.msg-fmt-pre .msg-fmt-italic,
.msg-fmt-code .msg-fmt-italic { font-style: italic; }

.msg-fmt-pre .msg-fmt-underline,
.msg-fmt-code .msg-fmt-underline { text-decoration: underline; }

.msg-fmt-pre .msg-fmt-strike,
.msg-fmt-code .msg-fmt-strike { text-decoration: line-through; opacity: 0.85; }

.msg-fmt-pre .msg-fmt-spoiler,
.msg-fmt-code .msg-fmt-spoiler {
  background: rgba(80, 80, 80, 0.95);
  color: rgba(80, 80, 80, 0.95);
}

.msg-fmt-pre .msg-fmt-spoiler.is-revealed,
.msg-fmt-code .msg-fmt-spoiler.is-revealed {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}

.msg-fmt-pre .msg-fmt-link,
.msg-fmt-code .msg-fmt-link {
  color: #8eb4ff;
  text-decoration: underline;
}

.msg-fmt-link {
    color: #8eb4ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.msg-fmt-spoiler {
    background: rgba(80, 80, 80, 0.95);
    color: rgba(80, 80, 80, 0.95);
    border-radius: 3px;
    padding: 0 2px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.msg-fmt-spoiler.is-revealed {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}

.msg-fmt-quote {
  margin: 6px 0 2px;
  padding: 4px 0 4px 12px;
  border-left: 3px solid rgba(201, 155, 208, 0.65);
  opacity: 0.95;
}

.msg-fmt-spoiler--edit {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: default;
}

/* Rich composer */
textarea.composer-rich-input,
.composer-rich-input--markdown {
  resize: none;
  font-family: inherit;
}

.composer-rich-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 40px;
  max-height: 314px;
  margin: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background-color: #552C5B;
  color: #fff;
  font: inherit;
  font-size: 15px;
  line-height: 1.35;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-sizing: border-box;
  outline: none;
  caret-color: #fff;
}

.composer-rich-input:empty::before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.composer-rich-input--press-hint {
  box-shadow: inset 0 0 0 2px rgba(218, 111, 212, 0.45);
}

.composer-rich-input--press-active,
.composer-rich-input--menu-open {
  box-shadow: inset 0 0 0 2px rgba(218, 111, 212, 0.95);
  -webkit-touch-callout: none;
}

@media (pointer: coarse) {
  .composer-ctx-item__kbd {
    display: none;
  }
}

.pn-touch-press-hint {
  outline: 2px solid rgba(218, 111, 212, 0.45);
  outline-offset: -2px;
}

.pn-touch-press-active {
  outline: 2px solid rgba(218, 111, 212, 0.95);
  outline-offset: -2px;
}

/* Composer toolbar (attach / emoji / voice) */
.composer-post {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.composer-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.composer-tool {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  align-self: flex-end;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.composer-tool:hover,
.composer-tool:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

.composer-tool--send {
  background: rgba(218, 111, 212, 0.9);
  color: #fff;
  font-size: 17px;
}

.composer-tool--send:hover {
  background: rgba(218, 111, 212, 1);
}

.composer-tool[hidden] {
  display: none !important;
}

.composer-tool--voice.is-recording {
  background: #e85d8a;
  color: #fff;
  animation: composer-rec-pulse 0.9s ease-in-out infinite;
}

.composer-tool--voice.is-recording-locked {
  background: rgba(218, 111, 212, 0.95);
  animation: none;
}

.composer-tool.is-active {
  background: rgba(218, 111, 212, 0.35);
}

@keyframes composer-rec-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.composer-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-bottom: 6px;
  box-sizing: border-box;
}

.composer-pending[hidden] {
  display: none !important;
}

.composer-pending__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
}

.composer-pending__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.composer-pending__remove {
  border: none;
  background: none;
  color: #fff;
  opacity: 0.7;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.composer-pending__thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.composer-attach-menu {
  position: fixed;
  z-index: 10050;
  min-width: 180px;
  padding: 6px 0;
  border-radius: 10px;
  background: rgba(32, 24, 38, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.composer-attach-menu[hidden] {
  display: none !important;
}

.composer-attach-menu__item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.composer-attach-menu__item:hover,
.composer-attach-menu__item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.composer-pending__icon {
  font-size: 18px;
  line-height: 1;
}

.composer-emoji-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  padding: 10px 10px 12px;
  box-sizing: border-box;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.28);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.composer-emoji-panel[hidden] {
  display: none !important;
}

.composer-emoji-panel__btn {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1.1;
  padding: 6px;
  margin: 0;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.composer-emoji-panel__btn:hover,
.composer-emoji-panel__btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

#chatComposer .composer-tool,
#channelComposer .composer-tool {
  margin: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

#chatComposer .composer-tool--send,
#channelComposer .composer-tool--send {
  background: rgba(218, 111, 212, 0.9);
  color: #fff;
}

/* Message attachments */
.msg-bubble--has-attach {
  padding: 4px 4px 5px;
}

.msg-bubble--has-attach > .msg-bubble__text {
  padding: 4px 6px 0;
}

.msg-bubble--has-attach > .msg-bubble__meta {
  padding: 0 6px 2px;
}

.msg-attach {
  margin: 0 0 4px;
  max-width: 100%;
}

.msg-attach__img-btn {
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: 10px;
  overflow: hidden;
  max-width: min(320px, 100%);
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.msg-attach__img-btn:focus-visible {
  outline: 2px solid rgba(218, 111, 212, 0.7);
  outline-offset: 2px;
}

.msg-attach__img {
  display: block;
  width: 100%;
  max-width: min(320px, 100%);
  max-height: 360px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.2);
}

.msg-attach__img-btn .msg-attach__album-img,
.msg-attach__album-cell .msg-attach__img-btn {
  max-width: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.msg-attach__album-cell .msg-attach__img-btn {
  position: absolute;
  inset: 0;
  border-radius: 0;
}

.msg-attach__album-cell .msg-attach__img-btn .msg-attach__album-img {
  max-height: none;
  min-height: 100%;
}

.msg-attach__album {
  display: grid;
  gap: 2px;
  width: min(320px, 100%);
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.msg-attach__album-cell {
  position: relative;
  min-height: 72px;
  min-width: 0;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.msg-attach__album-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.msg-attach__album-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.msg-attach__video {
  display: block;
  width: 100%;
  max-width: min(320px, 100%);
  max-height: 360px;
  border-radius: 10px;
  background: #1a1a1a;
}

/* Voice chip in message bubble */
.msg-attach--voice {
  width: 100%;
  min-width: 220px;
}

.msg-voice-inline,
.msg-voice-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 220px;
  max-width: 320px;
  padding: 10px 14px;
  box-sizing: border-box;
  border-radius: 14px;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.msg-voice-inline--mine,
.msg-voice-chip--mine {
  background: rgba(0, 0, 0, 0.2);
}

.msg-voice-inline--other,
.msg-voice-chip--other {
  background: rgba(0, 0, 0, 0.3);
}

.msg-voice-inline.is-active {
  box-shadow: 0 0 0 1px rgba(218, 111, 212, 0.55);
}

.msg-voice-inline__play,
.msg-voice-chip__icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(218, 111, 212, 0.9);
  font-size: 12px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  padding: 0;
}

.msg-voice-inline__play.is-playing {
  font-size: 10px;
  letter-spacing: -1px;
}

.msg-voice-inline__track,
.msg-voice-chip__wave {
  flex: 1 1 auto;
  min-width: 48px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.msg-voice-inline__fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.55) 0 3px,
    rgba(255, 255, 255, 0.15) 3px 6px
  );
  border-radius: 4px;
  pointer-events: none;
}

.msg-voice-chip__wave {
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.55) 0 3px,
    rgba(255, 255, 255, 0.15) 3px 6px
  );
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}

.msg-voice-inline__time,
.msg-voice-chip__dur {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

/* Dock player under chat top (Telegram-style) */
.voice-dock {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #3a2d42 0%, #2e2434 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 4;
}

.voice-dock[hidden] {
  display: none !important;
}

.voice-dock.voice-dock--closing {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.voice-dock:not(.voice-dock--closing) {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.voice-dock__close {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.voice-dock__play {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(218, 111, 212, 0.95);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.voice-dock__play.is-playing {
  font-size: 12px;
  letter-spacing: -1px;
}

.voice-dock__main {
  flex: 1 1 0;
  min-width: 140px;
  max-width: 100%;
}

.voice-dock__title {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-dock__track {
  display: block;
  width: 100%;
  min-width: 120px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  overflow: hidden;
}

.voice-dock__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #da6fd4, #c9a0ff);
  border-radius: 3px;
}

.voice-dock__time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.voice-dock__speed {
  flex: 0 0 auto;
  min-width: 40px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.voice-dock__vol-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.voice-dock__vol-icon {
  font-size: 14px;
  opacity: 0.8;
}

.voice-dock__volume {
  width: 56px;
  height: 4px;
  accent-color: #da6fd4;
}

/* Recording bar above composer */
.voice-record {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(232, 93, 138, 0.35) 0%, rgba(85, 44, 91, 0.5) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.voice-record[hidden] {
  display: none !important;
}

.voice-record--locked {
  background: linear-gradient(180deg, rgba(218, 111, 212, 0.4) 0%, rgba(85, 44, 91, 0.55) 100%);
}

.voice-record__cancel,
.voice-record__lock,
.voice-record__send {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.voice-record__send {
  background: rgba(218, 111, 212, 0.95);
  font-size: 20px;
}

.voice-record__center {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.voice-record__pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4d6d;
  animation: composer-rec-pulse 0.8s ease-in-out infinite;
}

.voice-record__timer {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.voice-record__hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

/* Fullscreen image viewer */
.plum-media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(8, 6, 12, 0.92);
  backdrop-filter: blur(6px);
}

.plum-media-lightbox[hidden] {
  display: none !important;
}

.plum-media-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}

.plum-media-lightbox__close,
.plum-media-lightbox__prev,
.plum-media-lightbox__next {
  position: absolute;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.plum-media-lightbox__close {
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
}

.plum-media-lightbox__prev,
.plum-media-lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 32px;
  line-height: 1;
}

.plum-media-lightbox__prev {
  left: 12px;
}

.plum-media-lightbox__next {
  right: 12px;
}

.plum-media-lightbox__prev:disabled,
.plum-media-lightbox__next:disabled {
  opacity: 0.35;
  cursor: default;
}

.plum-media-lightbox__prev[hidden],
.plum-media-lightbox__next[hidden] {
  display: none;
}

.msg-attach__file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  text-decoration: none;
}

.msg-attach__file:hover {
  background: rgba(0, 0, 0, 0.3);
}

.msg-attach__file-icon {
  font-size: 24px;
  line-height: 1;
}

.msg-attach__file-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  word-break: break-word;
}

.msg-attach__file-size {
  display: block;
  font-size: 12px;
  opacity: 0.7;
}

.composer-format-menu {
  min-width: 240px;
  max-width: min(300px, calc(100vw - 16px));
  padding: 4px 0;
}

.composer-format-item {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 10px 16px !important;
  text-align: left;
}

.composer-format-item__label {
  flex: 1;
}

.composer-format-item__kbd {
  font-size: 12px;
  opacity: 0.55;
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.composer-format-sep {
  height: 1px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.1);
}

/* Composer context menu (main + formatting submenu) */
.composer-ctx-root {
  position: fixed;
  inset: 0;
  z-index: 10060;
  pointer-events: none;
  display: none;
}

.composer-ctx-root[style*="display: block"],
.composer-ctx-root.is-open {
  pointer-events: auto;
}

.composer-ctx-panel {
  position: fixed;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 4px 0;
  pointer-events: auto;
}

.composer-ctx-item {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 10px 16px !important;
  text-align: left;
}

.composer-ctx-item:disabled {
  opacity: 0.4;
  cursor: default;
}

.composer-ctx-item__label {
  flex: 1;
}

.composer-ctx-item__kbd {
  font-size: 12px;
  opacity: 0.55;
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.composer-ctx-item__arrow {
  opacity: 0.55;
  font-size: 16px;
  line-height: 1;
  margin-left: 8px;
}

.composer-ctx-item--submenu:hover:not(:disabled),
.composer-ctx-root.is-submenu-open .composer-ctx-item--submenu {
  background: rgba(255, 255, 255, 0.07);
}

.composer-ctx-submenu {
  display: none;
  z-index: 10061;
}

/* Chat list preview — compact formatted text */
/* Forward picker modal */
.forward-picker-backdrop {
  z-index: 10050;
}

.forward-picker-modal {
  width: min(420px, 94vw);
  max-height: min(520px, 88vh);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.forward-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
  gap: 8px;
}

.forward-picker-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.forward-picker-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  padding: 0 4px;
}

.forward-picker-close:hover {
  opacity: 1;
}

.forward-picker-search-wrap {
  padding: 0 16px 10px;
}

.forward-picker-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 15px;
}

.forward-picker-search::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.forward-picker-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 12px;
}

.forward-picker-section__title {
  margin: 8px 8px 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.forward-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.forward-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.forward-picker-item:hover,
.forward-picker-item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.forward-picker-item__ava {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #6b4164;
  background-repeat: no-repeat;
}

.forward-picker-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.forward-picker-item__title {
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-picker-item__sub {
  font-size: 13px;
  opacity: 0.65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-picker-hint,
.forward-picker-empty {
  padding: 12px 10px;
  font-size: 14px;
  opacity: 0.65;
  text-align: center;
}

.last-mess__prefix {
  opacity: 0.75;
  margin-right: 4px;
  flex-shrink: 0;
}

.last-mess__body {
  display: inline;
}

.last-mess .msg-fmt-pre,
.last-mess blockquote.msg-fmt-quote {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  white-space: nowrap;
}

.last-mess .msg-fmt-code {
  font-size: 0.95em;
  padding: 0 3px;
}

.last-mess .msg-fmt-spoiler {
  background: rgba(80, 80, 80, 0.95);
  color: rgba(80, 80, 80, 0.95) !important;
  cursor: default;
  pointer-events: none;
}

.last-mess .msg-fmt-spoiler.is-revealed {
  background: rgba(80, 80, 80, 0.95);
  color: rgba(80, 80, 80, 0.95) !important;
}

.last-mess .msg-fmt-link {
  pointer-events: none;
  text-decoration: none;
  color: inherit;
}

.msg-bubble__meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 4px;
    gap: 10px;
}

.msg-bubble__sender {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11px;
    line-height: 1.25;
    opacity: 0.55;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-bubble__link--sender {
    color: inherit;
    font-weight: 400;
}

.msg-bubble__link--sender:hover,
.msg-bubble__link--sender:focus-visible {
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
}

.message-highlight,
.post-highlight {
    outline: 2px solid rgba(201, 155, 208, 0.85);
    outline-offset: 2px;
    border-radius: 12px;
    transition: outline-color 0.3s ease;
}

/* Контекстные меню — на всех страницах (settings, moduls, profile, …) */
.news-ctx-menu,
#plumnet-fallback-ctx {
    display: none;
    position: fixed;
    z-index: 10060;
    min-width: 200px;
    max-width: min(280px, calc(100vw - 16px));
    padding: 4px 0;
    margin: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(33, 33, 33, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
    overflow: hidden;
}

.news-ctx-menu.is-open,
#plumnet-fallback-ctx.is-open {
    display: block;
}

.news-ctx-menu button,
#plumnet-fallback-ctx button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 11px 18px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-ctx-menu button:hover,
.news-ctx-menu button:focus-visible,
#plumnet-fallback-ctx button:hover,
#plumnet-fallback-ctx button:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    outline: none;
}

.news-ctx-menu button.dangerBtnMenu,
#plumnet-fallback-ctx button.dangerBtnMenu {
    color: #e57373;
}
