/* Header Telegram / MAX. Rest: site-color fill, raised glyph. Hover: soft disc and ring. Tip stays in the logo row. */

.theme-bereg { --msg: #2d423a; }
.theme-terrasy { --msg: #B89768; }
.theme-paluba { --msg: #002244; }
.theme-marshrut { --msg: #4a5d4e; }
.theme-canvas { --msg: #d2b48c; }
.theme-terminal { --msg: #005eb8; }
.theme-management { --msg: #4a6f78; }

html body .site-header a.chan,
html body .nav-extra-chans a.chan,
html body app-header a[aria-label="Telegram"],
html body app-header a[aria-label="MAX"] {
  position: relative;
  overflow: visible;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  opacity: 1;
  color: var(--msg, #B89768);
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  transform: translateY(-2px);
  text-decoration: none;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, border-radius 0.16s ease;
}

html body .site-header a.chan:hover,
html body .site-header a.chan:focus-visible,
html body .nav-extra-chans a.chan:hover,
html body .nav-extra-chans a.chan:focus-visible,
html body app-header a[aria-label="Telegram"]:hover,
html body app-header a[aria-label="Telegram"]:focus-visible,
html body app-header a[aria-label="MAX"]:hover,
html body app-header a[aria-label="MAX"]:focus-visible {
  color: var(--msg, #B89768);
  border-radius: 999px;
  background-color: color-mix(in srgb, currentColor 12%, transparent);
  background-image: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 75%, transparent);
  transform: none;
}

html body .site-header a.chan svg,
html body .nav-extra-chans a.chan svg,
html body app-header a[aria-label="Telegram"] svg,
html body app-header a[aria-label="MAX"] svg {
  width: 26px;
  height: 26px;
  display: block;
  transition: opacity 0.16s ease;
}

html body .site-header a.chan path,
html body .nav-extra-chans a.chan path,
html body app-header a[aria-label="Telegram"] path,
html body app-header a[aria-label="MAX"] path {
  fill: currentColor;
  stroke: none;
}

html body .site-header a.chan canvas.grain,
html body .nav-extra-chans a.chan canvas.grain,
html body app-header a[aria-label="Telegram"] canvas.grain,
html body app-header a[aria-label="MAX"] canvas.grain {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

html body .site-header a.chan::after,
html body .nav-extra-chans a.chan::after,
html body app-header a[aria-label="Telegram"]::after,
html body app-header a[aria-label="MAX"]::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  right: auto;
  z-index: 420;
  width: max-content;
  max-width: none;
  margin: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
  background: rgba(31, 27, 24, 0.94);
  color: #fff;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 8px 20px rgba(31, 27, 24, 0.2);
}

html body .site-header a.chan::before,
html body .nav-extra-chans a.chan::before,
html body app-header a[aria-label="Telegram"]::before,
html body app-header a[aria-label="MAX"]::before {
  content: "";
  display: block;
  position: absolute;
  left: 50%;
  right: auto;
  z-index: 421;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 5px solid transparent;
  background: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

html body .nav-extra-chans a.chan::after {
  top: calc(100% + 9px);
  bottom: auto;
  transform: translateX(-50%) translateY(-3px);
}

html body .nav-extra-chans a.chan::before {
  top: calc(100% + 4px);
  bottom: auto;
  border-top-width: 0;
  border-bottom-color: rgba(31, 27, 24, 0.94);
  transform: translateX(-50%) translateY(-3px);
}

html body .site-header a.chan.chan::after,
html body app-header a[aria-label="Telegram"]::after,
html body app-header a[aria-label="MAX"]::after {
  top: 100%;
  bottom: auto;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  transform: translateX(-50%) translateY(2px);
}

html body .site-header a.chan.chan::before,
html body app-header a[aria-label="Telegram"]::before,
html body app-header a[aria-label="MAX"]::before {
  content: none;
}

html body .site-header a.chan:hover::after,
html body .site-header a.chan:focus-visible::after,
html body .nav-extra-chans a.chan:hover::after,
html body .nav-extra-chans a.chan:focus-visible::after,
html body app-header a[aria-label="Telegram"]:hover::after,
html body app-header a[aria-label="Telegram"]:focus-visible::after,
html body app-header a[aria-label="MAX"]:hover::after,
html body app-header a[aria-label="MAX"]:focus-visible::after,
html body .site-header a.chan:hover::before,
html body .site-header a.chan:focus-visible::before,
html body .nav-extra-chans a.chan:hover::before,
html body .nav-extra-chans a.chan:focus-visible::before,
html body app-header a[aria-label="Telegram"]:hover::before,
html body app-header a[aria-label="Telegram"]:focus-visible::before,
html body app-header a[aria-label="MAX"]:hover::before,
html body app-header a[aria-label="MAX"]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
