.messages-container {
    max-width: 970px;
    margin: 0 auto;
    padding: 0 15px;
    color: #191919;
    font-size: 16px;
    font-weight: 300;
    line-height: normal;
}

.messages-container :where(div) {
    line-height: normal;
}

.messages-container h1 {
    margin: 0;
    padding: 5px 0;
    color: #191919;
    font-size: 36px;
    font-weight: 400;
    line-height: 1em;
}

.messages-container > h1,
.messages-title {
    margin-bottom: 12px;
}

.messages-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.messages-compose-btn {
    margin-top: 7px;
}

.messages-tabs {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(150, 150, 150, 0.74);
}

.messages-tab {
    flex: 1 1 0;
    min-width: 25%;
    padding: 0;
}

.messages-tab-heading {
    display: block;
    height: 40px;
    padding: 12px 2%;
    color: #191919;
    background-color: #fff;
    font-size: 16px;
    line-height: 100%;
    text-decoration: none;
    user-select: none;
}

.messages-tab-heading:hover,
.messages-tab-heading:focus,
.messages-tab.active .messages-tab-heading {
    color: #191919;
    box-shadow: 0 -4px 0 0 #7B2CBF inset;
}

.messages-tab-heading:hover {
    background-color: #F2F2F2;
}

.messages-tab-label {
    display: inline-block;
    font-size: 18px;
    font-weight: 400;
}

.messages-tab-count {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 1px 6px;
    color: #fff;
    background-color: #E2231A;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 400;
    text-align: center;
    vertical-align: top;
}

.messages-alert {
    height: 48px;
    margin-top: 9px;
    padding: 15px;
    color: #fff;
    font-size: 18px;
    font-weight: 300;
    line-height: 1em;
    text-align: center;
}

.messages-alert.success {
    background-color: #02b757;
}

.messages-alert.error {
    height: auto;
    background-color: #D86868;
}

.messages-container > h1 + .messages-alert {
    margin: 0 0 12px;
}

.messages-empty {
    margin: 18px 0;
    padding: 15px;
    color: #757575;
    background-color: #B8B8B8;
    text-align: center;
}

.messages-btn,
.messages-btn-secondary,
.messages-btn-primary,
.messages-send {
    display: inline-block;
    padding: 7px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 400;
    line-height: 100%;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    transition: box-shadow 200ms ease-in-out;
}

.messages-btn {
    color: #191919;
    background-color: #fff;
    border-color: #B8B8B8;
}

.messages-btn:hover,
.messages-btn:focus {
    color: #191919;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(150, 150, 150, 0.74);
}

.messages-btn-secondary,
.messages-btn-secondary:link,
.messages-btn-secondary:visited {
    color: #fff;
    background-color: #7B2CBF;
    border-color: #7B2CBF;
}

.messages-btn-secondary:hover,
.messages-btn-secondary:focus {
    color: #fff;
    background-color: #9D4EDD;
    border-color: #9D4EDD;
    box-shadow: 0 1px 3px rgba(150, 150, 150, 0.74);
}

.messages-btn-primary,
.messages-send {
    color: #fff;
    background-color: #02b757;
    border-color: #02b757;
}

.messages-btn-primary:hover,
.messages-btn-primary:focus,
.messages-send:hover,
.messages-send:focus {
    color: #fff;
    background-color: #3FC679;
    border-color: #3FC679;
    box-shadow: 0 1px 3px rgba(150, 150, 150, 0.74);
}

.messages-btn:active,
.messages-btn-secondary:active,
.messages-btn-primary:active,
.messages-send:active {
    box-shadow: none;
}

.messages-btn:disabled {
    color: #B8B8B8;
    background-color: #fff;
    border-color: #B8B8B8;
    box-shadow: none;
    cursor: default;
}

.messages-btn-secondary:disabled {
    background-color: #caabe5;
    border-color: #caabe5;
    box-shadow: none;
    cursor: default;
}

.messages-btn-primary:disabled,
.messages-send:disabled {
    background-color: #a3e2bd;
    border-color: #a3e2bd;
    box-shadow: none;
    cursor: default;
}

.messages-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("/img/generic-icons.svg") no-repeat;
    background-size: 40px auto;
    vertical-align: middle;
}

.messages-icon.first {
    background-position: 0 -820px;
}

.messages-icon.prev {
    background-position: 0 -300px;
}

.messages-icon.next {
    background-position: 0 -280px;
}

.messages-icon.last {
    background-position: 0 -800px;
}

.disabled .messages-icon.first {
    background-position: 0 -1000px;
}

.disabled .messages-icon.prev {
    background-position: 0 -960px;
}

.disabled .messages-icon.next {
    background-position: 0 -940px;
}

.disabled .messages-icon.last {
    background-position: 0 -980px;
}

.messages-icon-btn {
    display: block;
    float: left;
    margin-right: 12px;
    padding: 5px;
    background-color: #fff;
    border: 1px solid #B8B8B8;
    border-radius: 3px;
    line-height: 0;
    transition: box-shadow 200ms ease-in-out;
}

.messages-icon-btn:hover,
.messages-icon-btn:focus {
    box-shadow: 0 1px 3px rgba(150, 150, 150, 0.74);
}

.messages-icon-btn.md {
    float: none;
    margin-right: 15px;
    padding: 9px;
}

.messages-check {
    position: relative;
}

.messages-check input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.messages-check label {
    position: relative;
    display: inline-block;
    height: 16px;
    margin: 0;
    padding-left: 20px;
    color: #191919;
    font-size: 16px;
    font-weight: 300;
    line-height: 16px;
    vertical-align: top;
    cursor: pointer;
    user-select: none;
}

.messages-check label::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border: 1px solid #B8B8B8;
    border-radius: 3px;
}

.messages-check label:hover::before,
.messages-check input:focus-visible + label::before {
    border-color: #7B2CBF;
}

.messages-check input:checked + label::before {
    background: #7B2CBF url("/img/generic-icons.svg") 0 -602px / 28px auto no-repeat;
    border-color: #7B2CBF;
}

.messages-toolbar {
    display: flow-root;
}

.messages-actions {
    float: left;
    height: 32px;
    margin-top: 9px;
}

.messages-check-all {
    float: left;
    margin: 9px 48px 0 15px;
}

.messages-actions .messages-btn {
    float: left;
    margin-right: 15px;
}

.messages-pager {
    float: right;
    margin: 9px 0;
    font-size: 0;
}

.messages-pager-btn {
    display: inline-block;
    margin-left: 6px;
    padding: 5px;
    background-color: #fff;
    border: 1px solid #B8B8B8;
    border-radius: 3px;
    line-height: 0;
    vertical-align: middle;
    cursor: pointer;
}

.messages-pager-btn:hover {
    background-color: #F2F2F2;
}

.messages-pager-btn.disabled {
    background-color: #F2F2F2;
    border-color: #E3E3E3;
    cursor: default;
}

.messages-pager-text {
    margin-left: 9px;
    color: #191919;
    font-size: 16px;
    font-weight: 300;
    vertical-align: middle;
}

.messages-list {
    display: flow-root;
    margin-top: 9px;
}

.messages-row {
    display: flow-root;
    position: relative;
    margin-top: 1px;
    padding: 9px 15px;
    background-color: #F2F2F2;
    cursor: pointer;
}

.messages-row.unread {
    background-color: #fff;
}

.messages-row:hover {
    box-shadow: 4px 0 0 0 #7B2CBF inset;
}

.messages-row .messages-check {
    float: left;
    margin: 18px 12px 0 0;
}

.messages-avatar {
    display: block;
    float: left;
    width: 48px;
    height: 48px;
    margin-right: 12px;
    overflow: hidden;
    border-radius: 50%;
}

.messages-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.messages-avatar.system {
    border-radius: 0;
}

.messages-avatar.system img {
    object-fit: contain;
}

.messages-summary {
    display: block;
    position: relative;
    float: left;
    width: calc(100% - 92px);
    color: #191919;
    text-decoration: none;
}

.messages-row.no-check .messages-summary {
    width: calc(100% - 60px);
}

.messages-summary:hover {
    color: #191919;
}

.messages-summary-name {
    display: block;
    overflow: hidden;
    padding: 3px 120px 0 0;
    font-weight: 300;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messages-summary-date,
.messages-date {
    color: #B8B8B8;
    font-size: 12px;
    font-weight: 400;
}

.messages-summary-date {
    position: absolute;
    top: 0;
    right: 0;
    line-height: 19px;
}

.messages-summary-content {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messages-subject {
    font-weight: 400;
}

.unread .messages-subject {
    font-weight: 600;
}

.messages-preview {
    padding: 0 5px;
    color: #B8B8B8;
    font-weight: 300;
}

.messages-preview::before {
    content: "- ";
}

.messages-toolbar.detail {
    margin-top: 9px;
}

.messages-toolbar.detail .messages-btn,
.messages-toolbar.detail .messages-btn-secondary {
    float: left;
    margin-right: 6px;
}

.messages-detail {
    position: relative;
    margin: 9px 0;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 1px 4px 0 rgba(25, 25, 25, 0.3);
    word-break: break-word;
}

.messages-detail-head {
    display: flow-root;
    margin: 0 80px 12px 0;
}

.messages-container .messages-detail-head h3 {
    margin: -12px 0 6px;
    padding: 5px 0;
    color: #191919;
    font-size: 24px;
    font-weight: 300;
    line-height: 1em;
}

.messages-detail-from {
    padding-top: 4px;
}

.messages-name,
.messages-name:link,
.messages-name:visited {
    color: #7B2CBF;
    font-weight: 400;
    text-decoration: none;
}

a.messages-name:hover,
a.messages-name:focus {
    color: #7B2CBF;
    text-decoration: underline;
}

.messages-date {
    display: block;
}

.messages-detail-body {
    white-space: pre-line;
}

.messages-report,
.messages-report:link,
.messages-report:visited {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #D86868;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
}

.messages-report:hover,
.messages-report:focus {
    color: #D86868;
    text-decoration: underline;
}

.messages-reply {
    padding: 15px 0 24px;
}

.messages-reply-box {
    display: block;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 200px;
    margin: 0 0 15px;
    padding: 12px;
    color: #191919;
    background-color: #fff;
    border: 1px solid #B8B8B8;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.4em;
    outline: none;
    resize: vertical;
}

.messages-reply-box:focus {
    border-color: #7B2CBF;
}

.messages-reply-box::placeholder,
.messages-new-input input::placeholder {
    color: #B8B8B8;
    font-weight: 300;
    opacity: 1;
}

.messages-warning {
    color: #F68802;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4em;
}

.messages-reply-footer {
    display: flex;
    align-items: flex-start;
}

.messages-reply-footer .messages-warning {
    width: 57%;
    padding-top: 5px;
}

.messages-include {
    margin-left: auto;
    padding: 5px 12px;
}

.messages-label {
    color: #B8B8B8;
    font-weight: 400;
}

.messages-new {
    margin-bottom: 18px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 1px 4px 0 rgba(25, 25, 25, 0.3);
}

.messages-new-back {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.messages-new-field {
    display: flex;
    margin-bottom: 18px;
    padding: 9px 12px;
    border: 1px solid #B8B8B8;
    border-radius: 3px;
    line-height: 20px;
}

.messages-new-field label {
    flex: none;
    margin: 0 5px 0 0;
}

.messages-new-input {
    flex: 1 1 auto;
    min-width: 0;
}

.messages-new-input input {
    display: block;
    width: 100%;
    height: 20px;
    margin: 0;
    padding: 0;
    color: #191919;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 300;
    line-height: 20px;
    outline: none;
}

.messages-new .messages-reply-box {
    margin-bottom: 18px;
}

.messages-new-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.messages-new-actions {
    display: flex;
    flex: none;
    align-items: flex-start;
    margin-left: 15px;
}

.messages-link,
.messages-link:link,
.messages-link:visited {
    padding-top: 8px;
    color: #7B2CBF;
    text-decoration: none;
}

.messages-link:hover,
.messages-link:focus {
    color: #7B2CBF;
    text-decoration: underline;
}

.messages-send {
    min-width: 90px;
    margin-left: 15px;
    padding: 9px;
    font-size: 18px;
}

@media (max-width: 767px) {
    .messages-container h1 {
        font-size: 30px;
    }

    .messages-row .messages-avatar {
        display: none;
    }

    .messages-summary,
    .messages-row.no-check .messages-summary {
        width: calc(100% - 44px);
    }

    .messages-summary-content .messages-preview {
        display: block;
        padding: 0;
    }

    .messages-summary-content .messages-preview::before {
        content: none;
    }

    .messages-toolbar.bottom .messages-check-all,
    .messages-toolbar.bottom .messages-pager {
        display: none;
    }

    .messages-reply-footer,
    .messages-new-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .messages-reply-footer .messages-warning {
        width: 100%;
    }

    .messages-include {
        margin-left: 0;
        padding: 12px 0;
    }

    .messages-new-actions {
        justify-content: flex-end;
        margin: 12px 0 0;
    }
}
