/* Active only when both Telegram account links pass validation. */
body.hr-contact-enabled {
  height: var(--hr-viewport-height, 100dvh);
  overflow: hidden;
}

body.hr-contact-enabled #site-shell {
  min-height: 0;
  position: fixed;
  top: var(--hr-viewport-top, 0px);
  left: var(--hr-viewport-left, 0px);
  width: var(--hr-viewport-width, 100%);
  height: max(1px, calc(var(--hr-viewport-height, 100dvh) - var(--hr-contact-height, 80px)));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: var(--hr-header-clearance, 100px);
  scroll-padding-bottom: 16px;
}

body.hr-contact-enabled #site-shell .site-header {
  position: sticky;
  top: 0;
}

.hr-contact {
  box-sizing: border-box;
  position: fixed;
  z-index: 40;
  top: calc(var(--hr-viewport-top, 0px) + var(--hr-viewport-height, 100dvh) - var(--hr-contact-height, 80px));
  left: var(--hr-viewport-left, 0px);
  width: var(--hr-viewport-width, 100%);
  display: flex;
  justify-content: flex-end;
  padding: 10px max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid #31515e;
  background: #07141c;
  color: #fff;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.3;
}

.hr-contact__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 10px;
  max-width: 520px;
  min-width: 0;
}

.hr-contact__bubble {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 44px;
  min-height: 48px;
  padding: 11px 19px;
  border: 1px solid #76d8e4;
  border-radius: 28px;
  background: #0d2d39;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.hr-contact__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hr-contact__arrow {
  flex: 0 0 auto;
  color: #70edfb;
  font-size: 18px;
  line-height: 1;
}

.hr-contact__bubble.is-emphasized {
  background: #124655;
  box-shadow: 0 0 0 2px #00c9e24d;
  animation: hr-contact-pulse 700ms ease-out 1;
}

.hr-contact__bubble:hover {
  background: #185263;
}

.hr-contact__bubble:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  background: #185263;
}

.hr-contact:hover .hr-contact__bubble,
.hr-contact:focus-within .hr-contact__bubble {
  animation-play-state: paused;
}

@keyframes hr-contact-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #00c9e24d; }
  45% { box-shadow: 0 0 0 5px #00c9e224; }
}

@media (max-width: 800px) {
  body.hr-contact-enabled #site-nav {
    max-height: max(0px, calc(var(--hr-viewport-height, 100dvh) - var(--hr-contact-height, 80px) - 72px));
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
}

@media (max-width: 570px) {
  .hr-contact { padding-top: 8px; }
  .hr-contact__links {
    width: 100%;
    max-width: 440px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .hr-contact__bubble { padding: 10px 12px; font-size: 13px; gap: 6px; }
}

@media (max-height: 400px) {
  .hr-contact { padding-top: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .hr-contact__bubble { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .hr-contact__bubble { animation: none !important; transition: none !important; }
}

@media print {
  body.hr-contact-enabled { height: auto; overflow: visible; }
  body.hr-contact-enabled #site-shell { position: static; width: auto; height: auto; overflow: visible; }
  .hr-contact { display: none !important; }
}
