/* Opt in with has-service-navigation on body; legacy navigation stays untouched. */
.has-service-navigation {
  --service-navigation-space: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  padding-bottom: var(--service-navigation-space);
}
.has-service-navigation.cabinet-app .app-main { padding-bottom: 28px; }

.portal-service-navigation,
.portal-help-navigation,
.portal-service-header {
  --service-nav-paper: #faf7ef;
  --service-nav-ink: #263f32;
  --service-nav-forest: #294f3e;
  --service-nav-muted: #596657;
  --service-nav-line: #d5dbca;
  --service-nav-soft: #edf1e3;
  --service-nav-focus: #a56d26;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

.portal-service-navigation {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 80;
  padding: 7px max(12px, env(safe-area-inset-right, 0px)) max(9px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--service-nav-line);
  background: var(--service-nav-paper);
}

.portal-service-navigation__items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  max-width: 520px;
  margin-inline: auto;
}

.portal-service-navigation--two .portal-service-navigation__items {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-service-navigation .portal-service-navigation__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 56px;
  padding: 5px;
  border-radius: 4px;
  color: var(--service-nav-muted);
  font-size: .75rem;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.portal-service-navigation .portal-service-navigation__link[aria-current="page"] {
  background: var(--service-nav-soft);
  color: var(--service-nav-forest);
  font-weight: 650;
}

.portal-service-navigation__link svg {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-help-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  margin: 0 0 22px;
  border-bottom: 0;
}

.portal-help-navigation a {
  position: relative;
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  min-height: 48px;
  padding: 10px 8px;
  border-radius: 8px;
  background: var(--service-nav-soft);
  color: var(--service-nav-muted);
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}

.portal-help-navigation a[aria-current="page"] {
  color: var(--service-nav-paper);
  background: var(--service-nav-forest);
  font-weight: 650;
}

.portal-help-navigation a[aria-current="page"]::after {
  content: none;
}

.portal-service-header {
  border-bottom: 1px solid var(--service-nav-line);
  background: var(--service-nav-paper);
  color: var(--service-nav-ink);
}

.portal-service-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  min-height: 65px;
  max-width: 1080px;
  margin-inline: auto;
  padding: 8px 20px;
}

.portal-service-header .portal-service-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  color: var(--service-nav-forest);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
}

.portal-service-header__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #a6b798;
  border-radius: 50%;
  font-size: 21px;
  font-weight: 400;
}

.portal-service-header__index {
  font-size: .8125rem;
  font-weight: 400;
}

.portal-service-header__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--service-nav-muted);
  font-size: .6875rem;
  line-height: 1.4;
  white-space: nowrap;
}

.portal-service-header__status > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a47b3b;
}

.portal-service-navigation .portal-service-navigation__link:focus-visible,
.portal-help-navigation a:focus-visible,
.portal-service-header .portal-service-header__brand:focus-visible {
  outline: 3px solid var(--service-nav-focus);
  outline-offset: 3px;
}

@media (hover: hover) {
  .portal-service-navigation .portal-service-navigation__link:hover {
    background: var(--service-nav-soft);
    color: var(--service-nav-forest);
  }

  .portal-help-navigation a:hover {
    color: var(--service-nav-forest);
  }
}

@media (max-width: 600px) {
  .portal-service-header__inner { padding-inline: 18px; }
}

@media (max-width: 340px) {
  .portal-service-header__inner { padding-inline: 16px; }
  .portal-service-header .portal-service-header__brand { font-size: .9375rem; }
  .portal-service-header__status { font-size: .625rem; }
  .portal-help-navigation { gap: 17px; }
}
