/* Keep the existing advisory shortcut directly above the embedded live chat. */
:root {
  --est-chat-edge: max(20px, env(safe-area-inset-right));
  --est-chat-bottom: max(20px, env(safe-area-inset-bottom));
  --est-chat-size: 60px;
  --est-chat-row: var(--est-chat-size);
  --est-chat-bar: 0px;
  --est-chat-base: calc(var(--est-chat-bottom) + var(--est-chat-bar));
}
#live-chat-container {
  bottom: calc(var(--est-chat-base) + var(--est-chat-row) + 14px) !important;
  right: var(--est-chat-edge) !important;
}
[data-tengri-widget="launcher"] {
  bottom: var(--est-chat-base) !important;
  right: var(--est-chat-edge) !important;
  left: auto !important;
}
[data-tengri-widget="invite"] {
  bottom: calc(var(--est-chat-base) + 8px) !important;
  right: calc(var(--est-chat-edge) + var(--est-chat-size) + 12px) !important;
  left: auto !important;
}
[data-tengri-widget="frame"] { right: var(--est-chat-edge) !important; }
html:not(.est-live-keyboard) [data-tengri-widget="frame"] {
  left: auto !important;
  bottom: calc(var(--est-chat-bottom) + var(--est-chat-size) + 8px) !important;
  max-height: calc(100dvh - var(--est-chat-bottom) - var(--est-chat-size) - 20px) !important;
}
html.est-live-chat-open { --est-chat-base: var(--est-chat-bottom); }
html.est-live-chat-open #live-chat-container { visibility: hidden !important; pointer-events: none !important; }
html.est-advisory-open [data-tengri-widget] { visibility: hidden !important; pointer-events: none !important; }
html.est-live-chat-open #est-mobile-actions,
html.est-advisory-open #est-mobile-actions { visibility: hidden !important; pointer-events: none !important; }
@media (min-width: 768px) {
  #chat-window {
    bottom: calc(var(--est-chat-base) + var(--est-chat-size) + 14px) !important;
    right: var(--est-chat-edge) !important;
    max-height: calc(100dvh - var(--est-chat-base) - var(--est-chat-size) - 30px) !important;
  }
}
@media (max-width: 1023px) {
  html:has(#est-mobile-actions) { --est-chat-bar: 66px; }
  #est-mobile-actions { padding-bottom: max(10px, env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 639px), (pointer: coarse) and (max-device-width: 900px) {
  :root {
    --est-chat-edge: max(12px, env(safe-area-inset-right));
    --est-chat-bottom: max(12px, env(safe-area-inset-bottom));
    --est-chat-size: 56px;
  }
  #chat-toggle-btn { min-height: 44px; }
}
