.account-agreement-link,
.account-privacy-link {
  color: inherit;
  text-decoration: none;
}

#main > .agreement-page {
  justify-self: center;
  width: min(100%, 48rem);
  padding: clamp(16px, 4vw, 38px);
}

:root[data-device-segments="horizontal"] body:is([data-page="terms"], [data-page="privacy"], [data-page="legal"], [data-page="order-agreement"]) #main {
  padding-inline: 0;
}

:root[data-device-segments="horizontal"] #main > .agreement-page {
  justify-self: start;
}

.agreement-reader {
  min-width: 0;
  overflow-wrap: anywhere;
}

.agreement-sheet[open] {
  display: flex;
  flex-direction: column;
}

.agreement-sheet > .section-title {
  flex: none;
}

.agreement-sheet > .agreement-reader {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.agreement-languages,
.login-agreement-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.agreement-languages {
  gap: 8px;
}

.agreement-language {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--qx-hairline);
  border-radius: 999px;
  background: var(--qx-fill-strong);
  color: var(--qx-ink);
  font-size: .875rem;
}

.agreement-language[aria-pressed="true"] {
  border-color: currentColor;
  background: var(--qx-blush-soft);
  color: var(--qx-coral-ink);
  font-weight: 700;
}

.agreement-status {
  color: var(--qx-ink-2);
  font-size: .875rem;
}

.agreement-status:empty {
  margin: 0;
}

.agreement-order-facts {
  display: grid;
  gap: 6px;
  margin-block: 14px;
  padding: 12px;
  border: 1px solid var(--qx-hairline);
  border-radius: 12px;
  font-size: .875rem;
}

.agreement-order-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 10px;
}

.agreement-order-facts dt { color: var(--qx-ink-2); }
.agreement-order-facts dd { margin: 0; font-weight: 650; }

.customer-payment-agreement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--qx-ink-2);
  font-size: .8rem;
  line-height: 1.4;
}

.customer-payment-agreement-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--qx-ink-2);
  font-size: .75rem;
}

.customer-payment-agreement.is-unread label {
  cursor: default;
}

.customer-payment-agreement label {
  cursor: pointer;
}

.customer-payment-agreement .payment-agreement-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-inline-start: -10px;
}

.customer-payment-agreement input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  accent-color: var(--qx-coral-ink);
}

.customer-payment-agreement input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.customer-payment-agreement a {
  padding-block: 6px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.customer-order-next-step > .secondary {
  width: 100%;
  min-height: 48px;
}

.agreement-link,
.agreement-reader a {
  color: var(--qx-coral-ink);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.agreement-link {
  padding: 6px 0;
  min-height: 40px;
  border: 0;
  background: transparent;
  text-align: start;
}

/* One line at any width: the type scales with the form, the box with the type. */
.login-agreement { container-type: inline-size; }

.login-agreement-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  color: var(--qx-ink-2);
  font-size: clamp(10.25px, 3.51cqi, 14px);
  font-weight: 600;
  line-height: 1.45;
}

.login-agreement-line label.field {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font: inherit;
  color: inherit;
}

.login-agreement-line label.field > input[type="checkbox"] {
  flex: none;
  font-size: inherit;
  width: 1.15em;
  height: 1.15em;
  margin: 0;
}

.login-agreement-line .agreement-link {
  display: inline;
  min-height: 0;
  margin-inline: .2em;
  padding: 0;
  font: inherit;
  line-height: inherit;
}

.login-agreement-line > span:last-child { margin-left: -.08em; }

.agreement-reader [hidden] {
  display: none;
}

.agreement-body,
.agreement-english-body {
  font-size: .96rem;
  line-height: 1.75;
  color: var(--qx-ink);
}

.agreement-reader :is(article p, article ul) {
  margin-block: 12px;
}

.agreement-reader article ul {
  padding-inline-start: 1.4em;
}

.agreement-reader article li {
  padding-inline-end: .35em;
}

.agreement-reader article li + li {
  margin-block-start: 5px;
}

.agreement-reader article h2 {
  margin-block: 1.7em .45em;
  font-size: 1.2rem;
  line-height: 1.35;
}

.agreement-reader article h3 {
  margin-block: 1.3em .35em;
  font-size: 1rem;
}

.agreement-english {
  margin-block-start: 32px;
  padding-block-start: 20px;
  border-block-start: 1px solid var(--qx-hairline);
  scroll-margin-block-start: 16px;
}

.agreement-original-title {
  font-size: 1.25rem;
  font-weight: 700;
}
