/* The native direction layout caps this specific main at 1440px. */
html[data-site-width412="public"] body:has(.section-masthead[data-section-masthead="market"]) main#main {
  box-sizing: border-box;
  inline-size: 100% !important;
  max-inline-size: none !important;
  max-width: none !important;
  min-inline-size: 0;
  margin-inline: 0 !important;
  padding-inline: var(--site-width412-start) var(--site-width412-end) !important;
}

/* The page frame already leaves room for the right tool rail. */
html[data-site-width412="public"] body:has(.section-masthead[data-section-masthead="market"])
  main#main .market-search .search-line[data-bz-search-bar] {
  box-sizing: border-box;
  width: 100% !important;
  max-inline-size: 100%;
}

/* Match the direction layout's specificity for native public pages. */
html[data-site-width412="public"] body:has(.section-masthead[data-section-masthead]:not([data-section-masthead="market"])) main#main {
  max-inline-size: none !important;
  max-width: none !important;
  padding-inline: var(--site-width412-start) var(--site-width412-end) !important;
}

html[data-site-width412="public"] body main#main > .bz-charity-home[data-charity-discovery] {
  max-inline-size: none !important;
  max-width: none !important;
}

/* Public information and the document index are standalone pages. */
html:not([data-site-width412]) body:has(> main#public238.bz-public-editorial,
  > main.bz-public-editorial > .legal-page > .bz-legal-list) {
  --site-width414-editorial-gutter: clamp(12px, 2vw, 28px);
  --site-width414-editorial-start: max(var(--site-width414-editorial-gutter), env(safe-area-inset-left, 0px));
  --site-width414-editorial-end: max(var(--site-width414-editorial-gutter), env(safe-area-inset-right, 0px));
}

@media (min-width: 761px) and (min-height: 481px) {
  html:not([data-site-width412]) body:has(#bizon-side-tools):has(> main#public238.bz-public-editorial,
    > main.bz-public-editorial > .legal-page > .bz-legal-list) {
    --site-width414-editorial-end: max(76px, calc(64px + env(safe-area-inset-right, 0px)));
  }
}

html:not([data-site-width412]) body > main:is(#public238.bz-public-editorial,
  .bz-public-editorial:has(> .legal-page > .bz-legal-list)) {
  box-sizing: border-box;
  inline-size: 100% !important;
  max-inline-size: none !important;
  max-width: none !important;
  padding-inline: var(--site-width414-editorial-start) var(--site-width414-editorial-end) !important;
}

html:not([data-site-width412]) body.bz-legal-editorial > main.bz-public-editorial > .legal-page:has(> .bz-legal-list) {
  box-sizing: border-box;
  inline-size: 100% !important;
  max-inline-size: none !important;
  max-width: none !important;
}

@media (min-width: 401px) {
  html:not([data-site-width412]) body:has(> main#public238.bz-public-editorial,
    > main.bz-public-editorial > .legal-page > .bz-legal-list) > .bizon-site-header {
    padding-inline: 0 !important;
  }

  html:not([data-site-width412]) body:has(> main#public238.bz-public-editorial,
    > main.bz-public-editorial > .legal-page > .bz-legal-list) > .bizon-site-header > .bizon-brand-row {
    box-sizing: border-box;
    inline-size: 100% !important;
    max-inline-size: none !important;
    max-width: none !important;
    padding-inline: var(--site-width414-editorial-start) var(--site-width414-editorial-end) !important;
  }
}

/* Catalog searches use all the space inside the shared page gutters. */
@media (min-width: 900px) {
  html[data-site-width412="public"] body:has(#bizon-side-tools)
    [data-home365-grid] [data-home-search] > [data-inline-search] > [data-bz-search-bar],
  html[data-site-width412="public"] body:has(#bizon-side-tools)
    main#main > .directory:has(> .section-masthead[data-section-masthead="directory"]) > .dir-search > [data-bz-search-bar],
  html[data-site-width412="public"] body:has(#bizon-side-tools) #root
    :is(main, div):has(> .section-masthead[data-section-masthead]:not([data-section-masthead="market"]))
    > [data-bz-search-bar],
  html[data-site-width412="public"] body:has(#bizon-side-tools) #root
    :is(main, div):has(> .section-masthead[data-section-masthead]:not([data-section-masthead="market"]))
    > [data-inline-search] > [data-bz-search-bar] {
    inline-size: 100% !important;
    width: 100% !important;
  }
}

/* These screens have their own page wrapper inside the cabinet's main column. */
html[data-site-width412="workspace"] #main :is(
  section.orders353[data-orders353], section.b358[data-business-orders358],
  #tickets372, #finances376, [data-security384], [data-account-help388], [data-my-ads390]
) {
  box-sizing: border-box;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: none !important;
  max-width: none !important;
}

/* Shopping creates a new main next to the hidden native main. */
main:is(.s362[data-shopping362], .favorites288[data-favorites288]) {
  box-sizing: border-box;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: none;
  max-width: none;
  margin-inline: 0;
  padding-inline:
    var(--site-width412-start, max(clamp(12px, 2vw, 28px), env(safe-area-inset-left, 0px)))
    var(--site-width412-end, max(clamp(12px, 2vw, 28px), env(safe-area-inset-right, 0px)));
}

@media (min-width: 761px) and (min-height: 481px) {
  html:not([data-site-width412]):has(#bizon-side-tools)
  main:is(.s362[data-shopping362], .favorites288[data-favorites288]) {
    padding-inline-end: max(76px, calc(64px + env(safe-area-inset-right, 0px)));
  }
}

/* The vacancy responses live in the Jobs shell and have their own heading. */
html[data-site-width412="workspace"] [data-job-responses391] {
  --jr391-width: 100%;
}

html[data-site-width412="workspace"] .job-storefront[data-job-responses391] {
  padding-inline: var(--site-width412-start) var(--site-width412-end);
}

html[data-site-width412="workspace"] header.bizon-site-header[data-job-responses391]
> :is(.jr391-native-heading, .jr391-head, .jr391-tabs) {
  inline-size: auto;
  max-inline-size: none;
  margin-inline: var(--site-width412-start) var(--site-width412-end);
}

/* The trip history uses the taxi shell rather than the cabinet main column. */
html[data-site-width412="workspace"] body:has(#root #trips367) {
  --trips375-frame: 100%;
}

html[data-site-width412="workspace"] body:has(#root #trips367) :is(
  .bizon-site-header .section-workspace-heading,
  .bizon-site-header .section-navigation,
  .taxi-main:has(> #trips367)
) {
  padding-inline: var(--site-width412-start) var(--site-width412-end) !important;
}
