/* The shared site header stays dark in both page themes. */
.site-monochrome .telegram-nav {
  max-width: 1440px;
  gap: 16px;
}
html .site-monochrome .telegram-nav > .nav-links {
  gap: 20px;
  margin-right: 0;
  white-space: nowrap;
}
.site-monochrome .telegram-nav > .i18n-language-switcher {
  margin-left: 0;
}
.telegram-nav > :is(.nav-cta, .download-btn, .invite-cta) {
  flex-shrink: 0;
  white-space: nowrap;
}
.telegram-contact-trigger {
  font-family: inherit;
  cursor: pointer;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: var(--r-pill, 999px);
  background: rgba(255,255,255,.07);
  color: #fff;
  font-size: 14px;
  font-weight: var(--fw-semibold, 600);
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  transition: color var(--dur, 220ms) var(--ease-out, ease-out), background var(--dur, 220ms) var(--ease-out, ease-out), border-color var(--dur, 220ms) var(--ease-out, ease-out), box-shadow var(--dur, 220ms) var(--ease-out, ease-out), transform var(--dur, 220ms) var(--ease-out, ease-out);
}
.telegram-contact-trigger svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}
.telegram-contact-trigger:hover {
  border-color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 22px rgba(0,0,0,.2);
  transform: translateY(-1px);
}
.telegram-contact-trigger:active {
  background: rgba(255,255,255,.11);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.24);
  transform: translateY(1px);
}
.telegram-contact-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.telegram-contact-trigger[aria-expanded="true"] {
  border-color: #fff;
  background: rgba(255,255,255,.2);
}
.telegram-contact-trigger:disabled {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.42);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Telegram contact QR modal */
body.telegram-modal-open { overflow: hidden; }
.telegram-modal {
  font-family: inherit;
  position: fixed;
  inset: 0;
  /* Keep the dialog above the floating support widget, including on narrow screens. */
  z-index: 2147482100;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out, ease-out);
}
.telegram-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.telegram-modal[hidden] {
  display: none;
}
.telegram-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8,8,8,.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.telegram-modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 24px;
  overflow: auto;
  border-radius: 28px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(148,163,184,.26);
  box-shadow: 0 28px 70px rgba(15,23,42,.18);
  transform: translateY(12px) scale(.98);
  transition: transform 220ms var(--ease-out, ease-out);
}
.telegram-modal.is-open .telegram-modal-card {
  transform: translateY(0) scale(1);
}
.telegram-modal-close {
  border: 0;
  padding: 0;
  cursor: pointer;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(15,23,42,.72);
  background: rgba(241,245,249,.9);
  transition: color var(--dur, 220ms) var(--ease-out, ease-out), background var(--dur, 220ms) var(--ease-out, ease-out), transform var(--dur, 220ms) var(--ease-out, ease-out);
}

.telegram-modal-close:hover {
  color: #0f172a;
  background: #e8eaed;
  transform: translateY(-1px);
}
.telegram-modal-close:active {
  background: #dfe2e6;
  transform: translateY(0);
}
.telegram-modal-close:focus-visible {
  outline: 2px solid #17191c;
  outline-offset: 2px;
}
.telegram-modal-title {
  margin: 0 42px 8px 0;
  color: #0f172a;
  font-size: 24px;
  font-weight: var(--fw-bold, 700);
  letter-spacing: 0;
}
.telegram-modal-copy {
  margin: 0 0 18px;
  color: rgba(45,59,82,.74);
  font-size: 14px;
  line-height: 1.7;
}
.telegram-modal-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.telegram-modal-option {
  min-width: 0;
  margin: 0;
  text-align: center;
}
.telegram-modal-caption {
  margin-top: 14px;
  color: #17191c;
  font-size: 16px;
  font-weight: var(--fw-semibold, 600);
  line-height: 1.5;
}
.telegram-modal-link {
  display: inline-block;
  max-width: 100%;
  margin-top: 4px;
  padding: 6px 2px;
  border-radius: 4px;
  color: #475569;
  font-size: 13px;
  font-weight: var(--fw-regular, 400);
  line-height: 1.6;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.telegram-modal-link:hover { color: #0f172a; }
.telegram-modal-link:active { color: #334155; }
.telegram-modal-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.telegram-modal-qr-frame {
  display: block;
  width: 100%;
  aspect-ratio: 636 / 773;
  overflow: hidden;
  border-radius: 20px;
  background: #eef1e4;
  border: 1px solid rgba(23,25,28,.1);
}
.telegram-modal-qr {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* Preserve the supplied QR image and its white scanning margin in both themes. */
.telegram-modal-community-qr {
  object-fit: contain;
  object-position: center;
  background: #fff;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .telegram-modal-backdrop { background: rgba(0,0,0,.72); }
  html:not([data-theme="light"]) .telegram-modal-card {
    border-color: rgba(255,255,255,.12);
    background: rgba(24,24,24,.98);
    box-shadow: 0 28px 76px rgba(0,0,0,.54), inset 0 1px 0 rgba(255,255,255,.04);
  }
  html:not([data-theme="light"]) .telegram-modal-title { color: #f4f4f4; }
  html:not([data-theme="light"]) .telegram-modal-copy { color: rgba(235,235,235,.72); }
  html:not([data-theme="light"]) .telegram-modal-caption { color: #f4f4f4; }
  html:not([data-theme="light"]) .telegram-modal-link { color: #cbd5e1; }
  html:not([data-theme="light"]) .telegram-modal-link:hover { color: #fff; }
  html:not([data-theme="light"]) .telegram-modal-link:active { color: #aebaca; }
  html:not([data-theme="light"]) .telegram-modal-close { color: #ddd; background: #292929; }
  html:not([data-theme="light"]) .telegram-modal-close:hover { color: #fff; background: #3a3a3a; }
  html:not([data-theme="light"]) .telegram-modal-close:active { background: #242424; }
  html:not([data-theme="light"]) .telegram-modal-close:focus-visible { outline-color: #fff; }
  html:not([data-theme="light"]) .telegram-modal-qr-frame { border-color: rgba(255,255,255,.16); background: #151515; }
}
html[data-theme="dark"] .telegram-modal-backdrop { background: rgba(0,0,0,.72); }
html[data-theme="dark"] .telegram-modal-card {
  border-color: rgba(255,255,255,.12);
  background: rgba(24,24,24,.98);
  box-shadow: 0 28px 76px rgba(0,0,0,.54), inset 0 1px 0 rgba(255,255,255,.04);
}
html[data-theme="dark"] .telegram-modal-title { color: #f4f4f4; }
html[data-theme="dark"] .telegram-modal-copy { color: rgba(235,235,235,.72); }
html[data-theme="dark"] .telegram-modal-caption { color: #f4f4f4; }
html[data-theme="dark"] .telegram-modal-link { color: #cbd5e1; }
html[data-theme="dark"] .telegram-modal-link:hover { color: #fff; }
html[data-theme="dark"] .telegram-modal-link:active { color: #aebaca; }
html[data-theme="dark"] .telegram-modal-close { color: #ddd; background: #292929; }
html[data-theme="dark"] .telegram-modal-close:hover { color: #fff; background: #3a3a3a; }
html[data-theme="dark"] .telegram-modal-close:active { background: #242424; }
html[data-theme="dark"] .telegram-modal-close:focus-visible { outline-color: #fff; }
html[data-theme="dark"] .telegram-modal-qr-frame { border-color: rgba(255,255,255,.16); background: #151515; }
@media (prefers-reduced-motion: reduce) {
  .telegram-contact-trigger,
  .telegram-modal,
  .telegram-modal-card,
  .telegram-modal-close { transition: none; }
}
@media (forced-colors: active) {
  .telegram-contact-trigger,
  .telegram-modal-card,
  .telegram-modal-qr-frame { border: 1px solid ButtonText; }
  .telegram-contact-trigger:focus-visible,
  .telegram-modal-close:focus-visible,
  .telegram-modal-link:focus-visible { outline: 2px solid Highlight; }
}
@media (max-width: 560px) {
  .telegram-modal { padding: 16px; }
  .telegram-modal-card {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 20px;
  }
  .telegram-modal-options {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .telegram-modal-option { width: min(100%, 300px); margin-inline: auto; }
}


@media (max-width: 1480px) {
  .site-monochrome .telegram-nav,
  html .site-monochrome .telegram-nav > .nav-links { gap: 12px; }
}
@media (max-width: 1360px) {
  .site-monochrome .telegram-nav > .nav-links { display: none; }
  .telegram-nav > :is(.nav-logo, .brand) { margin-right: auto; }
}
@media (max-width: 560px) {
  .site-monochrome .telegram-nav { gap: 8px; flex-wrap: nowrap; }
  .telegram-nav > :is(.nav-cta, .download-btn, .invite-cta) {
    display: inline-flex;
    order: 0;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-height: 34px;
    justify-content: center;
    gap: 0;
    padding: 0;
    font-size: 0;
  }
  .telegram-nav > .download-btn span { display: none; }
  .site-monochrome .telegram-nav > .i18n-language-switcher { order: 0; }
  .telegram-contact-trigger {
    width: 34px;
    min-height: 34px;
    padding: 0;
  }
  .telegram-contact-trigger span { display: none; }
}
