.gateway-hero .tool-hero-grid {
  align-items: start;
}

.gateway-hero .hero-lede {
  max-width: 700px;
}

.gateway-hero .proof-terminal {
  margin: 0;
}

.gateway-hero .proof-terminal dt,
.gateway-hero .proof-terminal dd {
  margin: 0;
}

.gateway-hero .proof-terminal dt {
  color: color-mix(in srgb, var(--ground) 76%, transparent);
  font: 500 .68rem var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.gateway-hero .proof-terminal dd {
  min-width: 0;
  overflow-wrap: anywhere;
  font: 560 .78rem var(--mono);
}

.guide-mobile-nav {
  display: none;
}

.gateway-scroll-cue {
  display: block;
  margin: -13px 0 10px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

#method,
#decision-matrix,
#choose-by-fit {
  scroll-margin-top: 132px;
}

.public-bar strong {
  color: var(--ground);
}

.site-nav .btn-primary:hover,
.gateway-hero .btn-primary:hover,
.final-cta .btn-primary:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ground);
}

.gateway-method {
  background: var(--surface);
}

.gateway-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.gateway-method-grid > div {
  min-height: 150px;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.gateway-method-grid > div:nth-child(3n) {
  border-right: 0;
}

.gateway-method-grid > div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.gateway-method-grid span,
.gateway-method-grid strong,
.gateway-method-grid small {
  display: block;
}

.gateway-method-grid span {
  color: var(--signal-dark);
  font: 650 .7rem var(--mono);
  letter-spacing: .06em;
}

.gateway-method-grid strong {
  margin-top: 15px;
  font-size: .9rem;
}

.gateway-method-grid small {
  margin-top: 7px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.55;
}

.gateway-matrix-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overscroll-behavior-inline: contain;
}

.gateway-matrix {
  width: 100%;
  min-width: 1360px;
  border-collapse: separate;
  border-spacing: 0;
}

.gateway-matrix caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gateway-matrix th,
.gateway-matrix td {
  padding: 17px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.gateway-matrix th:last-child,
.gateway-matrix td:last-child {
  border-right: 0;
}

.gateway-matrix tbody tr:last-child th,
.gateway-matrix tbody tr:last-child td {
  border-bottom: 0;
}

.gateway-matrix thead th {
  background: var(--field);
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.gateway-matrix thead th:first-child,
.gateway-matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 188px;
  background: var(--surface);
  box-shadow: 1px 0 var(--line);
}

.gateway-matrix thead th:first-child {
  z-index: 3;
  background: var(--field);
}

.gateway-matrix tbody th strong,
.gateway-matrix tbody th small,
.gateway-matrix td strong,
.gateway-matrix td small {
  display: block;
}

.gateway-matrix tbody th strong {
  font-size: .94rem;
}

.gateway-matrix tbody th small {
  margin-top: 6px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.5;
}

.gateway-matrix td {
  min-width: 200px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.58;
}

.gateway-matrix td strong {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: .78rem;
}

.fit-label {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--signal-soft);
  color: var(--signal-dark);
  font-size: .66rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.fit-label.self-hosted {
  background: var(--amber-soft);
  color: var(--amber);
}

.fit-label.direct {
  background: var(--green-soft);
  color: var(--green);
}

.gateway-table-note {
  max-width: 920px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.65;
}

.gateway-profiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gateway-profile {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.gateway-profile > span {
  color: var(--signal-dark);
  font: 650 .7rem var(--mono);
}

.gateway-profile h3 {
  margin: 0;
  font-size: 1.12rem;
}

.gateway-profile p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.65;
}

.gateway-profile ul {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.65;
}

.gateway-profile a {
  font-size: .78rem;
  font-weight: 650;
}

.gateway-profile.infer-profile {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--signal) 40%, var(--line));
  background: color-mix(in srgb, var(--signal-soft) 30%, var(--surface));
}

.gateway-boundary {
  background: var(--ink);
  color: var(--ground);
}

.gateway-boundary .orientation,
.gateway-boundary .verification-grid h2,
.gateway-boundary .verification-list strong {
  color: var(--ground);
}

.gateway-boundary .verification-grid > div > p:last-child,
.gateway-boundary .verification-list span {
  color: color-mix(in srgb, var(--ground) 78%, transparent);
}

.gateway-boundary .verification-list,
.gateway-boundary .verification-list > div {
  border-color: color-mix(in srgb, var(--ground) 24%, transparent);
}

.source-strip-inner {
  display: grid;
  grid-template-columns: minmax(230px, .6fr) minmax(0, 1.4fr);
  gap: 32px;
  align-items: start;
}

.source-strip-inner > .source-intro,
.source-strip-inner > .source-groups {
  width: auto;
  margin-right: 0;
}

.source-intro span {
  max-width: 410px;
  margin-top: 6px;
  color: color-mix(in srgb, var(--ground) 76%, transparent);
  font-size: .72rem;
  line-height: 1.55;
}

.source-groups {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.source-groups > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.source-groups > div > strong {
  margin-bottom: 3px;
  color: var(--ground);
  font-size: .74rem;
}

.source-groups a {
  color: color-mix(in srgb, var(--ground) 82%, transparent);
  font-size: .72rem;
  font-weight: 560;
}

@media (max-width: 1080px) {
  .guide-mobile-nav {
    position: sticky;
    top: 70px;
    z-index: 39;
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 5vw, 34px);
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--ground) 94%, transparent);
    backdrop-filter: blur(18px);
  }

  .guide-mobile-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
  }

  .gateway-method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gateway-method-grid > div,
  .gateway-method-grid > div:nth-child(3n) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .gateway-method-grid > div:nth-child(2n) {
    border-right: 0;
  }

  .gateway-method-grid > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .gateway-profiles,
  .source-strip-inner {
    grid-template-columns: 1fr;
  }

  .gateway-profile.infer-profile {
    grid-column: auto;
  }

  .source-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .guide-mobile-nav {
    top: 62px;
    justify-content: space-between;
    gap: 8px;
  }

  .gateway-method-grid {
    grid-template-columns: 1fr;
  }

  .gateway-method-grid > div,
  .gateway-method-grid > div:nth-child(2n),
  .gateway-method-grid > div:nth-child(3n) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .gateway-method-grid > div:last-child {
    border-bottom: 0;
  }

  .gateway-profile {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px;
  }

  .gateway-matrix-scroll {
    border-inline: 0;
    border-radius: 0;
  }

  .gateway-matrix {
    min-width: 1220px;
  }

  .gateway-matrix th,
  .gateway-matrix td {
    padding: 14px;
  }

  .gateway-matrix thead th:first-child,
  .gateway-matrix tbody th {
    min-width: 158px;
  }

  .source-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .guide-mobile-nav a {
    font-size: .72rem;
  }

  .source-groups {
    grid-template-columns: 1fr 1fr;
    gap: 18px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .flow7-provenance img {
    animation: none;
  }
}
