/* RuiTalk Host delivery marker: messenger-service-pack-version-503 */
.preview-shell.is-product{gap:0;height:100%;min-height:0;padding:0;overflow:hidden;background:linear-gradient(180deg,#0b1322 0%,#09111d 58%,#08101b 100%)}
.preview-shell.is-product::before { background: radial-gradient(circle at top left, rgba(28, 56, 100, 0.2), transparent 34%), radial-gradient(circle at bottom right, rgba(18, 31, 61, 0.16), transparent 30%); }
.preview-shell.is-product .shell-main{display:flex;flex:1;min-height:0;height:100%;overflow:hidden}
.preview-shell.is-product * { -webkit-touch-callout: none; }
.preview-shell.is-product :not(input):not(textarea):not([contenteditable='true']):not([data-allow-text-selection]) { -webkit-user-select: none; user-select: none; }
.preview-shell.is-product [data-allow-text-selection], .preview-shell.is-product [data-allow-text-selection] * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.preview-shell.is-product .shell-banner { position: sticky; top: 0; z-index: 4; margin: 0; border-width: 0 0 1px; border-radius: 0; background: rgba(9, 15, 27, 0.96); backdrop-filter: blur(12px); }

.chat-shell { position: relative; display: grid; flex: 1; gap: 0; min-height: 0; height: 100%; width: 100%; overflow: visible; }
.thread-pane { position: relative; min-width: 0; min-height: 0; height: 100%; overflow: visible; }
.chat-thread-stage { position: relative; min-width: 0; min-height: 0; height: 100%; overflow: visible; }
.thread-viewport-shell { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; background: transparent; }
.thread-viewport-shell::before { content: ''; position: absolute; inset: calc(var(--thread-header-height) + var(--thread-header-gap)) 0 0 0; background: linear-gradient(180deg, rgba(11, 19, 33, 0.99) 0%, rgba(9, 16, 28, 0.995) 100%); pointer-events: none; }
.chat-list-panel, .chat-thread-panel { position: relative; min-height: 0; height: 100%; overflow: hidden; border: 0; border-radius: 0; box-shadow: none; }
.chat-list-panel { display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(11, 19, 33, 0.99) 0%, rgba(9, 16, 28, 0.995) 100%); }
.chat-thread-panel { background: transparent; }
.chat-thread-panel > .thread-stage { position: absolute; inset: 0; min-width: 0; min-height: 0; overflow: hidden; }
.thread-stage > .thread-viewport-shell { position: absolute; inset: 0; min-width: 0; min-height: 0; }
.chat-list-panel::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at top right, rgba(46, 80, 135, 0.08), transparent 34%), linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 32%); }

.thread-messages {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: stretch;
  min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto;
  touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; overflow-anchor: none;
  padding: 8px calc(9px + var(--safe-right)) calc(9px + var(--thread-composer-height) + var(--thread-keyboard-offset)) calc(9px + var(--safe-left));
  scroll-padding-top: calc(var(--thread-header-height) + var(--thread-header-gap) + 6px); scroll-padding-bottom: calc(var(--thread-composer-height) + var(--thread-keyboard-offset) + 14px); background: transparent;
}
.thread-messages > .thread-top-spacer, .thread-messages > .message-day-separator, .thread-messages > .message-cluster { flex: 0 0 auto; width: 100%; min-width: 0; }
.thread-top-spacer { height: calc(var(--thread-header-height) + var(--thread-header-gap) + 8px); pointer-events: none; }
.thread-empty, .empty-copy { margin: 0; padding: 0; border: 0; background: transparent; color: inherit; }
.chat-list-scroll > [data-role='chat-list'] { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 100%; }
.chat-list-scroll:has(> .empty-state), .chat-list-scroll:has(> .empty-state-block.is-list-empty) { display: grid; place-items: center; align-content: center; }
.chat-list-scroll > [data-role='chat-list'] > .empty-state:only-child, .chat-list-scroll > [data-role='chat-list'] > .empty-state-block.is-list-empty:only-child { margin-block: auto; }
.chat-list-scroll .empty-state, .chat-list-scroll .empty-state-block.is-list-empty { display: grid; place-items: center; align-content: center; gap: 8px; flex: 0 0 auto; min-height: auto; width: 100%; max-width: none; margin: 0; padding: 0 20px; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; text-align: center; box-sizing: border-box; }
.chat-list-scroll .empty-state { color: transparent; font-size: 0; }
.chat-list-scroll .empty-state::before { content: 'Чатов пока нет...'; display: block; width: 100%; margin: 0 auto; color: rgba(202, 213, 229, 0.72); font-size: 14px; font-weight: 400; letter-spacing: -0.01em; text-align: center; }
.chat-list-scroll .empty-state::after { content: 'Найдите в поиске, и начните общение...'; display: block; width: min(100%, 260px); margin: 0 auto; color: rgba(140, 156, 178, 0.6); font-size: 11.5px; font-weight: 400; line-height: 1.35; white-space: normal; text-align: center; }
.empty-state-title, .thread-empty p { margin: 0; color: rgba(202, 213, 229, 0.72); font-size: 14px; font-weight: 400; letter-spacing: -0.01em; }
.empty-state-hint { margin: 0; max-width: 260px; color: rgba(140, 156, 178, 0.6); font-size: 11.5px; font-weight: 400; line-height: 1.35; }
.thread-header:not(.is-thread-open) { display: none; }
.thread-stage.is-thread-idle .thread-top-spacer { display: none; }
.thread-stage.is-thread-idle .thread-viewport-shell::before { display: none; }
.thread-stage.is-thread-idle .thread-viewport-shell { display: grid; place-items: center; }
.thread-stage.is-thread-idle .thread-messages { display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0 calc(18px + var(--safe-right)) 0 calc(18px + var(--safe-left)); }
.thread-stage.is-thread-idle .thread-empty { display: block; width: min(100%, 420px); min-height: auto; margin: 0; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; text-align: center; }

.thread-day-cue-wrap { position: absolute; top: calc(var(--thread-header-height) + var(--thread-header-gap)); left: 50%; z-index: 2; display: flex; justify-content: center; transform: translateX(-50%) translateY(var(--thread-day-cue-push-y, 0px)); transition: transform 160ms ease, opacity 160ms ease; pointer-events: none; }
.thread-day-cue-wrap[hidden] { display: none !important; }
.thread-day-cue-wrap.is-swapping .thread-day-cue-badge { opacity: 0.86; transform: scale(0.97); }
.message-day-separator { position: relative; z-index: 1; display: flex; justify-content: center; margin: 0 0 8px; padding: 0; pointer-events: none; }
.message-day-separator span, .thread-day-cue-badge { display: inline-flex; min-height: 26px; align-items: center; padding: 0 11px; border: 1px solid var(--rt-floating-chrome-border); border-radius: 999px; background: var(--rt-floating-chrome-bg); color: rgba(192, 203, 220, 0.9); font-size: 11px; font-weight: 600; box-shadow: var(--rt-floating-chrome-shadow); backdrop-filter: var(--rt-floating-chrome-blur); transition: transform 160ms ease, opacity 160ms ease; pointer-events: auto; }

.message-cluster { display: flex; flex-direction: column; gap: 5px; margin-bottom: 9px; }
.message-cluster.is-outgoing { align-items: flex-end; }
.message-cluster.is-continued { margin-top: -6px; }
.message-cluster.is-outgoing .message-reactions { justify-content: flex-end; }
.message-bubble { max-width: min(74%, 520px); padding: 8px 11px 7px; color: var(--text); }
.message-bubble.is-incoming { border-radius: 18px 18px 18px 5px; background: linear-gradient(180deg, rgba(33, 43, 60, 0.96) 0%, rgba(25, 34, 48, 0.96) 100%); box-shadow: inset 0 0 0 1px rgba(82, 97, 121, 0.16); }
.message-bubble.is-outgoing { border-radius: 18px 18px 5px 18px; background: linear-gradient(180deg, #3d669f 0%, #35598c 100%); }
.message-cluster.is-continued .message-bubble.is-incoming { border-top-left-radius: 13px; }
.message-cluster.is-continued .message-bubble.is-outgoing { border-top-right-radius: 13px; }

.message-quote { margin-bottom: 8px; padding: 8px 10px; border-left: 3px solid rgba(179, 207, 255, 0.46); border-radius: 14px; background: rgba(255, 255, 255, 0.075); }
.message-quote-title, .message-quote-copy, .message-text { margin: 0; }
.message-quote-title { color: rgba(234, 240, 249, 0.94); font-size: 12px; font-weight: 700; }
.message-quote-badge { display: inline-flex; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 10.5px; }
.message-quote-copy { margin-top: 4px; color: rgba(227, 235, 246, 0.82); font-size: 12px; }

.message-media { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.message-media-frame { display: grid; place-items: center; min-height: 160px; border-radius: 18px; background: linear-gradient(135deg, rgba(14, 21, 37, 0.42), rgba(255, 255, 255, 0.08)); color: rgba(244, 248, 255, 0.88); font-size: 38px; font-weight: 500; }
.message-media[data-accent='indigo'] .message-media-frame { background: linear-gradient(135deg, rgba(28, 45, 88, 0.52), rgba(255, 255, 255, 0.08)); }
.message-media-label { color: rgba(240, 245, 251, 0.84); font-size: 12px; font-weight: 600; }

.message-text { font-size: 13.5px; line-height: 1.34; }
.message-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 6px; color: rgba(226, 236, 248, 0.82); font-size: 10px; }
.message-bubble.is-incoming .message-meta { color: rgba(158, 174, 196, 0.78); }
.message-status { display: inline-flex; position: relative; align-items: flex-end; justify-content: flex-start; min-width: 15px; height: 10px; color: rgba(223, 232, 244, 0.88); letter-spacing: 0; }
.message-status-check { display: block; font-size: 11px; line-height: 1; transform-origin: center bottom; }
.message-status-check.is-tail { margin-left: -4px; }
.message-status.is-read { color: #3aa7ff; }

.message-reactions { display: flex; gap: 7px; padding-inline: 8px; }
.message-reaction-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 11px; border: 1px solid rgba(108, 141, 190, 0.22); border-radius: 999px; background: linear-gradient(180deg, rgba(64, 109, 167, 0.34), rgba(45, 76, 119, 0.3)); color: #eef5ff; font-size: 13px; font-weight: 600; }

@media (max-width: 719px) {
  .preview-shell.is-product {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .chat-shell { position: fixed; inset: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); width: 100vw; height: 100dvh; min-height: 0; }
  .chat-list-panel, .thread-pane { grid-area: 1 / 1; min-height: 100%; }
  .chat-thread-stage.is-hidden { display: none; }
  .chat-thread-panel[data-viewport-fixed='true'] { position: fixed; top: var(--thread-panel-top, 0px); right: var(--thread-panel-right, 0px); bottom: auto; left: var(--thread-panel-left, 0px); width: auto; height: var(--thread-panel-height, 100dvh); max-height: 100dvh; background: transparent; z-index: 3; overscroll-behavior: none; touch-action: none; }
  .chat-thread-panel[data-viewport-fixed='true'] .thread-viewport-shell { background: transparent; }
  .chat-thread-panel[data-viewport-fixed='true'] .thread-viewport-shell::before { display: none; }
  .chat-thread-panel[data-viewport-fixed='true'] .thread-messages {
    background: radial-gradient(circle at top center, rgba(82, 128, 198, 0.12) 0%, rgba(82, 128, 198, 0.05) 18%, rgba(82, 128, 198, 0) 36%), linear-gradient(180deg, rgba(11, 19, 33, 0.99) 0%, rgba(9, 16, 28, 0.995) 100%);
  }
  .chat-thread-panel[data-viewport-fixed='true'] .thread-top-spacer { display: none; }
  .chat-thread-panel[data-viewport-fixed='true']::after { display: none; }
  .chat-list-panel.is-hidden { display: none; }
  .chat-shell[data-pane-mode='list-only'] .thread-pane { visibility: hidden; pointer-events: none; opacity: 0; }
  .chat-shell[data-pane-mode='thread-only'] .chat-list-panel { visibility: hidden; pointer-events: none; opacity: 0; }
  .chat-shell[data-pane-mode='list-only'] .chat-list-panel, .chat-shell[data-pane-mode='thread-only'] .thread-pane { visibility: visible; pointer-events: auto; opacity: 1; }
}

@media (min-width: 720px) {
  .preview-shell.is-product { padding: 0; }
  .preview-shell.is-product .shell-main { min-height: 0; }
  .chat-shell { grid-template-columns: minmax(280px, 324px) minmax(0, 1fr); }
  .chat-thread-stage { min-width: 0; }
  .chat-list-panel { border-right: 1px solid rgba(69, 86, 112, 0.22); }
  .thread-messages { padding: 10px calc(14px + var(--safe-right)) calc(11px + var(--thread-composer-height) + var(--thread-keyboard-offset)) calc(14px + var(--safe-left)); }
}
