/* Final public polish layer: layout stability, mobile clarity, and readable type. */
:root {
  --yop-final-focus: 0 0 0 4px rgba(37, 99, 255, .18);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.yop-display,
.enterprise-hero h1,
.enterprise-section-head h1,
.enterprise-section-head h2,
.portal-home-copy h1,
.portal-hero-card h1,
.jobs-hero h1,
.insurance-hero h1,
.check-hero h1,
.profis-section-head h2 {
  letter-spacing: 0 !important;
  text-wrap: balance;
}

p,
li,
.yop-card,
.enterprise-card,
.portal-card {
  overflow-wrap: anywhere;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--yop-final-focus) !important;
}

.yop-global-nav {
  min-height: 72px;
}

.yop-global-links a,
.yop-account-links a,
.yop-mobile-menu a {
  line-height: 1.12;
  text-align: center;
  white-space: nowrap;
}

.yop-nav-toggle {
  min-height: 44px;
  font-weight: 750;
  color: var(--yop-text);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.yop-mobile-account,
.yop-mobile-categories {
  display: contents;
}

.yop-mobile-menu a.is-primary-soft {
  background: #eef4ff !important;
  color: #1746c7 !important;
  border-color: rgba(37, 99, 255, .22);
}

.yop-search-box input,
.enterprise-search input,
.yop-search-box select,
.enterprise-search select,
.yop-search-box button,
.enterprise-search button {
  min-height: 52px;
}

.yop-cookie-banner {
  z-index: calc(var(--yop-z-nav) + 30);
}

@media (max-width: 980px) {
  body.yop-nav-open {
    overflow: hidden;
  }

  .yop-global-nav {
    grid-template-columns: minmax(0, auto) auto;
    gap: .75rem;
    padding: .72rem max(1rem, env(safe-area-inset-right)) .72rem max(1rem, env(safe-area-inset-left));
  }

  .yop-global-logo img {
    width: 88px;
  }

  .yop-global-nav.is-open {
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
  }

  .yop-global-nav.is-open .yop-mobile-menu {
    display: grid;
  }

  .yop-mobile-menu {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    max-height: min(72vh, 640px);
    overflow-y: auto;
    padding: .8rem 0 .35rem;
    overscroll-behavior: contain;
  }

  .yop-mobile-account {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    padding: .65rem;
    border: 1px solid rgba(37, 99, 255, .16);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 255, .08), rgba(22, 163, 74, .08));
  }

  .yop-mobile-categories {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
  }

  .yop-mobile-menu a {
    min-height: 46px;
    padding: .72rem .68rem;
    border-radius: 14px;
    white-space: normal;
  }

  .yop-mobile-menu a.is-active {
    box-shadow: 0 12px 26px rgba(37, 99, 255, .22);
  }
}

@media (max-width: 640px) {
  .yop-page-main {
    overflow-x: hidden;
  }

  .yop-search-box,
  .enterprise-search {
    border-radius: 18px;
    padding: .65rem;
  }

  .yop-category-grid,
  .enterprise-category-grid {
    grid-template-columns: 1fr;
  }

  .yop-cookie-banner {
    inset-inline: .75rem;
    bottom: calc(.75rem + env(safe-area-inset-bottom));
    border-radius: 18px;
  }
}
