/* ZYRVO v2.4.6 — Chat Sync & Theme Preboot */

/* Saved Messages should look like a system chat, not a glowing emergency beacon. */
html body .zy-saved-avatar,
html body .zy-saved-peer-icon,
html body .zy-saved-info .zy-group-peer-icon{
  background:color-mix(in srgb,var(--zy-accent) 10%,var(--zy-surface-2))!important;
  background-image:none!important;
  color:var(--zy-accent)!important;
  border:1px solid var(--zy-accent-border)!important;
  box-shadow:none!important;
}
html body .zy-saved-avatar{
  border-radius:50%!important;
  width:var(--zy-chat-avatar,50px)!important;
  height:var(--zy-chat-avatar,50px)!important;
  font-size:17px!important;
}
html body .zy-saved-row .zy-conversation-top>strong{color:var(--zy-text)!important}
html body .zy-saved-row.active .zy-conversation-top>strong{color:var(--zy-accent)!important}
html[data-zy-time-theme="day"] body .zy-saved-avatar,
html[data-zy-time-theme="day"] body .zy-saved-peer-icon{
  background:color-mix(in srgb,var(--zy-accent) 7%,#fff)!important;
}

/* Saved chat menu: physically anchor it to the kebab instead of letting old layout rules pull it away. */
html body .chat-header-actions{position:relative!important;overflow:visible!important}
html body .zy-saved-more{position:relative!important;display:inline-grid!important;place-items:center!important;z-index:120!important}
html body .zy-saved-more>summary{position:relative!important;z-index:2!important;color:var(--zy-text)!important;border:1px solid transparent!important}
html body .zy-saved-more[open]>summary{background:var(--zy-accent-soft)!important;border-color:var(--zy-accent-border)!important;color:var(--zy-accent)!important}
html body .zy-saved-more-popover{
  position:absolute!important;
  right:0!important;
  left:auto!important;
  top:calc(100% + 8px)!important;
  transform:none!important;
  margin:0!important;
  width:max-content!important;
  min-width:210px!important;
  max-width:min(280px,calc(100vw - 24px))!important;
  padding:7px!important;
  border:1px solid var(--zy-border)!important;
  border-radius:13px!important;
  background:color-mix(in srgb,var(--zy-panel) 97%,transparent)!important;
  box-shadow:0 20px 55px rgba(0,0,0,.38)!important;
  backdrop-filter:blur(18px)!important;
  z-index:1000!important;
}
html body .zy-saved-more-popover a,
html body .zy-saved-more-popover button{color:var(--zy-text)!important;background:transparent!important}
html body .zy-saved-more-popover a:hover,
html body .zy-saved-more-popover button:hover{background:var(--zy-accent-soft)!important}
html body .zy-saved-more-popover i{color:var(--zy-accent)!important}

/* Drag persistence feedback: no second drag while the previous order is still crossing the network. */
.zy-conversation-list.zy-v246-pin-saving{cursor:progress!important}
.zy-conversation-list.zy-v246-pin-saving .zy-conversation-row[draggable="true"]{pointer-events:none!important;opacity:.88}
.zy-conversation-list.zy-v246-pin-saving::after{
  content:'Сохраняю порядок…';position:sticky;left:12px;bottom:8px;z-index:30;display:block;width:max-content;
  margin:8px 8px 0 auto;padding:5px 9px;border-radius:999px;background:var(--zy-panel);border:1px solid var(--zy-accent-border);
  color:var(--zy-muted-strong);font-size:9px;box-shadow:0 8px 24px rgba(0,0,0,.22)
}

/* Static accent bridge used before deferred theme JS wakes up. This prevents the green one-frame flash. */
html[data-zy-accent] body :where(
  .site-header,.top-header,.main-header,.app-header,.navbar,body>header
) :where(a,button,.nav-link) :where(i,svg),
html[data-zy-accent] body :where(.nav-link.active,.navbar .active,.top-nav .active,.site-header .active){
  color:var(--zy-accent)!important;
}
html[data-zy-accent] body :where(.btn-primary,.new-post-button,.create-button,.chat-send,.zy-action-primary){
  background:linear-gradient(135deg,var(--zy-accent),var(--zy-accent-2))!important;
  border-color:transparent!important;color:#fff!important;
}
html[data-zy-accent] body :where(.zy-msg-new,.zy-folder-tab.active,.zy-chat-tab-scroll>button.active,.zy-custom-folder-tabs>button.active){
  color:var(--zy-accent)!important;border-color:var(--zy-accent-border)!important;
}

@media(max-width:760px){
  html body .zy-saved-more-popover{right:-2px!important;min-width:205px!important;max-width:calc(100vw - 16px)!important}
}

/* v2.4.6 R2 — Saved Menu Alignment
 * Old shared button rules could size the "Информация" icon like a round action button,
 * which pushed its label below the row. All Saved popover entries now use one explicit grid.
 */
html body .zy-saved-more-popover>a,
html body .zy-saved-more-popover>button{
  display:grid!important;
  grid-template-columns:28px minmax(0,1fr)!important;
  align-items:center!important;
  justify-content:stretch!important;
  gap:10px!important;
  width:100%!important;
  min-width:0!important;
  min-height:42px!important;
  height:auto!important;
  margin:0!important;
  padding:8px 10px!important;
  border:0!important;
  border-radius:9px!important;
  box-sizing:border-box!important;
  text-align:left!important;
  line-height:1.2!important;
  overflow:visible!important;
  white-space:normal!important;
  font:inherit!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
html body .zy-saved-more-popover>a>i,
html body .zy-saved-more-popover>button>i{
  display:grid!important;
  place-items:center!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  float:none!important;
  flex:none!important;
  width:28px!important;
  min-width:28px!important;
  height:28px!important;
  min-height:28px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:8px!important;
  background:color-mix(in srgb,var(--zy-accent) 10%,transparent)!important;
  box-shadow:none!important;
  font-size:12px!important;
  line-height:1!important;
}
html body .zy-saved-more-popover>a>span,
html body .zy-saved-more-popover>button>span{
  display:block!important;
  position:static!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  color:var(--zy-text)!important;
  font-size:12px!important;
  line-height:1.25!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  transform:none!important;
}
html body .zy-saved-more-popover>button[data-saved-open-info]::before,
html body .zy-saved-more-popover>button[data-saved-open-info]::after{
  content:none!important;
  display:none!important;
}
html body .zy-saved-more-popover>button[data-saved-open-info]{
  cursor:pointer!important;
}

/* v2.4.6 R3 — Saved Menu Final Alignment
 * Normalize all Saved popover rows to the exact same geometry.
 */
html body .zy-saved-more-popover>a,
html body .zy-saved-more-popover>button{
  grid-template-columns:28px minmax(0,1fr)!important;
  column-gap:10px!important;
}
html body .zy-saved-more-popover>button[data-saved-open-info]{
  font-size:12px!important;
  letter-spacing:0!important;
}
html body .zy-saved-more-popover>button[data-saved-open-info]>i,
html body .zy-saved-more-popover>button[data-saved-open-info]>.zy-saved-info-icon{
  grid-column:1!important;
  grid-row:1!important;
}
html body .zy-saved-more-popover>button[data-saved-open-info]>.zy-saved-info-label{
  grid-column:2!important;
  grid-row:1!important;
  align-self:center!important;
  justify-self:start!important;
  width:auto!important;
  margin:0!important;
  padding:0!important;
  text-indent:0!important;
  transform:none!important;
  color:var(--zy-text)!important;
  font-size:12px!important;
  line-height:1.25!important;
}
