dialog.ypmsg-dialog, .ypmsg-menu {
  box-sizing: border-box; position: fixed; inset: 0; margin: auto; padding: 0;
  width: min(25rem, calc(100% - 2rem)); max-width: none; max-height: calc(100% - 2rem);
  max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain;
  border: 1px solid #cbd1dc; border-radius: 16px; background: #fff; color: #192136;
  box-shadow: 0 16px 70px rgb(15 23 42 / 24%); font-family: inherit; text-align: start;
}
dialog.ypmsg-dialog:not([open]) { display: none; }
dialog.ypmsg-dialog::backdrop { background: rgb(18 26 40 / 40%); }
.ypmsg-dialog .ypmsg-card { position: relative; isolation: isolate; padding: 1.4rem; overflow-wrap: anywhere; }
.ypmsg-dialog h2 { position: relative; z-index: 0; margin: 0; padding-inline-end: max(2.4rem, 44px); font-family: inherit; font-size: 1.4rem; font-weight: 650; line-height: 1.2; color: inherit; }
.ypmsg-dialog p { margin: .7rem 0 0; white-space: pre-line; font: inherit; line-height: 1.45; color: inherit; }
.ypmsg-dialog .ypmsg-close { position: absolute; z-index: 2; inset-block-start: .45rem; inset-inline-end: .45rem;
  display: grid; place-items: center; padding: 0; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: #f0f2f5; color: #192136; font: 500 1.6rem/1 sans-serif; cursor: pointer; }
.ypmsg-dialog .ypmsg-links { display: grid; gap: .45rem; margin-block-start: 1.1rem; }
.ypmsg-dialog .ypmsg-links a { box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .5rem .85rem; border-radius: 8px; background: #192136; color: #fff;
  text-decoration: none; font-family: inherit; font-weight: 600; text-align: center; line-height: 1.25; }
.ypmsg-dialog .ypmsg-links a:hover { background: #313e59; text-decoration: underline; }
.ypmsg-dialog .ypmsg-links a[data-channel="max"] {
  background: linear-gradient(110deg, #471aff, #9500ff); color: #fff;
}
.ypmsg-dialog .ypmsg-links a[data-channel="telegram"] { background: #006fa6; color: #fff; }
.ypmsg-dialog .ypmsg-links a[data-channel="vk"] { background: #0077ff; color: #0d001a; }
.ypmsg-dialog .ypmsg-links a[data-channel="whatsapp"] { background: #25d366; color: #0d001a; }
.ypmsg-dialog .ypmsg-links a[data-channel]:hover { filter: brightness(1.08); }
.ypmsg-dialog :is(a,button):focus-visible { outline: 3px solid #2468c9; outline-offset: 2px; }

.ypmsg-floating {
  position: fixed; z-index: 2147482000; width: 56px; height: 56px;
  --ypmsg-x: 24px; --ypmsg-y: 120px;
}
.ypmsg-floating[hidden] { display: none; }
.ypmsg-floating[data-side="right"] {
  right: min(max(12px, calc(var(--ypmsg-x) + env(safe-area-inset-right, 0px))), calc(100% - 68px - env(safe-area-inset-left, 0px)));
}
.ypmsg-floating[data-side="left"] {
  left: min(max(12px, calc(var(--ypmsg-x) + env(safe-area-inset-left, 0px))), calc(100% - 68px - env(safe-area-inset-right, 0px)));
}
.ypmsg-floating[data-edge="bottom"] {
  bottom: min(max(12px, calc(var(--ypmsg-y) + env(safe-area-inset-bottom, 0px))), calc(100dvh - 68px - env(safe-area-inset-top, 0px)));
}
.ypmsg-floating[data-edge="top"] {
  top: min(max(12px, calc(var(--ypmsg-y) + env(safe-area-inset-top, 0px))), calc(100dvh - 68px - env(safe-area-inset-bottom, 0px)));
}
.ypmsg-launcher {
  box-sizing: border-box; display: grid; place-items: center; width: 56px; height: 56px;
  padding: 14px; border: 2px solid #fff; border-radius: 50%; cursor: pointer;
  background: #192136; color: #fff; box-shadow: 0 5px 22px rgb(15 23 42 / 25%);
}
.ypmsg-launcher:hover { background: #313e59; }
.ypmsg-launcher:focus-visible { outline: 3px solid #2468c9; outline-offset: 3px; }
.ypmsg-launcher:disabled { cursor: progress; }
.ypmsg-launcher svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ypmsg-menu {
  position: fixed; z-index: 2147482001; inset: auto; margin: 0; width: min(22rem, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); overflow: auto; border-radius: 16px;
}
.ypmsg-menu.ypmsg-measuring { visibility: hidden; }
.ypmsg-menu .ypmsg-card { padding: 1.1rem; }
.ypmsg-menu h2 { font-size: 1.1rem; }
.ypmsg-menu p { font-size: .9rem; }
