/* Cross icons are replaced by backdrop dismissal; textual Cancel buttons stay. */
dialog[open] button.dialog-close-hidden{display:none!important}

html:has(.member-messenger-dialog[open]){overflow:hidden}
dialog.member-messenger-dialog{box-sizing:border-box;width:min(1400px,calc(100vw - 48px));max-width:none;height:calc(100dvh - 64px);max-height:none;margin:auto;padding:0;border:1px solid #385366;border-radius:16px;overflow:hidden;background:#0d1d28}
.member-messenger-dialog::backdrop{background:#02090dbb;backdrop-filter:blur(6px)}
.member-messenger-dialog>iframe{display:block;width:100%;height:100%;border:0}
.messenger-mobile-header{display:none}
@media(max-width:900px),(pointer:coarse) and (max-height:600px){
  dialog.member-messenger-dialog[open]{display:flex;flex-direction:column;position:fixed;inset:auto;margin:0;left:var(--chat-left,0px);top:var(--chat-top,0px);width:var(--chat-width,100vw);height:var(--chat-height,100dvh);max-width:none;max-height:none;border:0;border-radius:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
  .member-messenger-dialog>iframe{flex:1;min-height:0;height:0}
  .member-messenger-dialog>.messenger-mobile-header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;min-width:0}
  .messenger-mobile-header>h2{margin:0;color:#eef5fa;font:700 20px/1.3 system-ui}
  .messenger-mobile-header>.messenger-mobile-close{display:block;flex:none;min-height:44px;padding:8px 0;border:0;background:transparent;color:#ff8fba;font:600 14px system-ui;cursor:pointer}
}

/* One compact gift catalogue in profiles and chat, independent of page typography. */
dialog.member-gift-catalog-dialog{box-sizing:border-box;width:min(550px,calc(100vw - 28px));max-width:calc(100vw - 28px);max-height:90dvh;padding:24px;margin:auto;font:14px/1.5 system-ui;overflow:auto}
dialog.member-gift-catalog-dialog>h2{font:700 22px/1.3 system-ui;margin:0 0 18px;overflow-wrap:anywhere}
dialog.member-gift-catalog-dialog .member-list,dialog.member-gift-catalog-dialog .chat-gift-catalog{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:stretch}
dialog.member-gift-catalog-dialog .gift-catalog-card,dialog.member-gift-catalog-dialog .chat-catalog-gift{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;width:100%;margin:0;padding:10px;background:#182e3c;border:1px solid #3a5363;border-radius:10px;color:#fff;font:12px/1.3 system-ui;text-align:center;cursor:pointer}
dialog.member-gift-catalog-dialog .gift-catalog-card>img,dialog.member-gift-catalog-dialog .chat-catalog-gift>img{display:block;width:70px;height:70px;max-width:100%;object-fit:contain;flex:none}
dialog.member-gift-catalog-dialog .gift-catalog-card>strong,dialog.member-gift-catalog-dialog .chat-catalog-gift>strong{display:flex;align-items:center;justify-content:center;min-height:2.6em;font:700 12px/1.3 system-ui;overflow-wrap:anywhere}
dialog.member-gift-catalog-dialog .gift-symbol{font-size:35px;height:70px;display:grid;place-items:center}
dialog.member-gift-catalog-dialog .discount-price,dialog.member-gift-catalog-dialog .chat-catalog-gift>small{margin-top:auto;justify-content:center;color:#f5d68c;font:700 11px/1.3 system-ui}
dialog.member-gift-catalog-dialog .gift-catalog-cost{padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:#f5d68c;font:700 11px/1.3 system-ui}
@media(max-width:700px){dialog.member-gift-catalog-dialog .member-list,dialog.member-gift-catalog-dialog .chat-gift-catalog{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:360px){dialog.member-gift-catalog-dialog{padding:16px}}
