/* Second XD desktop audit, S01–S10. Preview-derived sizes, not Inspect values.
 * Keep outer containers, shared/mobile styles and business behavior unchanged.
 * Loaded after app.css; legacy !important widths are overridden only locally. */
@media (min-width: 992px) {
    /* S01 — Add bank / crypto / gateway. */
    #addBankModal .account-form-modal__dialog { width: 630px; }
    #addBankModal .account-form-modal__body { padding: 40px 95px; }
    #addBankModal .add-bank-modal__tabs { gap: 12px; }
    #addBankModal .add-bank-modal__tab {
        flex: 0 1 125px;
        min-width: 0;
        height: 54px;
        padding: 12px 10px;
        white-space: nowrap;
        font-size: 16px;
    }
    #addBankModal .add-bank-modal__tab[data-tab="gateway"] { flex-basis: 166px; }
    #addBankModal .add-bank-modal__account-name {
        background: transparent;
        border-radius: 0;
        padding: 8px 24px;
        font-size: 16px;
    }
    #addBankModal .deposit-field .ff-input-wrap,
    #addBankModal .deposit-field .ff-input,
    #addBankModal .deposit-select-row .ff-custom-select-row,
    #addBankModal .deposit-select-row .deposit-custom-select {
        width: 100% !important;
        max-width: 100% !important;
    }
    #addBankModal .web-input-label,
    #addBankModal .ff-label { font-size: 16px; line-height: 24px; }
    #addBankModal .ff-input,
    #addBankModal .ff-custom-select { min-height: 56px; font-size: 16px; }
    #addBankModal .deposit-submit-btn { width: 100%; height: 56px; font-size: 18px; }

    /* S02 — Avatar, retaining the five + four grid and selection behavior. */
    .account-form-modal#modalUpdateAvatar .account-form-modal__dialog { width: 754px; }
    .account-form-modal#modalUpdateAvatar .account-form-modal__body { padding: 32px 32px 40px; }
    .account-form-modal#modalUpdateAvatar .account-form-modal__title { margin-bottom: 48px; }
    #modalUpdateAvatar .avatar-grid { max-width: 626px; gap: 32px 26px; margin: 0 auto 48px; }
    #modalUpdateAvatar .avatar-grid__item { width: 104px; height: 104px; }
    #modalUpdateAvatar .avatar-confirm-btn.am-btn { width: 252px; height: 56px; }
    #modalUpdateAvatar .account-form-modal__close { width: 32px; height: 32px; }

    /* S03 — Password. Validation and input visibility remain unchanged. */
    #modalChangePassword .account-form-modal__dialog { width: 630px; }
    #modalChangePassword .account-form-modal__body { padding: 32px 69px 40px; }
    #modalChangePassword .account-form-modal__title { font-size: 22px; line-height: 28px; }

    /* S04 — Feedback grows for long translated messages; never fixed-height. */
    .success-feedback-modal__dialog { width: 508px; }
    .success-feedback-modal { min-height: 468px; }
    .success-feedback-modal__body { padding: 60px 41px 0; }
    .success-feedback-modal__gif { width: 140px; height: 140px; margin-bottom: 36px; }
    .success-feedback-modal__title { font-size: 22px; line-height: 28px; margin-bottom: 24px; }
    .success-feedback-modal__message { font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
    .success-feedback-modal__footer { padding: 48px 41px 40px; }
    .success-feedback-modal__button { height: 54px; font-size: 18px; }
    .success-feedback-modal__close { width: 32px; height: 32px; }

    /* S05 — Cooldown. GIF whitespace is preserved, no timer changes. */
    #depositCooldownModal .modal-dialog { width: 508px; }
    #depositCooldownModal .modal-header { padding: 17px 17px 0; }
    #depositCooldownModal .modal-body { padding: 0 41px 24px; }
    #depositCooldownModal .modal-footer { padding: 0 41px 40px; }
    #depositCooldownModal .deposit-cooldown-modal__close { width: 32px; height: 32px; }
    #depositCooldownModal .deposit-cooldown-modal__gif { width: 220px; height: 220px; margin-bottom: 20px; }
    #depositCooldownModal .deposit-cooldown-modal__title { font-size: 22px; line-height: 28px; margin-bottom: 16px; }
    #depositCooldownModal .deposit-cooldown-modal__message { font-size: 16px; line-height: 24px; }
    #depositCooldownModal .deposit-cooldown-modal__btn { height: 54px; font-size: 18px; margin: 0; }

    /* S06 — Inbox detail, with existing focus/scroll/close handling. */
    .am-modal-overlay__dialog--inbox { max-width: 706px; }
    .am-modal-overlay__body--inbox { padding: 56px 36px 40px; }
    .am-modal-overlay__dialog--inbox .inbox-modal__date { font-size: 16px; line-height: 24px; margin-bottom: 24px; }
    .am-modal-overlay__dialog--inbox .inbox-modal__divider { margin-bottom: 28px; }
    .am-modal-overlay__dialog--inbox .inbox-modal__subject { font-size: 20px; line-height: 28px; margin-bottom: 24px; }
    .am-modal-overlay__dialog--inbox .inbox-modal__content { font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
    .am-modal-overlay__dialog--inbox .am-close-btn {
        width: 32px;
        height: 32px;
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 50%;
    }

    /* S07 — Withdrawal controls only. Deposit already has its own sizing. */
    .desktop-withdrawal .payment-tabs { gap: 10px; flex-wrap: nowrap; }
    .desktop-withdrawal .payment-tab { width: 208px; flex: 0 1 208px; min-width: 0; height: 58px; padding: 8px 20px; font-size: 16px; gap: 10px; }
    .desktop-withdrawal .payment-tab__icon-img { width: 30px; height: 30px; }
    .desktop-withdrawal .deposit-amount-row > .ff-row { width: 488px; max-width: 100%; min-width: 0; flex: 0 1 488px; }
    .desktop-withdrawal .deposit-amount-row .ff-input-wrap,
    .desktop-withdrawal .deposit-amount-row .ff-input { width: 100% !important; max-width: 488px !important; }

    /* S08 — Page-local labels and controls, not global ff-input/table overrides. */
    .desktop-deposit .web-input-label,
    .desktop-deposit .ff-label,
    .desktop-withdrawal .web-input-label,
    .desktop-withdrawal .ff-label,
    .banking-details-page .web-input-label,
    .banking-details-page .ff-label,
    .profile-form__fields .web-input-label,
    .profile-form__fields .ff-label,
    .history-page-wrap .web-input-label,
    .history-page-wrap .ff-label,
    .referral-page-wrap .web-input-label,
    .referral-page-wrap .ff-label { font-size: 16px; line-height: 24px; }
    .desktop-deposit .web-typography--section-title,
    .desktop-withdrawal .web-typography--section-title,
    .history-page-wrap .web-typography--section-title,
    .referral-page-wrap .web-typography--section-title,
    .profile-form__section-title { font-size: 18px; line-height: 24px; }
    .desktop-deposit .deposit-field,
    .desktop-withdrawal .deposit-field { margin-bottom: 32px; }
    .desktop-deposit .deposit-field > .ff-row,
    .desktop-withdrawal .deposit-field > .ff-row { margin-bottom: 0; }
    .desktop-deposit .deposit-field .ff-input-wrap,
    .desktop-deposit .deposit-field .ff-input,
    .desktop-deposit .deposit-field .deposit-copy-field,
    .desktop-withdrawal .deposit-field .ff-input-wrap,
    .desktop-withdrawal .deposit-field .ff-input,
    .desktop-withdrawal .deposit-field .deposit-copy-field { max-width: 488px !important; }
    .desktop-deposit .deposit-select-row,
    .desktop-withdrawal .deposit-select-row { width: 488px; max-width: 100%; }
    .desktop-deposit .deposit-select-row .ff-custom-select-row,
    .desktop-withdrawal .deposit-select-row .ff-custom-select-row { max-width: 100%; }
    .desktop-deposit .deposit-field .ff-input,
    .desktop-withdrawal .deposit-field .ff-input,
    .desktop-deposit .deposit-copy-field,
    .desktop-withdrawal .deposit-copy-field,
    .desktop-deposit .deposit-custom-select,
    .desktop-withdrawal .deposit-custom-select,
    .banking-details-page .ff-input,
    .banking-details-page .ff-custom-select,
    .profile-form__fields .ff-input,
    .profile-form__fields .ff-select { min-height: 60px; font-size: 16px; }
    .desktop-withdrawal .deposit-amount-row .ff-input { min-height: 60px !important; height: 60px; }
    .banking-details-page .banking-form .deposit-field .ff-input-wrap,
    .banking-details-page .banking-form .deposit-field .ff-input { max-width: 100% !important; }
    .banking-details-page .deposit-select-row .ff-custom-select-row,
    .banking-details-page .deposit-select-row .deposit-custom-select { width: 100%; max-width: 100%; }
    .deposit-page-wrap:has(.banking-details-page) .web-typography--section-title { font-size: 18px; line-height: 24px; }
    .banking-details-page .banking-form { width: 488px; max-width: 100%; }
    .banking-details-page .banking-tabs-row .stgp__btn { min-height: 54px; font-size: 16px; }
    .banking-details-page .banking-form > .ff-row,
    .profile-form__fields > .ff-row { margin-bottom: 32px; }
    .profile-form__fields { max-width: 488px; }
    .history-page-wrap .history-filter-group { width: 488px; max-width: 100%; }
    .history-page-wrap .history-filter-group .ff-custom-select,
    .history-page-wrap .history-date-input,
    .referral-page-wrap .history-date-input { min-height: 60px; font-size: 16px; }
    .history-page-wrap .quick-filter-btn,
    .referral-page-wrap .quick-filter-btn { width: 133px; min-height: 48px; padding: 10px 12px; font-size: 16px; }
    .history-page-wrap .data-table th,
    .history-page-wrap .data-table td,
    .banking-details-page .banking-table th,
    .banking-details-page .banking-table td,
    .referral-page-wrap .referral-reports-table th,
    .referral-page-wrap .referral-reports-table td { font-size: 16px; line-height: 24px; padding-top: 15px; padding-bottom: 15px; }
    .inbox-page .inbox-table thead tr { height: 54px; }
    .inbox-page .inbox-table th,
    .inbox-page .inbox-table td { font-size: 16px; line-height: 24px; }
    .inbox-page .inbox-table td { padding-top: 15px; padding-bottom: 15px; }
    #promo-tnc-modal .am-modal__terms { font-size: 16px; line-height: 24px; }

    /* S09 — Rebate and referral commission summaries. */
    .rebate-page-wrap .rebate-available-card,
    .referral-page-wrap .rebate-available-card { min-height: 138px; padding: 28px 36px; gap: 24px; }
    .rebate-page-wrap .rebate-available-card__label,
    .referral-page-wrap .rebate-available-card__label { font-size: 18px; line-height: 24px; }
    .rebate-page-wrap .rebate-available-card__amount,
    .referral-page-wrap .rebate-available-card__amount { font-size: 34px; overflow-wrap: anywhere; }
    .rebate-page-wrap .rebate-table th { font-size: 16px; line-height: 24px; padding: 18px 20px; }
    .rebate-page-wrap .rebate-table td { font-size: 16px; line-height: 24px; }
    .rebate-page-wrap .rebate-notes__list li { font-size: 16px; line-height: 24px; }

    /* S10 — Only the gap; no legal text or outer info-page geometry changes. */
    #info-pages.desktop-info .tnc-accordion { gap: 32px; }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .desktop-withdrawal .payment-tab { padding: 8px 12px; font-size: 14px; }
    .desktop-withdrawal .payment-tab__icon-img { width: 24px; height: 24px; }
}

/* Retain readable cells without moving or widening the surrounding card. */
@media (min-width: 992px) and (max-width: 1599px) {
    .history-page-wrap .data-table th,
    .history-page-wrap .data-table td,
    .referral-page-wrap .referral-reports-table th,
    .referral-page-wrap .referral-reports-table td,
    .banking-details-page .banking-table th,
    .banking-details-page .banking-table td {
        padding-left: 12px;
        padding-right: 12px;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .inbox-page .inbox-table th,
    .inbox-page .inbox-table td { padding-left: 12px; padding-right: 12px; }
}

/* C02 — Contact cards from XD boards 21/22/39 (preview estimates).
 * Only the inner contact grid changes. CMS content, page containers and mobile stay intact. */
@media (min-width: 992px) {
    #info-pages.desktop-info #panel-contact .contact-title {
        font-size: 18px;
        line-height: 24px;
        margin-bottom: 16px;
    }
    #info-pages.desktop-info #panel-contact .contact-desc {
        max-width: 1060px;
        margin-bottom: 32px !important;
    }
    #info-pages.desktop-info #panel-contact .contact-layout {
        max-width: 1060px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    #info-pages.desktop-info #panel-contact .customer-service-card,
    #info-pages.desktop-info #panel-contact .social-media-card {
        min-width: 0;
        min-height: 126px;
        padding: 24px 34px;
    }
    #info-pages.desktop-info #panel-contact .contact-details-card {
        min-width: 0;
        min-height: 268px;
        padding: 32px 40px;
    }
    #info-pages.desktop-info #panel-contact .customer-service-card__icons,
    #info-pages.desktop-info #panel-contact .social-media-card__icons {
        flex-wrap: wrap;
        gap: 20px;
    }
    #info-pages.desktop-info #panel-contact .customer-service-card__icons > *,
    #info-pages.desktop-info #panel-contact .social-media-card__icons > * {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }
    #info-pages.desktop-info #panel-contact .contact-details-card__label {
        font-size: 16px;
        line-height: 24px;
    }

    .history-page-wrap #pending-transaction .contact-us-section > .web-typography--section-title {
        margin-bottom: 12px;
    }
    .history-page-wrap #pending-transaction .contact-us-section > .web-typography--paragraph {
        font-size: 16px;
        line-height: 24px;
        margin-bottom: 28px;
    }
    .history-page-wrap #pending-transaction .contact-layout {
        width: 804px;
        max-width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    .history-page-wrap #pending-transaction .contact-layout__left { gap: 16px; }
    .history-page-wrap #pending-transaction .contact-layout__left,
    .history-page-wrap #pending-transaction .contact-layout__right { min-width: 0; }
    .history-page-wrap #pending-transaction .customer-service-card,
    .history-page-wrap #pending-transaction .social-media-card {
        min-width: 0;
        min-height: 94px;
        padding: 15px 24px;
    }
    .history-page-wrap #pending-transaction .customer-service-card__title,
    .history-page-wrap #pending-transaction .social-media-card__title {
        font-size: 16px;
        line-height: 24px;
        margin-bottom: 8px;
    }
    .history-page-wrap #pending-transaction .customer-service-card__icons,
    .history-page-wrap #pending-transaction .social-media-card__icons {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
    }
    .history-page-wrap #pending-transaction .customer-service-card__icons > *,
    .history-page-wrap #pending-transaction .social-media-card__icons > * {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
    }
    .history-page-wrap #pending-transaction .customer-service-card__icons img,
    .history-page-wrap #pending-transaction .social-media-card__icons img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    .history-page-wrap #pending-transaction .contact-details-card {
        min-width: 0;
        min-height: 204px;
        padding: 24px;
    }
    .history-page-wrap #pending-transaction .contact-details-card__row {
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 20px;
    }
    .history-page-wrap #pending-transaction .contact-details-card__icon,
    .history-page-wrap #pending-transaction .contact-details-card__icon img {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }
    .history-page-wrap #pending-transaction .contact-details-card__label {
        font-size: 16px;
        line-height: 24px;
    }

    /* Rows follow enabled CMS entries, not a hard-coded three-row skeleton. */
    #info-pages.desktop-info #panel-contact .contact-details-card,
    .history-page-wrap #pending-transaction .contact-details-card {
        grid-template-rows: none;
        grid-auto-rows: minmax(32px, auto);
        align-content: space-around;
        row-gap: 16px;
    }
    #info-pages.desktop-info #panel-contact .contact-info-row,
    #info-pages.desktop-info #panel-contact .contact-details-card__label,
    .history-page-wrap #pending-transaction .contact-details-card__row,
    .history-page-wrap #pending-transaction .contact-details-card__text,
    .history-page-wrap #pending-transaction .contact-details-card__label {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .history-page-wrap #pending-transaction .contact-layout { grid-template-columns: minmax(0, 1fr); }
    .history-page-wrap #pending-transaction .contact-details-card { min-height: 0; }
    #info-pages.desktop-info #panel-contact .customer-service-card,
    #info-pages.desktop-info #panel-contact .social-media-card,
    #info-pages.desktop-info #panel-contact .contact-details-card { padding-left: 24px; padding-right: 24px; }
}
