/* NINVA contact entry; deliberately below native product dialogs. */
.ninva-chat-launcher,
.ninva-chat-panel {
  font-family: "NINVA Sans Light", "Source Han Sans SC Light", "思源黑体 Light", sans-serif;
  font-weight: 300;
}
.ninva-chat-launcher {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 20;
  min-height: 48px;
  border: 1px solid #e60020;
  border-radius: 2px;
  padding: 12px 21px;
  color: #fff;
  background: #e60020;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: .03em;
  box-shadow: 0 4px 18px #171d211a;
  cursor: pointer;
}
.ninva-chat-launcher:hover,
.ninva-chat-panel .ninva-chat-start:hover { background: #bc001a; }
.ninva-chat-launcher:focus-visible,
.ninva-chat-panel :is(button,a):focus-visible { outline: 2px solid #20272d; outline-offset: 4px; }
.ninva-chat-launcher[hidden],
.ninva-chat-panel [hidden] { display: none !important; }
dialog.ninva-chat-panel {
  position: fixed;
  inset: auto max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) auto;
  margin: 0;
  width: min(420px, calc(100vw - 40px));
  max-width: 420px;
  max-height: calc(100dvh - 40px);
  border: 1px solid #dce0e3;
  border-top: 3px solid #e60020;
  border-radius: 2px;
  padding: 28px;
  background: #fff;
  color: #20272d;
  box-shadow: 0 16px 64px #171d2133;
  overflow: auto;
  overscroll-behavior: contain;
  text-align: left;
  line-height: 1.65;
}
dialog.ninva-chat-panel::backdrop { background: #171d2159; }
.ninva-chat-panel h2 { margin: 0 36px 14px 0; font-size: 24px; line-height: 1.4; letter-spacing: 0; }
.ninva-chat-panel p { margin: 12px 0; font-size: 14px; color: #5b656d; }
.ninva-chat-panel .ninva-chat-close {
  position: absolute;
  top: 14px;
  right: 14px;
  float: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #20272d;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.ninva-chat-panel .ninva-chat-start {
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 18px 0 10px;
  padding: 10px 16px;
  border: 1px solid #e60020;
  border-radius: 2px;
  color: #fff;
  background: #e60020;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.ninva-chat-panel .ninva-chat-start:disabled { opacity: .55; cursor: wait; }
.ninva-chat-panel .ninva-chat-language { font-size: 12px; }
.ninva-chat-contacts { display: grid; gap: 0; margin-top: 20px; border-top: 1px solid #e3e6e8; }
.ninva-chat-panel .ninva-chat-contacts a {
  display: block;
  min-height: 44px;
  padding: 12px 0;
  border-bottom: 1px solid #e3e6e8;
  color: #20272d;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.ninva-chat-panel .ninva-chat-contacts a:hover { color: #e60020; text-decoration: underline; }
.ninva-chat-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 520px) {
  .ninva-chat-launcher { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); padding: 11px 17px; }
  dialog.ninva-chat-panel {
    inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 24px;
  }
}
