/* Mobile text accessibility: keep the default scale while honoring user font settings. */
html,
body {
    font-size: 100%;
    -webkit-text-size-adjust: auto !important;
    text-size-adjust: auto !important;
}

html {
    /* WebKit maps this system text style to the user's iOS Dynamic Type setting. */
    font: -apple-system-body;
}

body {
    font-size: 1rem;
}

body.brand-auth-page {
    overflow-x: hidden;
    overflow-y: auto;
}

.page-container {
    align-items: safe center !important;
}

.user-bubble,
.ai-bubble,
.lotus-bubble,
.message,
.toast,
.notification,
.auth-card,
.profile-card,
.sub-card,
.agreement-modal,
.menu-item {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message-bubble-container,
.input-area-inner,
.code-row,
.code-row .form-input,
.form-group,
.btn-group {
    min-width: 0;
}

.message-input,
.form-input,
.form-textarea {
    line-height: 1.45;
}

.lotus-bubble {
    line-height: 1.4;
}

.btn,
.year-btn,
.btn-pay,
.selection-action {
    height: auto;
    min-height: 44px;
}

.code-row {
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.code-row .form-input {
    flex: 1 1 6em;
    min-width: min(100%, 6em);
}

.code-row .btn {
    flex: 0 1 auto;
    max-width: 100%;
    min-width: max-content;
    white-space: normal;
}

.brand-logo {
    white-space: normal !important;
    overflow-wrap: anywhere;
}

.floating-menu {
    width: max-content;
    max-width: calc(100vw - 32px);
}

.menu-item,
.sub-footer a {
    white-space: normal;
}

.sub-footer a {
    text-align: center;
}

/* Leave enough room for controls when labels grow with the user's text scale. */
.chat-messages {
    padding-bottom: calc(88px + 2rem) !important;
}

@media (max-width: 480px) {
    .btn-group {
        flex-wrap: wrap;
    }

    .btn-group .btn {
        min-width: min(100%, 8rem);
    }

    .chat-messages.has-selection-toolbar {
        padding-bottom: max(126px, 8rem) !important;
    }
}
