.rmc-portal .rmc-header {
  border-top: 3px solid var(--rmc-green);
  background: #fff;
}

.rmc-header .rmc-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 32px;
  min-height: 102px;
  padding-block: 12px;
}

.rmc-header .rmc-brand {
  gap: 16px;
  width: fit-content;
  max-width: 100%;
}

.rmc-brand-mark {
  display: grid;
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  place-items: center;
  background: #f2f7f3;
  border: 1px solid #dbeae0;
  border-radius: 17px;
}

.rmc-header .rmc-brand-mark img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.rmc-header .rmc-brand-name strong {
  max-width: 24ch;
  font-size: clamp(1.23rem, 2vw, 1.55rem);
  font-weight: 750;
  line-height: 1.14;
  text-wrap: balance;
}

@media (min-width: 491px) {
  .rmc-portal:not(.rmc-large-text) .rmc-header .rmc-brand-name strong {
    max-width: none;
    font-size: clamp(1.05rem, 1.55vw, 1.2rem);
    text-wrap: wrap;
  }
}

.rmc-header .rmc-brand-name small {
  margin-top: 6px;
  color: var(--rmc-green);
  font-size: .92rem;
  font-weight: 670;
  letter-spacing: .055em;
}

.rmc-header .rmc-tools {
  display: grid;
  grid-template-columns: clamp(12rem, 24vw, 20rem) auto;
  gap: 12px;
}

.rmc-header .rmc-search {
  min-width: 0;
  min-height: 52px;
  align-items: stretch;
  overflow: visible;
  padding: 3px;
  border: 1px solid #c8d8ce;
  border-radius: 12px;
  background: #f5f8f5;
}

.rmc-header .rmc-search input[type='search'] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding-inline: 10px;
  color: var(--rmc-ink);
  font-size: max(16px, .92rem);
}

.rmc-header .rmc-search input::placeholder { color: #4e655f; opacity: 1; }

.rmc-header .rmc-search button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 44px;
  padding-inline: 12px;
  border-radius: 8px;
  color: #fff;
  background: var(--rmc-green);
  font: inherit;
  font-size: .85rem;
  font-weight: 680;
}

.rmc-header .rmc-search button:hover { background: var(--rmc-green-dark); }
.rmc-header .rmc-search :focus-visible { outline-offset: 1px; }

.rmc-portal .rmc-header .rmc-access {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 6px 14px;
  border: 1px solid #c8d8ce;
  border-radius: 12px;
  color: var(--rmc-green-dark);
  background: #fff;
  font-size: .84rem;
  font-weight: 670;
  line-height: 1.25;
  text-decoration: none;
}

.rmc-header .rmc-access .fa { color: var(--rmc-green); font-size: 1.12em; }
.rmc-portal .rmc-header .rmc-access:hover { background: var(--rmc-mint); }

.rmc-portal .rmc-header .rmc-menu #mainmenu li a,
.rmc-portal .rmc-header .rmc-nav-contact {
  position: relative;
  padding-inline: clamp(10px, 1.14vw, 17px);
  font-size: .91rem;
  text-transform: none;
}

.rmc-portal .rmc-header .rmc-menu #mainmenu a.selected::after,
.rmc-portal .rmc-header .rmc-menu #mainmenu li.selected > a::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  background: var(--rmc-lime);
  content: '';
}

.rmc-portal .rmc-header .rmc-nav-external {
  align-self: center;
  justify-content: center;
  min-height: 44px;
  margin-block: 5px;
  padding: 8px 12px;
  border: 1px solid #577468;
  border-radius: 8px;
}

.rmc-portal .rmc-header .rmc-nav-external:hover { background: #27443b; }

@media (max-width: 920px) {
  .rmc-header .rmc-nav-inner { flex-wrap: wrap; align-items: center; gap: 0 15px; }
  .rmc-header .rmc-menu { order: 3; flex: 1 0 100%; flex-direction: column; padding-bottom: 6px; }
  .rmc-js .rmc-header .rmc-menu:not(.rmc-menu-open) { display: none; }
  .rmc-js .rmc-header .rmc-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 0 10px;
    border: 0;
    color: #fff;
    background: transparent;
    font: inherit;
    font-weight: 670;
  }
  .rmc-portal .rmc-header .rmc-menu #mainmenu { flex-direction: column; }
  .rmc-portal .rmc-header .rmc-menu #mainmenu li a { width: 100%; min-height: 45px; }
  .rmc-portal .rmc-header .rmc-nav-contact { min-height: 45px; }
  .rmc-portal .rmc-header .rmc-menu #mainmenu a.selected::after,
  .rmc-portal .rmc-header .rmc-menu #mainmenu li.selected > a::after {
    inset: 8px auto 8px 0;
    width: 2px;
    height: auto;
  }
}

@media (max-width: 760px) {
  .rmc-header .rmc-masthead {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
    min-height: auto;
  }
  .rmc-header .rmc-brand { gap: 11px; }
  .rmc-brand-mark { width: 53px; height: 53px; flex-basis: 53px; border-radius: 13px; }
  .rmc-header .rmc-brand-mark img { width: 42px; height: 42px; }
  .rmc-header .rmc-tools { grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 8px; }
  .rmc-portal .rmc-header .rmc-access { padding-inline: 10px; }
}

@media (max-width: 490px) {
  .rmc-header .rmc-brand-name strong { font-size: 1.12rem; }
  .rmc-portal:not(.rmc-large-text) .rmc-header .rmc-masthead {
    gap: 9px;
    padding-block: 10px;
  }
  .rmc-portal:not(.rmc-large-text) .rmc-header .rmc-brand { gap: 9px; }
  .rmc-portal:not(.rmc-large-text) .rmc-header .rmc-brand-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 11px;
  }
  .rmc-portal:not(.rmc-large-text) .rmc-header .rmc-brand-mark img {
    width: 36px;
    height: 36px;
  }
  .rmc-portal:not(.rmc-large-text) .rmc-header .rmc-brand-name strong {
    max-width: none;
    font-size: clamp(.89rem, 4vw, .98rem);
    line-height: 1.2;
    text-wrap: wrap;
  }
  .rmc-portal:not(.rmc-large-text) .rmc-header .rmc-brand-name small {
    margin-top: 3px;
    font-size: .875rem;
  }
  .rmc-header .rmc-tools { grid-template-columns: minmax(0, 1fr) minmax(114px, 39%); }
  .rmc-header .rmc-search input[type='search'] { padding-inline: 6px 2px; }
  .rmc-header .rmc-search button { padding-inline: 0; }
  .rmc-header .rmc-search-caption { display: none; }
}

.rmc-large-text .rmc-header .rmc-access,
.rmc-large-text .rmc-header .rmc-search { border-color: var(--rmc-line); }
.rmc-large-text .rmc-header .rmc-nav { --rmc-green-dark: #161616; }
