/* Shared mobile navigation. The existing desktop layout starts above 992px. */
.mobile-nav-backdrop,
#nav-main .mobile-language-heading,
#nav-main .mobile-nav-item-icon { display: none; }

#tools a:focus-visible {
  outline: 2px solid #003c70;
  outline-offset: 3px;
}

@media (max-width: 992px) {
  /* Below the fixed header, above the page; the menu stays non-modal. */
  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1029;
    background: rgba(0, 35, 65, .24);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
  }

  .mobile-nav-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #nav-main .mobile-nav-toggle {
    position: relative;
    display: block;
    width: 44px;
    height: 44px;
    margin: 8px 8px 8px 16px;
    padding: 10px;
    border: 1px solid rgba(0, 60, 112, .14);
    border-radius: 12px;
    background: #fff;
    color: #003c70;
    line-height: 1;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
    touch-action: manipulation;
  }

  /* The highlight follows the open state, including on touch devices. */
  #nav-main .mobile-nav-toggle[aria-expanded="true"] {
    background: #fff4ed;
    border-color: #fa7636;
    color: #003c70;
  }

  /* Keep the expanded menu's existing highlight distinct from pointer feedback. */
  @media (hover: hover) {
    #nav-main .mobile-nav-toggle:not([aria-expanded="true"]):not(:disabled):not(.disabled):not([aria-disabled="true"]):hover {
      background: #dfedf7;
      border-color: #9fbdd3;
    }
  }

  #nav-main .mobile-nav-toggle:not([aria-expanded="true"]):not(:disabled):not(.disabled):not([aria-disabled="true"]):is(:focus-visible, :active) {
    background: #dfedf7;
    border-color: #9fbdd3;
  }

  #nav-main .mobile-nav-toggle:focus-visible,
  #nav-main .mobile-nav-panel a:focus-visible,
  #nav-main .mobile-nav-language select:focus-visible,
  #nav-main .mobile-language-picker summary:focus-visible {
    outline: 2px solid #003c70;
    outline-offset: 3px;
  }

  #nav-main .mobile-nav-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 18px;
  }

  #nav-main .mobile-nav-line {
    position: absolute;
    left: 0;
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .22s ease, opacity .16s ease;
  }

  #nav-main .mobile-nav-line:nth-child(1) { top: 1px; }
  #nav-main .mobile-nav-line:nth-child(2) { top: 8px; }
  #nav-main .mobile-nav-line:nth-child(3) { top: 15px; }

  #nav-main .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  #nav-main .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(.4);
  }

  #nav-main .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  #nav-main .mobile-nav-panel,
  #nav-main .mobile-nav-panel.in {
    padding: 0 12px;
    border-top: 1px solid rgba(0, 60, 112, .09);
    border-radius: 0 0 22px 22px;
    background: #fff;
    box-shadow: 0 16px 32px -20px rgba(0, 35, 65, .3);
    max-height: calc(100vh - 60px) !important;
    max-height: calc(100svh - 60px) !important;
  }

  #nav-main .mobile-nav-panel.in {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  #nav-main .mobile-nav-panel.collapsing {
    transition: height .24s ease;
  }

  #nav-main .mobile-nav-panel > .navbar-nav {
    width: 100%;
    max-width: 680px;
    margin: 14px auto 16px !important;
    padding: 0 0 env(safe-area-inset-bottom, 0px);
    text-align: left;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li + li {
    margin-top: 6px;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 36px 10px 12px !important;
    border-radius: 14px;
    color: #003c70;
    font-size: 16px !important;
    font-weight: 500;
    line-height: 1.5;
    text-transform: none;
    white-space: normal;
    overflow-wrap: anywhere;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease;
  }

  #nav-main .mobile-nav-item-label {
    flex: 1 1 auto;
    min-width: 0;
    text-align: start;
    white-space: normal;
  }

  #nav-main .mobile-nav-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 11px;
    background: #edf4fa;
    color: #003c70;
  }

  #nav-main .mobile-nav-item-icon svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li > a::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    opacity: .45;
    transform: translateY(-50%) rotate(45deg);
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li > a:hover,
  #nav-main .mobile-nav-panel > .navbar-nav > li > a:focus-visible {
    background: #f2f6f9;
    color: #003c70;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li > a[aria-current="page"] {
    background: #fff4ed;
    box-shadow: inset 3px 0 0 #fa7636;
    font-weight: 600;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > li > a[aria-current="page"] .mobile-nav-item-icon {
    background: #ffe5d5;
  }

  #nav-main .mobile-nav-panel > .navbar-nav > .mobile-nav-language {
    position: relative;
    margin-top: 14px;
    padding: 14px 4px 0;
    border-top: 1px solid rgba(0, 60, 112, .1);
  }

  #nav-main .mobile-language-heading {
    display: block;
    margin: 0 0 8px;
    padding: 0 2px;
    color: #526f86;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: .02em;
  }

  /* Keep the previous select usable while older HTML remains cached. */
  #nav-main .mobile-nav-language select,
  #nav-main .mobile-language-picker summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-height: 54px;
    height: auto;
    margin: 0 !important;
    padding: 12px 14px;
    border: 1px solid #cbdde9;
    border-radius: 14px;
    background-color: #edf4fa;
    color: #003c70;
    font-family: var(--portal-font-family);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    list-style: none;
    transition: background-color .18s ease, border-color .18s ease;
  }

  #nav-main .mobile-language-picker summary::-webkit-details-marker { display: none; }
  #nav-main .mobile-nav-language select { display: block; }
  #nav-main .mobile-language-picker summary {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 12px;
    text-transform: none;
  }
  #nav-main .mobile-language-picker summary.has-current-flag {
    grid-template-columns: 24px minmax(0, 1fr) 12px;
  }
  #nav-main .mobile-language-current {
    min-width: 0;
    white-space: normal;
  }
  #nav-main .mobile-language-picker summary::before {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("/Assets/Img/icons/lucide/globe.svg") center / contain no-repeat;
    mask: url("/Assets/Img/icons/lucide/globe.svg") center / contain no-repeat;
    opacity: .7;
  }
  #nav-main .mobile-language-picker summary.has-current-flag::before { content: none; }
  #nav-main .mobile-language-picker summary:hover,
  #nav-main .mobile-language-picker summary:focus-visible,
  #nav-main .mobile-language-picker[open] summary {
    border-color: #9fbdd3;
    background-color: #e5eff7;
  }
  #nav-main .mobile-language-picker:not([open]) > ul { display: none; }
  #nav-main .mobile-language-picker summary::after {
    content: "";
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }
  #nav-main .mobile-language-picker[open] summary::after { transform: rotate(225deg); }

  #nav-main .mobile-language-picker > ul {
    float: none !important;
    width: 100%;
    /* Reserve the summary, gap and focus outline even in low landscape views. */
    max-height: min(320px, 48vh, max(48px, calc(100vh - var(--navigation-header-height, 60px) - 74px)));
    max-height: min(320px, 48svh, max(48px, calc(100svh - var(--navigation-header-height, 60px) - 74px)));
    margin: 8px 0 0 !important;
    padding: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #91aabe #edf2f6;
    scrollbar-gutter: stable;
    scroll-padding-block: 6px;
    border: 1px solid #d5e1e9;
    border-radius: 14px;
    background: #f7f9fb;
    list-style: none;
  }
  #nav-main .mobile-language-picker > ul::-webkit-scrollbar { width: 6px; }
  #nav-main .mobile-language-picker > ul::-webkit-scrollbar-track { background: #edf2f6; }
  #nav-main .mobile-language-picker > ul::-webkit-scrollbar-thumb {
    border-radius: 6px;
    background: #91aabe;
  }
  #nav-main .mobile-language-picker[open] > ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  #nav-main .mobile-language-picker > ul::before,
  #nav-main .mobile-language-picker > ul::after { display: none; }
  #nav-main .mobile-language-picker > ul > li {
    float: none;
    min-width: 0;
    margin: 0;
    padding: 0;
  }
  #nav-main .mobile-language-picker > ul > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    margin: 0;
    padding: 10px !important;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #fff;
    color: #003c70;
    font-family: var(--portal-font-family);
    font-size: 14px !important;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  /* Use the native language names emitted by the shared server control. */
  #nav-main .mobile-language-picker a::after { content: attr(title); }
  #nav-main .mobile-language-enhanced > ul > li > a {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 10px;
  }
  #nav-main .mobile-language-enhanced .mobile-language-name {
    min-width: 0;
    white-space: normal;
    text-align: start;
  }
  #nav-main .mobile-language-enhanced > ul > li > a::after {
    content: "";
    width: 9px;
    height: 5px;
    margin-top: -3px;
    border-bottom: 2px solid #d85b1c;
    border-left: 2px solid #d85b1c;
    transform: rotate(-45deg);
    visibility: hidden;
  }
  #nav-main .mobile-language-picker a:hover,
  #nav-main .mobile-language-picker a:focus-visible { background: #eef3f7; }
  #nav-main .mobile-language-picker a[aria-current="true"],
  #nav-main .mobile-language-picker a[aria-current="page"] {
    background: #fff4ed;
    border-color: #f7c6aa;
    box-shadow: none;
    font-weight: 600;
  }
  #nav-main .mobile-language-enhanced a[aria-current="true"]::after,
  #nav-main .mobile-language-enhanced a[aria-current="page"]::after { visibility: visible; }
}

/* Preserve whole language names on small phones, including the longest labels. */
@media (max-width: 399px) {
  #nav-main .mobile-language-picker[open] > ul {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 992px) and (prefers-reduced-motion: reduce) {
  .mobile-nav-backdrop,
  #nav-main .mobile-nav-toggle,
  #nav-main .mobile-nav-line,
  #nav-main .mobile-language-picker summary,
  #nav-main .mobile-nav-panel.collapsing,
  #nav-main .mobile-nav-panel a {
    transition: none;
  }
}

/* One toolbar for both public masters, using the existing controls. */
/* Keep layout changes immediate when rotating or crossing a breakpoint. */
#nav-main .navbar-brand,
.call-to-action,
#searchBoxToggleButton,
.profile-menu > a {
  transition-property: color, background-color, border-color, box-shadow;
}

.mobile-toolbar-row { display: none; }
@media (max-width: 992px) {
  html.mobile-toolbar-ready body:not(.homepage) {
    padding-top: var(--navigation-header-height, 60px);
  }

  body #nav-main:has(.mobile-toolbar) {
    padding-right: 12px;
    padding-left: 12px;
  }

  body #nav-main .navbar-header.mobile-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    float: none;
    min-height: 60px;
    margin: 0;
    padding: 8px 0;
  }

  body #nav-main .mobile-toolbar::before,
  body #nav-main .mobile-toolbar::after { display: none; }

  body #nav-main .mobile-toolbar > .mobile-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  body #nav-main .mobile-toolbar-row > .navbar-brand {
    order: 0;
    flex: 0 0 clamp(96px, 27vw, 112px);
    width: clamp(96px, 27vw, 112px);
    height: 44px;
    margin: 0 auto 0 0 !important;
    padding: 0 !important;
  }

  body #nav-main .mobile-toolbar-row > .mobile-nav-toggle {
    order: 3;
    flex: 0 0 44px;
    float: none;
    margin: 0;
  }

  body #nav-main .mobile-toolbar-row > .call-to-action {
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    position: static;
    float: none;
    width: auto;
    min-width: min-content;
    max-width: 100%;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 4px 8px !important;
    border: 1px solid #d5e1e9;
    border-radius: 10px;
    background: #f2f6f9;
    color: #003c70 !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    text-transform: none;
    white-space: normal;
    box-shadow: none;
  }

  body #nav-main #searchBoxToggleButton {
    order: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    position: static;
    float: none;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0 !important;
    border: 1px solid #d5e1e9;
    border-radius: 12px;
    background: #fff;
    color: #003c70 !important;
    font-size: 18px !important;
    line-height: 1;
    box-shadow: none;
  }

  body #nav-main .mobile-toolbar > .profile-menu {
    position: static;
    float: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: 1px solid #d5e1e9;
    border-radius: 10px;
    background: #f2f6f9;
    box-shadow: none;
  }

  body #nav-main .mobile-toolbar > .profile-menu > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px !important;
    color: #003c70 !important;
    font-size: 14px !important;
    line-height: 1.5;
    text-transform: none;
    white-space: normal;
  }

  body #nav-main .mobile-toolbar-row > .call-to-action:hover,
  body #nav-main .mobile-toolbar-row > .call-to-action:focus-visible,
  body #nav-main #searchBoxToggleButton:hover,
  body #nav-main #searchBoxToggleButton:focus-visible {
    background-color: #e5eef5;
    color: #003c70 !important;
  }

  body #nav-main .mobile-toolbar-row > a:focus-visible {
    outline: 2px solid #003c70;
    outline-offset: 2px;
  }

  body #nav-main:has(.mobile-toolbar) .mobile-nav-panel,
  body #nav-main:has(.mobile-toolbar) .mobile-nav-panel.in {
    margin-right: -12px;
    margin-left: -12px;
    max-height: calc(100vh - var(--navigation-header-height, 60px)) !important;
    max-height: calc(100svh - var(--navigation-header-height, 60px)) !important;
  }

  html.mobile-toolbar-ready body ol.breadcrumb { padding-top: 12px; }
}

@media (max-width: 319px) {
  body #nav-main .mobile-toolbar > .mobile-toolbar-row { flex-wrap: wrap; }
  body #nav-main .mobile-toolbar-row > .call-to-action {
    order: 4;
    flex: 1 0 100%;
  }
}

/* Header actions: the same search affordance at every screen size. */
body #searchBoxToggleButton,
body #nav-main #searchBoxToggleButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0 !important;
  border: 1px solid #cbdde9;
  border-radius: 12px;
  background: #edf4fa;
  color: #003c70 !important;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 60, 112, .06);
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

body #searchBoxToggleButton > .fa-search {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0;
  font-size: 22px;
  line-height: 1;
}

body #searchBoxToggleButton > .fa-search::before {
  display: block;
  vertical-align: 0;
}

body #searchBoxToggleButton:hover,
body #searchBoxToggleButton:focus-visible,
body #nav-main #searchBoxToggleButton:hover,
body #nav-main #searchBoxToggleButton:focus-visible {
  border-color: #9fbdd3;
  background: #dfedf7;
  color: #003c70 !important;
  box-shadow: 0 3px 8px rgba(0, 60, 112, .12);
}

body #searchBoxToggleButton:focus-visible {
  outline: 2px solid #003c70;
  outline-offset: 3px;
}

/* Replace the legacy protruding ovals only above the mobile breakpoint. */
@media not all and (max-width: 992px) {
  body #searchBoxToggleButton,
  body .call-to-action {
    position: fixed;
    top: calc(var(--navigation-header-height, 96px) + 8px);
    right: 16px;
    z-index: 1031;
    float: none;
    margin: 0;
  }

  body .call-to-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 180px;
    height: auto;
    min-height: 44px;
    padding: 10px 14px !important;
    border: 1px solid #003c70;
    border-radius: 12px;
    background: #003c70;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
    box-shadow: 0 3px 8px rgba(0, 60, 112, .16);
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
  }

  @supports ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
    body .call-to-action::before {
      content: "";
      flex: 0 0 18px;
      width: 18px;
      height: 18px;
      background-color: currentColor;
      -webkit-mask: url("/Assets/Img/icons/lucide/circle-plus.svg?v=20261104-1") center / contain no-repeat;
      mask: url("/Assets/Img/icons/lucide/circle-plus.svg?v=20261104-1") center / contain no-repeat;
    }
  }

  body .call-to-action ~ #searchBoxToggleButton { right: 204px; }

  body .call-to-action:hover,
  body .call-to-action:focus-visible {
    border-color: #00538d;
    background: #00538d;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(0, 60, 112, .22);
  }

  body .call-to-action:focus-visible {
    outline: 2px solid #003c70;
    outline-offset: 3px;
  }

  /* Pages without a breadcrumb need the same clearance below these controls. */
  body:not(.homepage):not(:has(ol.breadcrumb)):has(#searchBoxToggleButton, .call-to-action) {
    padding-top: calc(var(--navigation-header-height, 96px) + 64px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body #searchBoxToggleButton,
  body #nav-main #searchBoxToggleButton { transition: none; }
}

@media not all and (max-width: 992px) {
  @media (prefers-reduced-motion: reduce) {
    body .call-to-action { transition: none; }
  }
}

/* Shared by Main and Corporate; keep the compiled FlagList links intact. */
#tools {
  padding-bottom: 0;
}

#tools .navbar-nav.navbar-right {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin: 0;
}

#tools .navbar-nav.navbar-right > li {
  float: none;
  padding: 4px 0;
}

#tools .navbar-nav.navbar-right > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 30px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  transition: background-color .16s ease, border-color .16s ease;
}

#tools .navbar-nav.navbar-right > li > a:hover {
  background: #eef3f7;
  border-color: #d2dfe8;
}

#tools .navbar-nav.navbar-right > li > a[aria-current="true"] {
  background: #eef3f7;
  border-color: #003c70;
}

#tools .navbar-nav.navbar-right > li > a:focus-visible {
  outline: 2px solid #003c70;
  outline-offset: 1px;
}

:is(#tools, .mobile-language-picker) .flag,
:is(#tools, .mobile-language-picker) a:hover .flag {
  display: block;
  flex: 0 0 24px;
  float: none;
  width: 24px;
  height: 18px;
  margin: 0;
  padding: 0;
  border-radius: 2px;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 30, 55, .12);
  transform: none;
  transition: none;
}

:is(#tools, .mobile-language-picker) .flag-it { background-image: url('../Img/Flags/it.svg'); }
:is(#tools, .mobile-language-picker) .flag-en { background-image: url('../Img/Flags/en.svg'); }
:is(#tools, .mobile-language-picker) .flag-de { background-image: url('../Img/Flags/de.svg'); }
:is(#tools, .mobile-language-picker) .flag-fr { background-image: url('../Img/Flags/fr.svg'); }
:is(#tools, .mobile-language-picker) .flag-es { background-image: url('../Img/Flags/es.svg'); }
:is(#tools, .mobile-language-picker) .flag-pt-pt { background-image: url('../Img/Flags/pt-pt.svg'); }
:is(#tools, .mobile-language-picker) .flag-ro { background-image: url('../Img/Flags/ro.svg'); }
:is(#tools, .mobile-language-picker) .flag-ru { background-image: url('../Img/Flags/ru.svg'); }
:is(#tools, .mobile-language-picker) .flag-sv { background-image: url('../Img/Flags/sv.svg'); }
:is(#tools, .mobile-language-picker) .flag-sl { background-image: url('../Img/Flags/sl.svg'); }
:is(#tools, .mobile-language-picker) .flag-zh-cn { background-image: url('../Img/Flags/zh-cn.svg'); }
:is(#tools, .mobile-language-picker) .flag-ja { background-image: url('../Img/Flags/ja.svg'); }
:is(#tools, .mobile-language-picker) .flag-nl { background-image: url('../Img/Flags/nl.svg'); }
:is(#tools, .mobile-language-picker) .flag-no { background-image: url('../Img/Flags/no.svg'); }
:is(#tools, .mobile-language-picker) .flag-pl { background-image: url('../Img/Flags/pl.svg'); }
:is(#tools, .mobile-language-picker) .flag-tr { background-image: url('../Img/Flags/tr.svg'); }
:is(#tools, .mobile-language-picker) .flag-hi { background-image: url('../Img/Flags/hi.svg'); }
:is(#tools, .mobile-language-picker) .flag-hu { background-image: url('../Img/Flags/hu.svg'); }
:is(#tools, .mobile-language-picker) .flag-fi { background-image: url('../Img/Flags/fi.svg'); }
:is(#tools, .mobile-language-picker) .flag-el { background-image: url('../Img/Flags/el.svg'); }
:is(#tools, .mobile-language-picker) .flag-cs { background-image: url('../Img/Flags/cs.svg'); }
:is(#tools, .mobile-language-picker) .flag-da { background-image: url('../Img/Flags/da.svg'); }

/* Keep this layout at fractional widths too (for example when zooming).
   The existing mobile rule hides the whole #tools bar through 992px. */
#tools > div {
  display: flex;
  /* Reserve the flag links' 26px height plus 4px padding on each side. */
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Long translated taglines must not push the flags out of the header. */
#tools > div > .navbar-nav:not(.navbar-right) {
  min-width: 0;
}

#tools > div > .navbar-nav:not(.navbar-right) > li {
  max-width: 100%;
  padding-top: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  #tools .navbar-nav.navbar-right > li > a {
    transition: none;
  }
}

/* Keep native emoji sequences intact, including joiners, selectors and flag tags.
   Enclosed symbols and regional indicators retain their original fallback fonts. */
@font-face {
  font-family: "Portal Native Emoji";
  src: local("Segoe UI Emoji"), local("Apple Color Emoji"), local("Noto Color Emoji");
  font-style: normal;
  font-weight: normal;
  unicode-range: U+200D,U+231A-231B,U+23E9-23EC,U+23F0,U+23F3,U+25FD-25FE,U+2614-2615,U+2648-2653,U+267F,U+2693,U+26A1,U+26AA-26AB,U+26BD-26BE,U+26C4-26C5,U+26CE,U+26D4,U+26EA,U+26F2-26F3,U+26F5,U+26FA,U+26FD,U+2705,U+270A-270B,U+2728,U+274C,U+274E,U+2753-2755,U+2757,U+2795-2797,U+27B0,U+27BF,U+2B1B-2B1C,U+2B50,U+2B55,U+FE0E-FE0F,U+1F004,U+1F0CF,U+1F300-1F320,U+1F32D-1F335,U+1F337-1F37C,U+1F37E-1F393,U+1F3A0-1F3CA,U+1F3CF-1F3D3,U+1F3E0-1F3F0,U+1F3F4,U+1F3F8-1F43E,U+1F440,U+1F442-1F4FC,U+1F4FF-1F53D,U+1F54B-1F54E,U+1F550-1F567,U+1F57A,U+1F595-1F596,U+1F5A4,U+1F5FB-1F64F,U+1F680-1F6C5,U+1F6CC,U+1F6D0-1F6D2,U+1F6D5-1F6D8,U+1F6DC-1F6DF,U+1F6EB-1F6EC,U+1F6F4-1F6FC,U+1F7E0-1F7EB,U+1F7F0,U+1F90C-1F93A,U+1F93C-1F945,U+1F947-1F9FF,U+1FA70-1FA7C,U+1FA80-1FA8A,U+1FA8E-1FAC6,U+1FAC8,U+1FACD-1FADC,U+1FADF-1FAEA,U+1FAEF-1FAF8,U+E0020-E007F;
}

/* One text family throughout the portal; script-specific families match the preview.
   Google Fonts serves unicode subsets on demand, including the language picker. */
:root {
  --portal-font-family: "Plus Jakarta Sans", "Portal Native Emoji", "Noto Sans", "Noto Sans Devanagari", "Noto Sans SC", "Noto Sans JP", Arial, sans-serif;
}

html:lang(ru), html:lang(el) {
  --portal-font-family: "Noto Sans", "Portal Native Emoji", "Plus Jakarta Sans", Arial, sans-serif;
}
html:lang(hi) {
  --portal-font-family: "Noto Sans Devanagari", "Portal Native Emoji", "Noto Sans", sans-serif;
}
html:lang(ja) {
  --portal-font-family: "Noto Sans JP", "Portal Native Emoji", "Noto Sans", sans-serif;
}
html:lang(zh) {
  --portal-font-family: "Noto Sans SC", "Portal Native Emoji", "Noto Sans", sans-serif;
}

body, button, input, select, textarea,
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.form-control, .select2-container, .select2-dropdown, .select2-search input,
.tooltip, .popover, .leaflet-container, .leaflet-popup-content,
font[face], [style*="font-family"]:not(.fa):not(.glyphicon) {
  font-family: var(--portal-font-family) !important;
}

/* Keep the dots visible in fi/ffi without disabling required script shaping.
   Explicit longhand also survives later font shorthands on controls and labels. */
html, body, body * {
  font-variant-ligatures: no-common-ligatures !important;
}

/* Do not replace icon fonts: their private-use glyphs are not text. */
.fa, [style*="font-family:FontAwesome"], [style*="font-family: FontAwesome"] {
  font-family: FontAwesome !important;
}
.glyphicon { font-family: "Glyphicons Halflings" !important; }

/* Keep words whole at every breakpoint, including CMS-authored text. */
html, body, body * {
  -webkit-hyphens: none !important;
  -ms-hyphens: none !important;
  hyphens: none !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* The picker can contain several writing systems on the same page. */
#FooterLanguages {
  font-family: "Plus Jakarta Sans", "Noto Sans", "Noto Sans Devanagari", "Noto Sans SC", "Noto Sans JP", sans-serif !important;
}
#FooterLanguages option[value="ru"], #FooterLanguages option[value="el"],
#FooterLanguages option[value^="/ru/"], #FooterLanguages option[value^="/el/"] { font-family: "Noto Sans", sans-serif !important; }
#FooterLanguages option[value="hi"], #FooterLanguages option[value^="/hi/"] { font-family: "Noto Sans Devanagari", sans-serif !important; }
#FooterLanguages option[value="ja"], #FooterLanguages option[value^="/ja/"] { font-family: "Noto Sans JP", sans-serif !important; }
#FooterLanguages option[value="zh-cn"], #FooterLanguages option[value^="/zh-cn/"] { font-family: "Noto Sans SC", sans-serif !important; }

/* Translated controls grow with their labels instead of clipping a second line. */
.btn, button, .btn-tag, .btn-with-badge {
  max-width: 100%;
  white-space: normal;
}
.btn-modern {
  height: auto;
  min-height: 48px;
  padding-top: 12px;
  padding-bottom: 12px;
  line-height: 1.5;
}
.evento-box h3 { height: auto; min-height: 50px; line-height: 1.45; }
#comeFunzionaContainer .how-it-works-header { flex-wrap: wrap; }
#comeFunzionaContainer #comeFunzionaClose { max-width: 100%; flex-shrink: 0; }

/* On narrow cards, move the arrow below the address before compressing its words. */
.widget.box-item.customer-card .customer-card-location-row { flex-wrap: wrap; }
.widget.box-item.customer-card .customer-card-location-wrap { flex-basis: 140px; max-width: 100%; }
.widget.box-item.customer-card .customer-card-arrow { margin-inline-start: auto; }

/* Select2 selections and results must show whole labels, in all scripts. */
body .select2-container .select2-selection--single,
body .select2-container .select2-selection__rendered {
  height: auto !important;
  min-height: var(--home-field-height, var(--portal-field-height, var(--offers-field-height, 50px)));
  white-space: normal !important;
  text-overflow: clip;
}
body .select2-container .select2-selection__rendered {
  display: flex;
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
  line-height: 1.5 !important;
}
body .select2-container .selected,
body .select2-container .placeholder,
body .select2-results__option > div {
  height: auto !important;
  min-height: 38px;
  min-width: 0;
  max-width: 100%;
}
body .select2-container .selected > strong,
body .select2-container .placeholder > strong,
body .select2-container .selected > small,
body .select2-results__option strong,
body .select2-results__option small {
  display: block !important;
  height: auto !important;
  min-height: 0;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.5 !important;
}
body .select2-container .placeholder > strong { padding-block: 6px; }
body .select2-container .select2-selection__arrow { top: 50% !important; transform: translateY(-50%); }

/* Region and guide headings share the photo but remain in normal document flow. */
#page .main-header:has(> .main-header-cover) {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  height: auto !important;
  min-height: 360px;
  padding: 32px 20px !important;
}
#page .main-header.guida:has(> .main-header-cover) { min-height: 160px; }
#page .main-header > .main-header-cover { inset: 0; width: 100%; height: 100%; }
#page .main-header:has(> .main-header-cover) > h1,
#page .main-header:has(> .main-header-cover) > h3 {
  position: relative !important;
  inset: auto !important;
  transform: none;
  width: 100%;
  max-width: 1100px;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
}
#page .main-header:has(> .main-header-cover) > h1 { font-size: clamp(26px, 3.2vw, 44px) !important; }
#page .main-header:has(> .main-header-cover) > h3 { font-size: clamp(16px, 2vw, 24px) !important; }

/* Give complete compound words a wider heading column on desktop. */
@media (min-width: 1200px) {
  #categoriesPlaceHolder > .row > .category-band { grid-template-columns: minmax(260px, 30%) minmax(0, 1fr); }
}

/* Devanagari marks need vertical room; CJK text needs natural character spacing. */
html:lang(hi) h1, html:lang(hi) h2, html:lang(hi) h3,
html:lang(hi) .section-title, html:lang(hi) .home-promo-copy summary,
html:lang(hi) #page .main-header:has(> .main-header-cover) > h1,
html:lang(hi) #page .main-header:has(> .main-header-cover) > h3 {
  line-height: 1.55 !important;
  letter-spacing: normal !important;
}
html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3,
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3,
html:lang(ja) #page .main-header:has(> .main-header-cover) > h1,
html:lang(ja) #page .main-header:has(> .main-header-cover) > h3,
html:lang(zh) #page .main-header:has(> .main-header-cover) > h1,
html:lang(zh) #page .main-header:has(> .main-header-cover) > h3 {
  line-height: 1.5 !important;
  letter-spacing: normal !important;
}
html:lang(hi) p, html:lang(hi) li,
html:lang(ja) p, html:lang(zh) p { line-height: 1.8; }

@media (max-width: 767px) {
  .form-control, input[type="text"], input[type="email"], input[type="password"], textarea, select { font-size: 16px; }
  #page h1.section-title, #page h2.portal-section-heading { font-size: clamp(24px, 5.6vw, 32px); line-height: 1.4; }
}
@media (max-width: 992px) {
  #page .main-header.guida:has(> .main-header-cover) { min-height: 360px; }
}

/* Keep normal words intact; exceptionally long offer titles may wrap within
   the available width without shrinking text or clipping translated compounds. */
.widget.offerta h1,
.widget.offerta h1 *,
.offer-page h1.offer-page-title,
.offer-page h1.offer-page-title * {
  overflow-wrap: anywhere !important;
}

.widget.offerta h1 span.portal-whole-word,
.offer-page h1.offer-page-title span.portal-whole-word {
  display: inline-block !important;
  max-width: 100% !important;
  white-space: normal !important;
}

#page .business-hero .business-preview-photo { object-fit: contain; }
#page .about-page-shell .about-job-image {
    background-size: contain;
    background-repeat: no-repeat;
}

/* The desktop profile overlaps the photo frame by 28px, or 20px in its compact state. */
@media (min-width: 1024px) {
    :where(html:not(.business-screen-short, .business-screen-backdrop)) #page .business-hero .business-preview-photo {
        box-sizing: border-box;
        padding-bottom: 28px;
    }
    :where(html.business-screen-medium:not(.business-screen-backdrop)) #page .business-hero .business-preview-photo {
        padding-bottom: 20px;
    }
}

/* Solid portal colours behind contain-fit photos. Native solid frames show through transparent images. */
#page #ContentPlaceHolderMain_mainHeader.main-header[style*="url(" i] { background-color: #003c70; }
#page .customer-intro-media #ContentPlaceHolderMain_mainHeader.main-header { background-color: #dce8ee; }
#page .about-page-shell .about-job-image,
#page .business-hero .business-preview-photo { background-color: #fff; }
/* The text overlays darken the photograph while preserving the identical solid colour in its margins. */
#page #ContentPlaceHolderMain_mainHeader.main-header[style*="url(" i] > .main-header-cover {
    background-image: linear-gradient(to bottom, rgba(0,60,112,0), rgba(0,60,112,.9));
    mix-blend-mode: darken;
}
#page #ContentPlaceHolderMain_PanelSingle #ContentPlaceHolderMain_mainHeader.main-header { background-color: #000c18; }
#page #ContentPlaceHolderMain_PanelSingle #ContentPlaceHolderMain_mainHeader.main-header > .main-header-cover {
    background-image: linear-gradient(180deg, rgba(0,12,24,.60), rgba(0,12,24,.58) 45%, rgba(0,12,24,.78));
}
html.business-screen-backdrop #page .business-hero .business-preview-photo { background-color: #032033; }
html.business-screen-backdrop #page .business-hero-visual::after { mix-blend-mode: darken; }

/* Inherit text styles without picking up legacy icon rules for nested spans. */
html body span.portal-whole-word {
    all: unset !important;
    white-space: nowrap !important;
}

html body span.portal-whole-word::before,
html body span.portal-whole-word::after {
    content: none !important;
}

/* A generated word joiner bridges emphasis boundaries without changing text. */
html body span.portal-word-joiner,
html body span.portal-word-joiner::before,
html body span.portal-word-joiner::after {
    all: unset !important;
}
html body span.portal-word-joiner::before,
html body span.portal-word-joiner::after {
    content: '\2060' !important;
}

/* Breadcrumbs wrap between words, including long translated page names. */
html body ol.breadcrumb > li,
html body ol.breadcrumb > li > a,
html body ol.breadcrumb > li > a > span {
    overflow-wrap: normal !important;
    word-wrap: normal !important;
}

/* Keep the complete tax-number label at its normal size on narrow phones. */
@media (max-width: 359px) {
    .attivita-page-intro ~ .contact-wrapper .corporate-form-card #PanelForm {
        padding-left: 8px;
        padding-right: 8px;
    }
}

