/*
 * Heartlines Design & Inhalte 1.3.5 — one mobile text-action size.
 * The legacy conversation adapter uses flex-basis:220px. In a column that
 * becomes a HEIGHT, so width:100% alone cannot fix the oversized cancel action.
 * Reset both axes and the flex basis together, without changing event handlers.
 * Icon controls, navigation tabs and illustrated hero tiles retain their roles.
 */
@media (max-width: 1024px) {
  html:root body.hldesign-ready.hldesign-safe:not(.wp-admin) #content :is(
    .btn:not(.hl18-hero-action):not(.hlfp-four-actions .btn),
    .hla-button, .hla-presence-copy,
    .hlaudio-button, .hlaudio-mini-button,
    .hlchat-button,
    .hlvideo-button, .hlvideo-mini-button,
    .hle-button, .hlcb-button, .hlp-button, .hlw-button,
    .hlcontact-submit, .hlsec-link-button,
    .hl15-blog-btn, .hli5-apply__cta,
    .hlb1-heart-lines-toggle, .hlrf-all-reviews-toggle,
    .wp-block-button__link,
    .woocommerce-button, .woocommerce .button,
    .wc-block-components-button:not(.wc-block-components-quantity-selector__button)
  ) {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    inline-size: 100% !important;
    min-inline-size: 0 !important;
    max-inline-size: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    block-size: 48px !important;
    min-block-size: 48px !important;
    max-block-size: 48px !important;
    flex: 0 0 auto !important;
    aspect-ratio: auto !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    margin-inline: 0 !important;
    /* Two 20px lines also fit within the same 48px outer height. */
    padding: 3px 14px !important;
    border-width: 1px !important;
    border-style: solid !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    letter-spacing: normal !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    text-decoration: none !important;
  }

  /* Do not expose state-dependent actions hidden by the conversation scripts. */
  html:root body.hldesign-ready.hldesign-safe:not(.wp-admin) #content :is(
    .btn:not(.hl18-hero-action):not(.hlfp-four-actions .btn), .hla-button, .hla-presence-copy,
    .hlaudio-button, .hlaudio-mini-button, .hlchat-button,
    .hlvideo-button, .hlvideo-mini-button, .hle-button, .hlcb-button,
    .hlp-button, .hlw-button, .hlcontact-submit, .hlsec-link-button,
    .hl15-blog-btn, .hli5-apply__cta, .hlb1-heart-lines-toggle,
    .hlrf-all-reviews-toggle, .wp-block-button__link,
    .woocommerce-button, .woocommerce .button,
    .wc-block-components-button:not(.wc-block-components-quantity-selector__button)
  ):not([hidden]):not([style*="display: none"]):not([style*="display:none"]) {
    display: inline-flex !important;
  }

  /* Stack action groups and their form wrappers before expanding their buttons. */
  html:root body.hldesign-ready.hldesign-safe:not(.wp-admin) #content :is(
    .hlaudio-actions, .hlaudio-room-actions, .hlaudio-call-mode__actions,
    .hlaudio-volume-check, .hlvideo-audio-check,
    .hlchat-inline-actions, .hlvideo-actions, .hlvideo-room-actions,
    .hle-actions, .hlcb-actions, .hla-account-head-actions,
    .hla-security-actions, .hla-profile-savebar, .hla-pagination__actions,
    .hl16-shared-page-hero__actions, .hlau4-final__actions, .mag-head,
    .hl15-blog-masthead__actions, .hlwd-form-actions,
    .hlchat-review-cta, .hlaudio-review-cta, .hlvideo-review-cta
  ) {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    min-width: 0 !important;
  }
  html:root body.hldesign-ready.hldesign-safe:not(.wp-admin) #content :is(
    .hlaudio-actions, .hlaudio-room-actions, .hlchat-inline-actions,
    .hlvideo-actions, .hlvideo-room-actions, .hle-actions, .hlcb-actions,
    .hla-account-head-actions, .hla-security-actions
  ) > form {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    margin-inline: 0 !important;
  }

  /* A form action must not stay in a narrow inline wrapper. */
  html:root body.hldesign-ready.hldesign-safe:not(.wp-admin) #content :is(
    .hlvideo-cancel-request-form, .hlaudio-quick-request-form,
    .hlp-select-form, .woocommerce-form-login
  ) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Keep the send action full width while preserving the emoji icon toolbar. */
  html:root body.hldesign-ready.hldesign-safe:not(.wp-admin) #content :is(
    .hlchat-compose-toolbar, .hlchat-room-footer,
    .hlchat-list-row, .hlvideo-list, .hlaudio-list
  ) {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  html:root body.hldesign-ready.hldesign-safe:not(.wp-admin) #content .hlchat-compose-right {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* A second horizontal inset made follow-up and withdrawal actions narrower
     than the initial request/start action. Use the conversation card's common
     content edges for every state, including the review and re-entry panels. */
  html:root body.hldesign-ready.hldesign-safe:not(.wp-admin) #content :is(
    .hlaudio-review-cta, .hlchat-review-cta, .hlvideo-review-cta,
    .hlaudio-reentry, .hlchat-reentry, .hlvideo-reentry,
    .hlchat-wait, .hlchat-start-card,
    .hlaudio-volume-check, .hlvideo-audio-check
  ) {
    padding-inline: 0 !important;
    border-inline-width: 0 !important;
  }
}
