:root {
  --fs-global-header-h: 80px;
  --fs-global-header-bg: #000d1a;
  --fs-global-header-cyan: #38bdf8;
  --fs-global-header-border: rgba(255, 255, 255, 0.08);
}

.fs-global-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--fs-global-header-h);
  min-height: var(--fs-global-header-h);
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fs-global-header-bg);
  border-bottom: 1px solid var(--fs-global-header-border);
}

.fs-global-site-header *,
.fs-global-site-header *::before,
.fs-global-site-header *::after {
  box-sizing: border-box;
}

.fs-global-header-inner {
  width: min(1380px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.fs-global-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.fs-global-logo-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.fs-global-logo-mark svg {
  display: block;
  width: 44px;
  height: 44px;
}

.fs-global-logo-farseep {
  color: #fff;
}

.fs-global-logo-front {
  color: var(--fs-global-header-cyan);
}

.fs-global-main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: clamp(18px, 3.2vw, 44px);
  flex-wrap: wrap;
}

.fs-global-main-nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 28px 0 24px;
  white-space: nowrap;
}

.fs-global-main-nav a:hover,
.fs-global-main-nav a.active {
  color: #fff;
}

/* Touch browsers paint a filled rectangle over the whole padded box of whatever is
   tapped, which reads as a stray square on the dark header. The pressed states
   below replace that feedback. */
.fs-global-site-header a,
.fs-global-site-header button {
  -webkit-tap-highlight-color: transparent;
}

.fs-global-main-nav a:active {
  color: #fff;
  opacity: 0.6;
}

.fs-global-site-header button:active,
.fs-global-logo:active {
  opacity: 0.75;
}

.fs-global-main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--fs-global-header-cyan);
}

.fs-global-public-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.fs-global-public-user {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-global-sign-in {
  height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
}

.fs-global-sign-in:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(255, 255, 255, 0.07);
}

.fs-global-sign-in svg {
  flex-shrink: 0;
}

.fs-global-lang-switch {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 250;
  pointer-events: auto;
}

.fs-global-flag {
  display: block;
  width: 24px;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.fs-global-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.fs-global-lang-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font-family: inherit;
}

.fs-global-lang-trigger:hover {
  color: #fff;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

.fs-global-lang-caret {
  transition: transform 0.15s ease;
}

.fs-global-lang-trigger[aria-expanded="true"] .fs-global-lang-caret {
  transform: rotate(180deg);
}

.fs-global-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #04182b;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 300;
}

.fs-global-lang-menu[hidden] {
  display: none;
}

.fs-global-lang-option {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.fs-global-lang-option:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.fs-global-lang-name {
  flex: 1;
  white-space: nowrap;
}

.fs-global-lang-code {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
}

.fs-global-lang-option.is-active {
  background: rgba(56, 189, 248, 0.16);
  color: #fff;
}

.fs-global-lang-option.is-active .fs-global-lang-code {
  color: var(--fs-global-header-cyan);
}

/* Portal: stack second sticky bar under global header */
body.has-fs-global-header .fs-header .fs-brand {
  display: none;
}

body.has-fs-global-header .fs-header {
  top: var(--fs-global-header-h);
  z-index: 40;
}

body.has-fs-global-header.fs-company-portal .fs-sea-banner {
  top: var(--fs-global-header-h);
}

.fs-global-portal-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 1;
  min-width: 0;
  justify-content: flex-end;
}

.fs-global-portal-slot .fs-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.fs-global-portal-slot .fs-notification-panel {
  z-index: 400;
}

@media (max-width: 900px) {
  .fs-global-site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: auto;
    min-height: 0;
    padding: 14px 0;
    padding-top: max(14px, env(safe-area-inset-top, 0px));
  }

  .fs-global-lang-trigger,
  .fs-global-lang-option {
    touch-action: manipulation;
  }

  .fs-global-header-inner {
    flex-wrap: wrap;
    width: min(100% - 28px, 1380px);
    gap: 10px;
  }

  .fs-global-main-nav {
    order: 3;
    /* The base rule's `flex: 1` sets flex-basis 0, which beats width for wrapping —
       the nav needs a real 100% basis to claim its own row. */
    flex: 1 1 100%;
    width: 100%;
    gap: 16px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    padding-right: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .fs-global-main-nav::-webkit-scrollbar {
    display: none;
  }

  .fs-global-main-nav a {
    padding: 10px 0 14px;
  }

  .fs-global-main-nav a.active::after {
    bottom: 4px;
  }

  .fs-global-lang-switch {
    margin-left: auto;
  }

  body.has-fs-global-header .fs-header {
    top: 0;
  }

  /* Share the top row with the logo and language flag; wraps on its own only if
     the actions genuinely cannot fit. */
  .fs-global-portal-slot {
    width: auto;
    /* No shrinking: on a narrow phone it drops to its own row instead of
       squeezing the buttons past the screen edge. */
    flex: 0 0 auto;
    min-width: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    order: 2;
  }

  body.has-fs-global-header.fs-company-portal .fs-sea-banner {
    top: 0;
  }
}

@media (max-width: 480px) {
  .fs-global-header-inner {
    width: min(100% - 20px, 1380px);
    gap: 12px;
  }

  .fs-global-logo {
    font-size: 1.05rem;
    gap: 8px;
  }

  .fs-global-logo-mark,
  .fs-global-logo-mark svg {
    width: 36px;
    height: 36px;
  }

  .fs-global-sign-in {
    height: 42px;
    padding: 0 14px;
    font-size: 13px;
    gap: 6px;
  }

  .fs-global-lang-trigger {
    height: 36px;
    padding: 0 7px;
    gap: 4px;
  }

  .fs-global-flag {
    width: 22px;
    height: 15px;
  }

  .fs-global-main-nav a {
    font-size: 14px;
  }

  /* Its width is what pushes the actions onto a second row on a narrow phone.
     The avatar is already hidden here, and the name still shows in the page
     greeting and the drawer. */
  body.has-fs-global-header .fs-global-portal-slot .fs-dash-header-user {
    display: none;
  }
}

/* Seaman portal: compact header actions on phones */
@media (max-width: 640px) {
  body.has-fs-global-header .fs-global-portal-slot .fs-header-actions {
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  body.has-fs-global-header .fs-global-portal-slot .fs-sea-header-iconbtn,
  body.has-fs-global-header .fs-global-portal-slot .fs-sea-user-chevron {
    display: none;
  }

  body.has-fs-global-header .fs-global-portal-slot .fs-dash-header-user {
    min-height: 0;
    padding: 2px 6px 2px 2px;
    border: none;
    background: transparent;
    max-width: min(42vw, 140px);
  }

  body.has-fs-global-header .fs-global-portal-slot .fs-dash-header-user-text {
    display: flex;
    min-width: 0;
  }

  body.has-fs-global-header .fs-global-portal-slot .fs-dash-header-rank {
    display: none;
  }

  body.has-fs-global-header .fs-global-portal-slot .fs-dash-header-name {
    font-size: 0.78rem;
    max-width: 100%;
  }

  body.has-fs-global-header .fs-global-portal-slot .fs-user-avatar-wrap {
    display: none;
  }

  body.has-fs-global-header .fs-global-portal-slot .fs-notification-bell {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
  }

  body.has-fs-global-header .fs-global-portal-slot #authBtn {
    padding: 8px 10px;
    font-size: 0.72rem;
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

