:root{
  --brand:#2f6dfd;
  --brand-2:#6a5bff;
  --line: rgba(0,0,0,.08);
  --panel: #fff;
  --panel-border: #e3e8f4;
  --muted:#6b7280;
  --ui-scale: 1;
  --chat-shell-gap: 16px;
  --chat-control-size: 36px;
  --chat-control-icon: 16px;
}

@media (max-width: 768px){
  :root{
    --chat-control-size: 35px;
    --chat-control-icon: 16px;
  }
}

@media (max-width: 480px){
  :root{
    --chat-control-size: 32.5px;
    --chat-control-icon: 16px;
  }
}


html.gf-chat-noscroll,
body.gf-chat-noscroll{
  height: 100%;
  overflow: hidden;
}
.messages-page{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: var(--gf-gap-y) 0 calc(var(--gf-gap-y) + var(--gf-safe-bottom, 0px));
  font-size: calc(16px * var(--ui-scale));
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: none;
  height: 100dvh;
  height: calc(
    var(--gf-vh, 100dvh)
    - var(--gf-header-h, 72px)
    - var(--gf-gap-y) * 2
  );
}
.chat-shell{
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--chat-shell-gap, 16px);
  flex: 1 1 auto;
  min-height: 0;
}
.dialogs{
  border-radius:var(--gf-radius-xl, 16px);
  overflow:hidden;
  min-height:300px;
  display:flex;
  flex-direction:column;
  position: relative;
}
.dialogs__tabs{ padding:10px 10px 6px; }
.dialogs .auth-tabs{ margin:0; }
.dialogs .auth-tab{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.dialogs__list{ padding:6px; overflow:auto; flex:1; }
.dialogs__empty, .dialogs__loading{ padding:16px; color:var(--muted); font-size:14px; }
.dialog-item{
  display:grid;
  grid-template-columns: 44px 1fr auto;
  align-items: stretch;
  gap:12px;
  padding:10px;
  border-radius:12px;
  cursor:pointer;
  transition: background .12s ease, transform .08s ease, outline-color .12s ease, box-shadow .12s ease, border-color .12s ease;
  background: transparent;
  border: 1px solid transparent;
}

.dialog-item:hover{
  background: var(--gf-page-bg);
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 4px 10px rgba(15,23,42,0.04);
}

.dialog-item.is-active{
  background: #eef0ff;
  border-color: rgba(255,255,255,0.95);
  box-shadow: 0 10px 22px rgba(15,23,42,0.10);
}

.dialog-item.is-active .dialog-item__title{
  color:#1f2933;
}
.dialog-item__avatar{ width:48px; height:48px; border-radius:50%; object-fit:cover; background:#fff; }
.dialog-item__row{ display:flex; align-items:baseline; gap:8px; min-width:0; }
.dialog-item__title{
  font-weight:600;
  line-height:1.2;
  flex:0 1 auto;
  letter-spacing:-0.01em;
  color:#1f2933;
}

.dialog-item__preview{ color:var(--muted); font-size:13px; margin-top:2px; opacity:.8; }
.dialog-item__meta{
  align-self: stretch;
  display:flex; flex-direction:column;
  justify-content: space-between;
  align-items:flex-end; gap:6px; min-width:34px;
}
.dialog-item__time{ color:var(--muted); font-size:12px; white-space:nowrap; margin-top:2px; }
.dialog-item__text{ min-width:0; }
.dialog-item__title,
.dialog-item__preview{
  display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; line-height:1.2;
}
.chat{
  border-radius:var(--gf-radius-xl, 16px);
  min-height:300px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.chat__header{
  position: relative;
  display:flex;
  align-items:center;
  gap:12px;
  padding: 10px 16px 10px;
  min-height: 68px;
  --chat-header-h: 68px;

  background: transparent;
  border-bottom: none;
}

.chat__header::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;

  height: 1px;
  border-radius: 999px;
  background: rgba(199, 210, 254, 0.9);
  opacity: 0.9;
}
.chat__peer{ display:flex; align-items:center; gap:12px; min-width:0; }
.chat__peer img{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}


.chat__peer-title{
  font-weight:600;
  font-size:18px;
  letter-spacing:-0.01em;
}
.chat__peer-status{ color:var(--muted); font-size:14px; }
.chat__scroll{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding-top:8px;
  padding-bottom:24px;  
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
}
.chat__messages{ display:flex; flex-direction:column; gap:0; }
.msg-day{
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;

  margin: 18px auto;
  padding: 4px 10px;

  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;

  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 255, 0.65);
  box-shadow: none;
}

.msg-group{
  display:flex;
  gap:10px;
  padding:6px 14px;
  border-radius:16px;
  align-items: flex-end;
}
.msg-group:hover{
  background: rgba(255, 255, 255, 0.14);
}

.msg-group--peer{
  justify-content:flex-start;
}

.msg-group--me{
  justify-content:flex-end;
}

.msg-group--peer .msg-group__avatar-link{
  position: sticky;
  bottom: 12px;  
  align-self: flex-end; 
}

.msg-group__avatar{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  background: #fff;
  margin-top: 0;

  border: 1px solid rgba(226, 232, 255, 0.9);
  box-shadow: none;
}

.msg-group__content{
  max-width:min(100%, 300px);
  display:flex;
  flex-direction:column;
  gap:4px;
}

.msg-group__content--me{
  align-items:flex-end;
}

.msg-group__meta{
  display:flex;
  align-items:baseline;
  gap:8px;
  font-size:13px;
}

.msg-group__meta--me{
  justify-content:flex-end;
}

.msg-group__author{
  font-weight:600;
  letter-spacing:-0.01em;
  color:#1f2933;
  text-decoration:none;
}

.msg-group__author--me{
  color:#6b7280;
}

.msg-group__time{
  color:#9ca3af;
  font-size:12px;
}

.msg-group__body{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.msg{
  display:flex;
}

.msg-group--peer .msg{
  justify-content:flex-start;
}

.msg-group--me .msg{
  justify-content:flex-end;
}

.msg__bubble{
  position: relative;
  max-width: min(100%, 560px);
  padding: 8px 11px;
  border-radius: 12px;

  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 255, 0.7);
  box-shadow: none;
  backdrop-filter: none;

  font-size: 14px;
  line-height: 1.5;
  color: #1f2933;
  word-wrap: anywhere;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg-group--peer .msg__bubble{
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.msg-group--peer .msg:first-child .msg__bubble{
  border-top-left-radius: 14px;
}

.msg-group--peer .msg:last-child .msg__bubble{
  border-bottom-left-radius: 6px;
}

.msg-group--peer .msg:only-child .msg__bubble{
  border-radius: 14px;
  border-top-left-radius: 14px;
  border-bottom-left-radius: 6px;
}
.msg__head{
  font-size:12.5px;
  letter-spacing:-0.01em;
  font-weight:600;
  color:#1f2933;
}
.msg__bubble--me{
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.msg-group--me .msg:first-child .msg__bubble--me{
  border-top-right-radius: 14px;
}

.msg-group--me .msg:last-child .msg__bubble--me{
  border-bottom-right-radius: 6px;
}

.msg-group--me .msg:only-child .msg__bubble--me{
  border-radius: 14px;
  border-top-right-radius: 14px;
  border-bottom-right-radius: 6px;
}
.msg-group--me .msg__head{
  text-align:right;
}
.msg-group--me .msg__head {
  display: none;
}
.msg__author{
  color:#1f2933;
  text-decoration:none;
}
.msg__author--me{
  color:#6b7280;
}
.msg__payload{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.msg__time{
  align-self: flex-end;
  font-size: 11px;
  color: #a5b4c3;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.msg__bubble::after{
  content: none;
}
.msg-group__avatar-link{
  flex:0 0 auto;
  display:inline-flex;
  align-self:flex-end;
}

.msg__text{
  white-space:pre-wrap;
}
.msg__images{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:6px;
}
.msg__images img{
  max-width:200px;
  max-height:160px;
  border-radius:10px;
  display:block;
  cursor:zoom-in;
  object-fit:cover;
}
.msg-group__author:hover,
.msg-group__author:focus,
.msg-group__author:active{
  text-decoration:none;
}

.chat .msg-group__author:hover{
  text-decoration:none !important;
  border-bottom:0 !important;
}
.composer{
  position: sticky;
  bottom: calc(14px + var(--gf-safe-bottom, 0px));
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 0 14px calc(6px + var(--gf-safe-bottom, 0px));
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.composer__input{
  border-radius: 999px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  height: var(--chat-control-size);
  padding: 0 14px;
  font-size: 14px;
  line-height: 1.2;
  width: 100%;
  outline: none;
  color: #1f2933;
}

.composer__input:focus{
  outline: none;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.35);
  border-color: rgba(199, 210, 254, 0.96);
}
.composer__btn{
  display: inline-grid;
  place-items: center;
  width: var(--chat-control-size);
  height: var(--chat-control-size);
  border-radius: 999px;

  border: 1px solid rgba(229, 231, 235, 0.96);
  background: rgba(255, 255, 255, 0.98);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .12s ease;

  box-shadow: none;
  color: #1f2933;
}

.composer__btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(148, 163, 253, 0.22);
}
.composer__btn--send{ background:#fff; border-color:rgba(15,23,42,.08); }

#backToList{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin-left: 0;
  margin-right: 6px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 255, 0.95);
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  font-size: 0;
  color: rgba(15, 23, 42, 0.6);
  transition:
    background var(--gf-transition-fast, 0.18s ease),
    border-color var(--gf-transition-fast, 0.18s ease),
    box-shadow var(--gf-transition-fast, 0.18s ease),
    transform 0.08s ease,
    color var(--gf-transition-fast, 0.18s ease);
}

#backToList{
  display: inline-grid;
  place-items: center;
}

#backToList .gf-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#backToList .gf-icon svg{
  width: var(--chat-control-icon);
  height: var(--chat-control-icon);
}

#backToList:hover{
  background: #ffffff;
  border-color: rgba(199, 210, 254, 0.95);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.85);
  transform: translateY(-1px);
}

#backToList:active{
  transform: translateY(0);
  filter: brightness(0.99);
}
@media (max-width:768px){
  .chat-shell{ grid-template-columns:1fr; }
  .dialogs{ order:1; min-height:auto; }
  .chat{ order:2; }
  .chat{ display:none; }
  .dialogs{ display:flex; }
  .chat.is-open{ display:flex; }
  .chat-shell:has(.chat.is-open) .dialogs{ display:none; }
  #backToList{ display:inline-grid; }
  .chat__header{ padding:10px 10px; }

  .composer{
    bottom: calc(8px + var(--gf-safe-bottom, 0px));
    margin: 0 10px calc(4px + var(--gf-safe-bottom, 0px));
    gap: 6px;
    padding: 0;
  }
}
@media (min-width:768px){
  .messages-page{
    padding-top: var(--chat-shell-gap, 16px);
    padding-bottom: var(--chat-shell-gap, 16px);
  }
  .chat-shell{
    --page-vpad: var(--chat-shell-gap, 16px);
  }
}
.chat__placeholder{
  flex:1 1 auto;
  display:flex; align-items:center; justify-content:center;
  padding:24px; text-align:center;
}
.chat__placeholder-inner{ display:flex; flex-direction:column; align-items:center; gap:10px; }
.chat__placeholder-emoji{ font-size:44px; line-height:1; }
.chat__placeholder-text{ font-weight:600; color:var(--muted); font-size:16px; }
.chat__placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.chat__placeholder-emoji {
  width: 56px;
  height: 56px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.chat__placeholder-emoji[data-icon="chat"] {
  background-image: url('/png/messages/chat.png');
}
.chat__placeholder-emoji[data-icon="ticket"] {
  background-image: url('/png/messages/ticket.png');
}
.chat__placeholder-emoji[data-icon="lock"] {
  background-image: url('/png/messages/lock.png');
}
.chat__more{ margin-left:auto; position:relative; }
.more-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;

  border-radius: 999px;
  border: 1px solid rgba(226, 232, 255, 0.95);

  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;

  cursor: pointer;
  color: rgba(15, 23, 42, 0.6);

  transition:
    background var(--gf-transition-fast, 0.18s ease),
    border-color var(--gf-transition-fast, 0.18s ease),
    box-shadow var(--gf-transition-fast, 0.18s ease),
    transform 0.08s ease,
    color var(--gf-transition-fast, 0.18s ease);
}

.more-btn:hover{
  background: #ffffff;
  border-color: rgba(199, 210, 254, 0.95);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.85);
  transform: translateY(-1px);
}

.more-btn:active{
  transform: translateY(0);
  filter: brightness(0.99);
}
.more-menu{
  position: absolute;
  right: 0;
  top: 40px; 
  z-index: 20;
  min-width: 190px;
  padding: 8px 8px 6px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96),
    rgba(239, 244, 255, 0.86)
  );
  border: 1px solid rgba(226, 232, 255, 0.95);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.more-menu__item{
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 12px;

  border: 1px solid transparent;
  background: transparent;

  font-weight: 600;
  font-size: 13px;
  color: var(--gf-text-main);

  cursor: pointer;
  transition: all var(--gf-transition-fast);
}

.more-menu__item:hover,
.more-menu__item:focus-visible{
  background: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.06),
    rgba(79, 70, 229, 0.06),
    rgba(139, 92, 246, 0.07)
  );

  border-color: rgba(99, 102, 241, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    0 4px 10px rgba(79, 70, 229, 0.06);
  outline: none;
}
.chat--blocked .chat__peer-title {
  position: relative;
  padding-right: 22px;
}

.chat__blocked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 253, 0.6);
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  color: var(--muted);
}

.chat__blocked-badge[hidden] {
  display: none !important;
}

.chat__blocked-ico {
  width: 14px;
  height: 14px;
  background-image: url('/png/messages/lock.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}
.dialogs__empty{
  display:flex; align-items:center; justify-content:center;
  flex-direction:column; gap:8px; min-height:220px; text-align:center;
  color:var(--muted);
  inset: 52px 6px 6px 6px;
  position: absolute;
  font-size: 14px; border-radius: 12px;
}
.dialogs__empty .empty-emoji{ font-size:32px; line-height:1; opacity:.9; }
.dialogs__empty .empty-text{ font-weight:500; }
.up-modal[hidden]{ display:none !important; }
.up-modal{ position:fixed; inset:0; z-index:50; display:grid; place-items:center; }
.up-backdrop{ position:absolute; inset:0; background:rgba(15,23,42,.55); backdrop-filter:blur(2px); }
.up-card{
  position:relative; z-index:1; margin:0; padding:12px; border-radius:16px;
  background:rgba(255,255,255,.69);
  border:1px solid rgba(231,236,245,.9);
  box-shadow:0 18px 44px rgba(15,23,42,.18);
  backdrop-filter: blur(8px) saturate(140%);
}
.up-card--single{ width:auto; }
.up-card--single{ background: transparent; border: none; box-shadow: none; padding: 0; }
.up-grid{ display:flex; align-items:center; justify-content:center; gap:0; max-height:86vh; }
.up-item.up-item--single{ background:transparent; padding:0; }
.up-item.up-item--single img{
  display:block; width:auto; height:auto; max-width:92vw; max-height:82vh; object-fit:contain; border-radius:12px;
}
.up-x{
  position:absolute; right:10px; top:10px; z-index:2; width:28px; height:28px; border-radius:999px;
  border:1px solid rgba(0,0,0,.12); background:#fff;
  box-shadow:0 4px 10px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.9); cursor:pointer;
}
.up-x::before{ content:"✕"; display:block; line-height:28px; text-align:center; font-size:14px; color:#111; }
.up-x:hover{ transform:translateY(-1px); }
.up-actions{ position:absolute; right:14px; bottom:12px; z-index:2; display:flex; gap:8px; }
.up-actions .btn.primary{
  background:#fff; border:1px solid rgba(0,0,0,.08); color:#0f172a;
  box-shadow:0 6px 16px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.9);
}

#imgViewer[hidden]{ display:none !important; }
.imgv{
  position:fixed; inset:0; z-index:60;
  display:grid; place-items:center;    
}
.imgv__backdrop{
  position:absolute; inset:0;
  background:rgba(15,23,42,.6); backdrop-filter: blur(3px);
}
.imgv__card{
  position:relative; z-index:1;
  display:inline-block;
  margin:0; 
  background:transparent; border:none; box-shadow:none; padding:0;
}
.imgv__img{
  display:block; width:auto; height:auto;
  max-width:96vw; max-height:86vh;
  object-fit:contain; border-radius:12px;
}
.imgv__x{
  position:absolute; right:8px; top:8px;
  width:28px; height:28px; border-radius:999px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  box-shadow: 0 4px 10px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.9);
  cursor:pointer;
}
.imgv__x::before{ content:"✕"; display:block; line-height:28px; text-align:center; font-size:14px; color:#111; }
.imgv__x:hover{ transform: translateY(-1px); }
.imgv__open{
  position:absolute; right:10px; bottom:10px;
  padding:8px 12px; border-radius:10px;
  text-decoration:none;
}
.imgv__open.btn{ text-decoration:none; }
.imgv__open.btn{
  background: rgba(255,255,255,.68);
  color:#0f172a;
  border:1px solid rgba(255,255,255,.42);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 10px 26px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.95);
  text-decoration:none;
}
.imgv__open.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(15,23,42,.22), inset 0 1px 0 rgba(255,255,255,.95);
}
.imgv__open.btn:active{
  transform: translateY(0);
  filter: brightness(.98);
}
.up-x,
.imgv__x{
  position:absolute; z-index:2;
  right:8px; top:8px;
  width:28px; height:28px;
  display:grid; place-items:center; 
  border-radius:999px;
  background: rgba(255,255,255,.68); 
  border:1px solid rgba(255,255,255,.42);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 8px 20px rgba(15,23,42,.20), inset 0 1px 0 rgba(255,255,255,.96);
  cursor:pointer;
  padding:0;
}
.up-x::before,
.imgv__x::before{
  content:"";
  width:14px; height:14px;   
  background:#1f2933;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M6.2 4.8L4.8 6.2 10.6 12l-5.8 5.8 1.4 1.4L12 13.4l5.8 5.8 1.4-1.4L13.4 12l5.8-5.8-1.4-1.4L12 10.6 6.2 4.8z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M6.2 4.8L4.8 6.2 10.6 12l-5.8 5.8 1.4 1.4L12 13.4l5.8 5.8 1.4-1.4L13.4 12l5.8-5.8-1.4-1.4L12 10.6 6.2 4.8z'/></svg>") center/contain no-repeat;
}
.up-x:hover, .imgv__x:hover{ transform: translateY(-1px); }
.up-x:active, .imgv__x:active{ transform: translateY(0); filter: brightness(.98); }

.composer__btn {
  color: #1f2933;
}

@media (min-width: 769px){
  #backToList{
    display: none;
  }
}
@media (min-width: 769px){
  .msg-day{
    font-size: calc(13px * .9);
  }
}
#dialogsLoading{
  position: absolute;
  inset: 52px 6px 6px 6px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 12px; border-radius: 12px;
  color: var(--muted);  
  font-weight: 600; font-size: 14px;
}
.chat{ position: relative; } 
.chat::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: 80px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 40%, 
    rgba(233, 237, 255, 0.75) 78%,
    rgba(244, 246, 255, 0.96) 100%
  );

  pointer-events: none;
  z-index: 2;
}
#chatLoading,
#chatEmpty{
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--chat-header-h, 64px));
  bottom: calc(var(--composer-h, 72px));
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 12px;
  color: var(--muted);    
  font-weight: 600; font-size: 14px;
  background: transparent;
  pointer-events: none;   
}
#dialogsLoading[hidden],
#chatLoading[hidden],
#chatEmpty[hidden],
#dialogsEmpty[hidden],
#chatPlaceholder[hidden] {
  display: none !important;
}
.dot-loader{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  line-height:1;
}
.dot-loader__dot{
  width:8px; height:8px;
  border-radius:50%;
  background: currentColor;
  opacity:.35;
  transform: translateY(0) scale(.9);
  animation: gf-dot-bounce 1.1s infinite ease-in-out;
}
.dot-loader__dot:nth-child(1){ animation-delay: 0s;    }
.dot-loader__dot:nth-child(2){ animation-delay: .12s;  }
.dot-loader__dot:nth-child(3){ animation-delay: .24s;  }
@keyframes gf-dot-bounce{
  0%, 60%, 100%{ transform: translateY(0) scale(.9); opacity:.35; }
  30%{ transform: translateY(-4px) scale(1); opacity:.95; }
}
@media (prefers-reduced-motion: reduce){
  .dot-loader__dot{ animation: none; opacity:.6; }
}
#dialogsLoading, #chatLoading, #chatEmpty{
  text-align:center;
}
.messages-page .dialogs.glass-card,
.messages-page .chat.glass-card{
  transition: box-shadow var(--gf-transition-fast, 0.18s ease),
              border-color var(--gf-transition-fast, 0.18s ease);
}

.messages-page .dialogs.glass-card:hover,
.messages-page .chat.glass-card:hover{
  transform: none;
  box-shadow: var(--gf-shadow-soft);
  border-color: rgba(255, 255, 255, 0.6);
}
@media (max-width: 768px){
  .chat-shell{
    grid-template-columns: 1fr;
  }
  .dialogs{
    order: 1;
    display: flex;
    min-height: 0;
  }
  .chat{
    order: 2;
    display: none;
    min-height: 0;
  }
  .chat.is-open{
    display: flex;
  }
  .chat-shell:has(.chat.is-open) .dialogs{
    display: none;
  }
  #backToList{
    display: inline-flex;
  }
  .chat__scroll{
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 8px;
  }
  .chat__header{
    min-height: 58px;
    padding: 8px 10px;
    gap: 10px;
  }

  .chat__header::after{
    left: 10px;
    right: 10px;
  }

  .chat__peer img{
    width: 44px;
    height: 44px;
  }
  .chat__peer-title{
    font-size: 16px;
  }
  .chat__peer-status{
    font-size: 12.5px;
  }
  .composer{
    bottom: 10px;
    margin: 0 10px 4px;
    gap: 6px;
    padding: 0;
  }
  .composer__input{
    padding: 10px 14px;
  }
  .msg-day{
    margin: 14px 0;
    font-size: 11px;
  }
  .chat__placeholder-emoji{
    width: 46px;
    height: 46px;
  }
  .dialogs__list{
    padding: 4px;
  }

  .dialog-item{
    grid-template-columns: 45px 1fr auto; 
    gap: 9px;
    padding: 10px;
  }

  .dialog-item__avatar{
    width: 45px;  
    height: 45px;
  }

  .dialog-item__title{
    font-size: 14px; 
  }

  .dialog-item__preview{
    font-size: 13px; 
  }

  .dialog-item__time{
    font-size: 12px;  
  }

  .dialogs__tabs{
    padding: 7px 7px 6px;
  }

  .msg-group{
    gap: 8px;
    padding: 4px 10px;
  }

  .msg-group__avatar{
    width: 32px;
    height: 32px;
  }

  .msg-group__meta{
    font-size: 12px;
  }

  .msg-group__time{
    font-size: 11px;
  }

  .msg__bubble{
    font-size: 13px;
    padding: 8px 10px;
    max-width: min(100%, 280px);
  }

  .msg__time{
    font-size: 11px;
  }

  #dialogsLoading{
    inset: 48px 6px 6px 6px;
  }
  #chatLoading,
  #chatEmpty{
    top: calc(var(--chat-header-h, 60px));
    bottom: calc(var(--composer-h, 64px));
    font-size: 13.5px;
  }
}


@media (max-width: 768px){
  body.gf-chat-noscroll{
    position: fixed;
    inset: 0;
    width: 100%;
  }
}
#backToList,
.more-btn{
  width: var(--chat-control-size) !important;
  height: var(--chat-control-size) !important;
}

#backToList .chat__back-icon,
.more-btn svg,
.composer__btn svg{
  width: var(--chat-control-icon);
  height: var(--chat-control-icon);
}