.site-theme .site-header-bar {
  --header-height: 63px;
  position: relative;
  z-index: 20;
  display: block;
  box-sizing: border-box;
  min-height: var(--header-height);
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #513b28;
  background: var(--site-header);
  color: var(--ink);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 2vw, 1.25rem);
  width: min(1150px, calc(100% - 48px));
  min-height: calc(var(--header-height) - 1px);
  margin-inline: auto;
}

.site-header-bar [hidden] {
  display: none !important;
}

.site-header-bar .site-header-brand {
  display: inline-flex;
  flex: none;
  align-items: baseline;
  gap: .35rem;
  color: var(--ink);
  font-size: clamp(1.48rem, 2.25vw, 2.02rem);
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  letter-spacing: -.08em;
  text-decoration: none;
}

.site-header-brand strong {
  font-size: 1.2em;
}

.site-header-brand span {
  color: var(--brand);
  font-size: .82em;
}

.site-header-bar .site-header-telegram {
  display: grid;
  box-sizing: border-box;
  flex: none;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-inline-start: auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
}

.site-header-bar .site-header-telegram:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.site-header-telegram svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.site-header-account {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(11rem, 42vw);
}

.site-header-bar .site-header-action {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin: 0;
  padding: .35rem clamp(.55rem, 2vw, .9rem);
  border: 1px solid #9c6129;
  border-radius: .65rem;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: .875rem;
  font-weight: 750;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.site-header-action svg {
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.site-header-bar .site-header-action:is(:hover, [aria-expanded="true"]) {
  background: var(--brand-soft);
}

.site-header-action #headerUsername {
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-global-menu {
  position: relative;
  display: flex;
  flex: none;
  align-self: center;
  color: var(--ink);
}

.site-global-menu .site-global-menu-toggle {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: inherit;
  box-shadow: none;
  cursor: pointer;
}

.site-global-menu-icon {
  width: 1.25rem;
  height: .125rem;
  border-radius: .125rem;
  background: currentColor;
  box-shadow: 0 -.39rem currentColor, 0 .39rem currentColor;
}

.site-global-menu .site-global-menu-panel,
.site-header-user-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + .45rem);
  right: 0;
  display: grid;
  box-sizing: border-box;
  max-width: calc(100vw - 3.5rem);
  gap: .125rem;
  margin: 0;
  padding: .4rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--card-face);
  box-shadow: var(--card-shadow);
}

.site-global-menu .site-global-menu-panel {
  width: 19rem;
  max-height: min(24rem, calc(100vh - 6.5rem));
  overflow: auto;
  overscroll-behavior: contain;
}

.site-header-user-menu {
  width: min(12rem, 65vw);
}

.site-global-menu .site-global-menu-panel a,
.site-header-user-menu button {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-height: 2.65rem;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  padding: .45rem .75rem;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: right;
  text-decoration: none;
}

.site-header-user-menu button {
  cursor: pointer;
}

.site-global-menu .site-global-menu-toggle:is(:hover, [aria-expanded="true"]),
.site-global-menu .site-global-menu-panel a:is(:hover, :focus-visible, [aria-current="page"]),
.site-header-user-menu button:hover {
  background: var(--brand-soft);
  color: var(--brand-hot);
}

.site-header-bar :is(a, button):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-theme.telegram-theme {
  padding: 0 0 1.5rem;
}

.telegram-theme main {
  width: calc(100% - 28px);
  margin: 1.5rem auto 0;
}

.site-theme.admin-redirect {
  padding: 0;
}

.admin-redirect main {
  padding: 1.5rem;
}

@media (max-width: 700px) {
  .site-theme .site-header-bar {
    --header-height: 53px;
  }
  .site-header-inner {
    width: calc(100% - 28px);
  }
}
