/* Keep the first-layer notice clear of the desktop price index. */
@media (min-width: 900px) {
  html {
    --thegu-desktop-consent-top: 140px;
    --thegu-desktop-consent-right: max(16px, calc((100vw - 1216px) / 2));
    --thegu-desktop-consent-width: min(416px, calc(100vw - 620px));
  }

  /* Keep long CJK headings out of the notice column in every consent state. */
  .b2-design :is(:lang(zh-Hant), :lang(zh-Hans), :lang(ko), :lang(ja)).hero__h1 {
    max-width: calc(100vw - var(--thegu-desktop-consent-right) - var(--thegu-desktop-consent-width)
      - max(0px, (100vw - 1280px) / 2) - var(--gutter) - 16px);
  }

  /* Position the first layer before the existing presentation script rearranges its controls. */
  html:not(:has(#drawer.is-open)) #thegu-meta-consent.thegu-meta-live:not([hidden]):has(.thegu-meta-first:not([hidden])) {
    inset: var(--thegu-desktop-consent-top) var(--thegu-desktop-consent-right) auto auto;
    width: var(--thegu-desktop-consent-width);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px 12px;
    border: 1px solid #877856;
    transform: none;
  }

  html:not(:has(#drawer.is-open)) #thegu-meta-consent.thegu-meta-live .thegu-meta-first {
    flex-basis: auto;
  }

  html[data-review-layout]:not(:has(#drawer.is-open)):has(#thegu-meta-consent:not([hidden]) .thegu-meta-first:not([hidden])) {
    scroll-padding-top: calc(var(--thegu-desktop-consent-top) + var(--review-panel-h, 0px) + 12px);
    scroll-padding-bottom: calc(var(--review-bar-h, 0px) + 12px);
  }

  html[data-review-layout]:not(:has(#drawer.is-open)):has(#thegu-meta-consent:not([hidden]) .thegu-meta-first:not([hidden])) body {
    padding-bottom: 0;
  }

  html[data-review-layout]:not(:has(#drawer.is-open)):has(#thegu-meta-consent:not([hidden]) .thegu-meta-first:not([hidden])) .bar {
    bottom: 0;
  }
}
