/* Keep the filled Tools state readable in both site palettes. */
.textcad-community .site-header .ap-header .ap-tool-link {
  transition: none;
}

.textcad-community .site-header .ap-header .ap-tool-link:is(:hover, :focus-visible) {
  background-color: #fff8f4;
  border-color: #847871;
  color: #130d0c !important;
  transform: none;
}

.textcad-community .site-header .ap-header > .tc-app-link {
  min-block-size: 36px;
  font-size: 12px;
  line-height: 1.25;
}

.textcad-community .site-header .main-navigation a:is(:hover, :focus-visible),
.textcad-community .tc-page-hero .tc-page-nav a:is(:hover, :focus-visible) {
  text-decoration: underline;
  text-underline-offset: .22em;
}

html[theme="light"] .textcad-community .site-header .main-navigation a:is(:hover, :focus-visible) {
  color: #130d0c !important;
}

.textcad-community .tc-page-hero .tc-page-nav {
  gap: 4px clamp(12px, 2vw, 24px);
  font-size: 14px;
  line-height: 1.35;
}

.textcad-community .tc-page-hero .tc-page-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  max-inline-size: 100%;
  padding-block: 4px;
}

/* The Russian menu needs an extra row before the desktop header fits. */
@media (min-width: 1201px) and (max-width: 1399px) {
  html[lang^="ru"] .textcad-community .site-header .site-header-inner {
    flex-wrap: wrap;
  }

  html[lang^="ru"] .textcad-community .site-header .main-navigation {
    order: 90;
    flex: 0 0 100%;
    margin-inline: 0;
  }
}

@media (max-width: 760px) {
  .textcad-community .site-header .ap-header > .tc-app-link {
    padding-inline: 9px;
  }
}

/* Keep the style and language switches separate from account navigation. */
@media (max-width: 520px) {
  .textcad-community .site-header .site-header-inner {
    grid-template-columns: minmax(0, 1fr) minmax(151px, auto);
  }

  .textcad-community .site-header .tc-style-switch {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }

  .textcad-community .site-header .tc-header-apps {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .textcad-community .site-header .tc-language-switch {
    grid-column: 2;
    grid-row: 3;
    justify-self: start;
    margin-inline: 0;
  }

  .textcad-community .site-header .tc-account-link {
    grid-column: 2;
    grid-row: 3;
    font-size: 11px;
  }
}

@media (min-width: 421px) and (max-width: 520px) {
  .textcad-community .site-header .site-header-inner {
    grid-template-columns: minmax(0, 1fr) minmax(171px, auto);
  }
}
