.af-aam-header-link {
    position: relative;
    display: inline-block;
}


.af-aam-header-link:hover,
.af-aam-header-link:focus {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.af-aam-bell {
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
}

.af-aam-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 50%;
    background: #c33;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
}

.alerts--new .af-aam-badge {
    background: #e03a3a;
}

.af-aam-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 260px;
    background: #1e1e1e;
    border: 1px solid #444;
    display: none;
    z-index: 9999;
}

.af-aam-dropdown.af-aam-open {
    display: block;
}

.af-aam-dropdown-inner {
    min-width: 260px;
    max-width: 320px;
    max-height: 320px;
    overflow-y: auto;
    background: #222;
    color: #eee;
    border: 1px solid #444;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,.5);
}

#af_aam_dropdown_list {
    list-style: none;
    margin: 0;
    padding: 4px;
}

.af-aam-item {
    padding: 4px 6px;
    cursor: pointer;
    font-size: 12px;
}

.af-aam-item-unread {
    background: rgba(255,255,255,0.06);
    font-weight: bold;
}

.af-aam-item:hover {
    background: rgba(255,255,255,0.12);
}

.af-aam-empty {
    padding: 6px;
    font-size: 12px;
    opacity: .8;
}

.af-aam-dropdown-footer {
    padding: 4px 6px;
    border-top: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.af-aam-dropdown-footer a {
    color: #9cf;
    text-decoration: none;
}

.af-aam-dropdown-footer button {
    font-size: 11px;
}

/* modal */

.af-aam-modal {
    display: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    inset: 0;
    margin: 0 auto;
    z-index: 9998;
    background: #00000052;
    height: auto;
    width: 100%;
}

.af-aam-modal.af-aam-modal-open {
    display: block;
}


.af-aam-modal-table {
    max-width: 600px;
}

.af-aam-modal .af-aam-modal-close {
    float: right;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.alert__avatar {
    width: 40px;
    font-size: 18px;
}

.alert__content a {
    color: inherit;
}

.alert--read td {
    opacity: .4;
}

.hidden {
    display: none;
}

.af-aam-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 9998;
}

.af-aam-modal-window {
    position: fixed;
    z-index: 9999;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    max-width: 95%;
    background: #222;
    color: #eee;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,.7);
}

.af-aam-modal-header,
.af-aam-modal-footer {
    padding: 8px 10px;
    border-bottom: 1px solid #444;
}

.af-aam-modal-footer {
    border-top: 1px solid #444;
    border-bottom: 0;
}

.af-aam-modal-title {
    font-weight: bold;
}

.af-aam-modal-close {
    float: right;
}

/* list page */

.af-aam-list-page {
    margin: 10px;
}

.af-aam-list-row {
    padding: 6px 8px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    font-size: 13px;
}

.af-aam-row-unread {
    background: rgba(255,255,255,0.04);
    font-weight: bold;
}

.af-aam-list-icon {
    margin-right: 6px;
}

.af-aam-list-text {
    flex: 1;
}

.af-aam-list-date {
    font-size: 11px;
    opacity: .8;
}

/* mention button */

.af-aam-mention-button {
    margin-left: 4px;
    font-size: 11px;
    text-decoration: none;
}

/* suggest box */

.af-aam-suggest-box {
    position: absolute;
    z-index: 9999;
    min-width: 180px;
    max-width: 260px;
    max-height: 200px;
    overflow-y: auto;
    background: #222;
    color: #eee;
    border: 1px solid #444;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,.6);
}

/* элементы MyAlerts, адаптированные под AAM (без графических файлов) */
.alerts--new a,
.newAlerts > a {
    color: #d9534f !important;
    font-weight: bold;
}

.alert-row__no-alerts td {
    text-align: center;
}

.alert--read.alert,
.af-aam-item.af-aam-item-read {
    opacity: .4;
}

.alert.alert--read td.trow1 {
    background-color: #f5f5f5;
}

.usercp_nav_myalerts,
.usercp_nav_myalerts_delete_all,
.usercp_nav_myalerts_delete_read {
    padding-left: 24px;
    position: relative;
}

.usercp_nav_myalerts::before,
.usercp_nav_myalerts_delete_all::before,
.usercp_nav_myalerts_delete_read::before {
    content: '\23f3';
    position: absolute;
    left: 6px;
    color: #888;
}

.usercp_nav_myalerts_delete_all::before { content: '\2716'; }
.usercp_nav_myalerts_delete_read::before { content: '\1F5D1'; }

.af-aam-suggest-item {
    padding: 4px 6px;
    font-size: 12px;
    cursor: pointer;
}

.af-aam-suggest-item:hover {
    background: rgba(255,255,255,0.12);
}
.alert--unread td.trow1.alert__content a {
    font-weight: bold;
}
.af-aam-row-read {
    opacity: .4;
}
.trow1.alert__time .markReadAlertButton {font-weight: bold; color: green;padding-right: 15px;}
.trow1.alert__time .deleteAlertButton {font-weight: bold;color: red;padding-left: 15px;}
/* Глушим старый спрайт / псевдо-иконку на .alerts a:before,
 * которая тянет headerlinks_sprite.png и/или ставит content:'?'.
 * Для нашего колокольчика используем af-aam-alerts как маркер.
 */
.alerts.af-aam-alerts > a.myalerts:before,
.alerts.af-aam-alerts a.myalerts:before {
    content: '';
    background: none;
    width: 0;
    height: 0;
    display: none;
}
/* --- Глушим старый спрайт и "невидимость" текста именно для нашего колокольчика --- */

#header ul.menu li.alerts.af-aam-alerts > a.myalerts.af-aam-header-link,
#header ul.menu li.af-aam-alerts > a.myalerts.af-aam-header-link {
    background: none !important;
    background-image: none !important;
    text-indent: 0 !important;
    overflow: visible !important;
    width: auto !important;
    height: auto !important;
    padding-left: 6px;
    padding-right: 6px;
}

/* гарантируем, что сам значок виден и не наследует дичь от родителя */
.af-aam-header-link {
    font-size: 0; /* чтобы не дублировать текст, а работать только через span */
}

.af-aam-bell {
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    text-indent: 0;
    color: inherit;
}

.af-aam-list-actions {
    margin: 0 0 10px 0;
    text-align: right;
}
/* Toast-уведомления */

.af-aam-toast-container {
    position: fixed;
    right: 15px;
    bottom: 15px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 6px;
}

.af-aam-toast {
    min-width: 220px;
    max-width: 360px;
    background: #222;
    color: #eee;
    border-radius: 4px;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.6);
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #444;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s ease-out, transform .2s ease-out;
}

.af-aam-toast.af-aam-toast-show {
    opacity: 1;
    transform: translateY(0);
}

.af-aam-toast-title {
    font-weight: bold;
    margin-bottom: 3px;
}

.af-aam-toast-text {
    font-size: 12px;
}

.af-aam-sound-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
}

.af-aam-sound-switch input {
    display: none;
}

.af-aam-sound-slider {
    position: relative;
    width: 30px;
    height: 10px;
    border-radius: 16px;
    background: #666;
    transition: background 0.2s ease;
}

.af-aam-sound-slider::before {
    content: "";
    position: absolute;
    top: 0px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.af-aam-sound-switch input:checked + .af-aam-sound-slider {
    background: #4caf50;
}

.af-aam-sound-switch input:checked + .af-aam-sound-slider::before {
    transform: translateX(16px);
}
.af-aam-header-link {
    position: relative;
    display: inline-block;
}


.af-aam-header-link:hover,
.af-aam-header-link:focus {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.af-aam-bell {
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
}

.af-aam-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 50%;
    background: #c33;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
}

.alerts--new .af-aam-badge {
    background: #e03a3a;
}

.af-aam-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 260px;
    background: #1e1e1e;
    border: 1px solid #444;
    display: none;
    z-index: 9999;
}

.af-aam-dropdown.af-aam-open {
    display: block;
}

.af-aam-dropdown-inner {
    min-width: 260px;
    max-width: 320px;
    max-height: 320px;
    overflow-y: auto;
    background: #222;
    color: #eee;
    border: 1px solid #444;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,.5);
}

#af_aam_dropdown_list {
    list-style: none;
    margin: 0;
    padding: 4px;
}

.af-aam-item {
    padding: 4px 6px;
    cursor: pointer;
    font-size: 12px;
}

.af-aam-item-unread {
    background: rgba(255,255,255,0.06);
    font-weight: bold;
}

.af-aam-item:hover {
    background: rgba(255,255,255,0.12);
}

.af-aam-empty {
    padding: 6px;
    font-size: 12px;
    opacity: .8;
}

.af-aam-dropdown-footer {
    padding: 4px 6px;
    border-top: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.af-aam-dropdown-footer a {
    color: #9cf;
    text-decoration: none;
}

.af-aam-dropdown-footer button {
    font-size: 11px;
}

/* modal */

.af-aam-modal {
    display: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    inset: 0;
    margin: 0 auto;
    z-index: 9998;
    background: #00000052;
    height: auto;
    width: 100%;
}

.af-aam-modal.af-aam-modal-open {
    display: block;
}


.af-aam-modal-table {
    max-width: 600px;
}

.af-aam-modal .af-aam-modal-close {
    float: right;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.alert__avatar {
    width: 40px;
    font-size: 18px;
}
.af-aam-avatar {
    display: inline-flex;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
}
.af-aam-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.af-aam-avatar--placeholder {
    background: linear-gradient(135deg, #555, #777);
}

.alert__content a {
    color: inherit;
}

.alert--read td {
    opacity: .4;
}

.hidden {
    display: none;
}

.af-aam-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 9998;
}

.af-aam-modal-window {
    position: fixed;
    z-index: 9999;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    max-width: 95%;
    background: #222;
    color: #eee;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,.7);
}

.af-aam-modal-header,
.af-aam-modal-footer {
    padding: 8px 10px;
    border-bottom: 1px solid #444;
}

.af-aam-modal-footer {
    border-top: 1px solid #444;
    border-bottom: 0;
}

.af-aam-modal-title {
    font-weight: bold;
}

.af-aam-modal-close {
    float: right;
}

/* list page */

.af-aam-list-page {
    margin: 10px;
}

.af-aam-list-row {
    padding: 6px 8px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    font-size: 13px;
}

.af-aam-list-avatar {
    margin-right: 8px;
    flex: 0 0 auto;
}

.af-aam-row-unread {
    background: rgba(255,255,255,0.04);
    font-weight: bold;
}

.af-aam-list-icon {
    margin-right: 6px;
}

.af-aam-list-text {
    flex: 1;
}

.af-aam-list-date {
    font-size: 11px;
    opacity: .8;
}

/* mention button */

.af-aam-mention-button {
    margin-left: 4px;
    font-size: 11px;
    text-decoration: none;
}

/* suggest box */

.af-aam-suggest-box {
    position: absolute;
    z-index: 9999;
    min-width: 180px;
    max-width: 260px;
    max-height: 200px;
    overflow-y: auto;
    background: #222;
    color: #eee;
    border: 1px solid #444;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,.6);
}

/* элементы MyAlerts, адаптированные под AAM (без графических файлов) */
.alerts--new a,
.newAlerts > a {
    color: #d9534f !important;
    font-weight: bold;
}

.alert-row__no-alerts td {
    text-align: center;
}

.alert--read.alert,
.af-aam-item.af-aam-item-read {
    opacity: .4;
}

.alert.alert--read td.trow1 {
    background-color: #f5f5f5;
}

.usercp_nav_myalerts,
.usercp_nav_myalerts_delete_all,
.usercp_nav_myalerts_delete_read {
    padding-left: 24px;
    position: relative;
}

.usercp_nav_myalerts::before,
.usercp_nav_myalerts_delete_all::before,
.usercp_nav_myalerts_delete_read::before {
    content: '\23f3';
    position: absolute;
    left: 6px;
    color: #888;
}

.usercp_nav_myalerts_delete_all::before { content: '\2716'; }
.usercp_nav_myalerts_delete_read::before { content: '\1F5D1'; }

.af-aam-suggest-item {
    padding: 4px 6px;
    font-size: 12px;
    cursor: pointer;
}

.af-aam-suggest-item:hover {
    background: rgba(255,255,255,0.12);
}
.alert--unread td.trow1.alert__content a {
    font-weight: bold;
}
.af-aam-row-read {
    opacity: .4;
}
.trow1.alert__time .markReadAlertButton {font-weight: bold; color: green;padding-right: 15px;}
.trow1.alert__time .deleteAlertButton {font-weight: bold;color: red;padding-left: 15px;}
/* Глушим старый спрайт / псевдо-иконку на .alerts a:before,
 * которая тянет headerlinks_sprite.png и/или ставит content:'?'.
 * Для нашего колокольчика используем af-aam-alerts как маркер.
 */
.alerts.af-aam-alerts > a.myalerts:before,
.alerts.af-aam-alerts a.myalerts:before {
    content: '';
    background: none;
    width: 0;
    height: 0;
    display: none;
}
/* --- Глушим старый спрайт и "невидимость" текста именно для нашего колокольчика --- */

#header ul.menu li.alerts.af-aam-alerts > a.myalerts.af-aam-header-link,
#header ul.menu li.af-aam-alerts > a.myalerts.af-aam-header-link {
    background: none !important;
    background-image: none !important;
    text-indent: 0 !important;
    overflow: visible !important;
    width: auto !important;
    height: auto !important;
    padding-left: 6px;
    padding-right: 6px;
}

/* гарантируем, что сам значок виден и не наследует дичь от родителя */
.af-aam-header-link {
    font-size: 0; /* чтобы не дублировать текст, а работать только через span */
}

.af-aam-bell {
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    text-indent: 0;
    color: inherit;
}

.af-aam-list-actions {
    margin: 0 0 10px 0;
    text-align: right;
}
/* Toast-уведомления */

.af-aam-toast-container {
    position: fixed;
    right: 15px;
    bottom: 15px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
}

.af-aam-toast {
    min-width: 220px;
    max-width: 360px;
    background: #222;
    color: #eee;
    border-radius: 4px;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.6);
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #444;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s ease-out, transform .2s ease-out;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        'avatar header'
        'avatar body';
    column-gap: 8px;
}

.af-aam-toast.af-aam-toast-show {
    opacity: 1;
    transform: translateY(0);
}

.af-aam-toast-avatar {
    grid-area: avatar;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    align-self: center;
}

.af-aam-toast-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.af-aam-toast-header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.af-aam-toast-title {
    font-weight: bold;
    margin-bottom: 3px;
}

.af-aam-toast-text {
    font-size: 12px;
    grid-area: body;
}

.af-aam-toast-close {
    background: transparent;
    border: 0;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 4px;
}
.af-aam-toast-close:hover {
    color: #fff;
}

.af-aam-sound-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
}

.af-aam-sound-switch input {
    display: none;
}

.af-aam-sound-slider {
    position: relative;
    width: 30px;
    height: 10px;
    border-radius: 16px;
    background: #666;
    transition: background 0.2s ease;
}

.af-aam-sound-slider::before {
    content: "";
    position: absolute;
    top: 0px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.af-aam-sound-switch input:checked + .af-aam-sound-slider {
    background: #4caf50;
}

.af-aam-sound-switch input:checked + .af-aam-sound-slider::before {
    transform: translateX(16px);
}