/* Header #RAU + notes list + toasts */

#RAU {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 15px;
    background: var(--color-panel-bg, #313131);
    border-bottom: 1px solid #373737;
    padding: 0px 10px 0px 20px;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    flex: 0 0 52px;
    box-sizing: border-box;
    /* visible: dropdowns (#RAU_notes_panel и др.) не должны клипаться и уходить под #RADR */
    overflow: visible;
    position: relative;
    z-index: 50;
}

@media (max-width: 900px) {
    #RAU {
        flex: 0 0 auto;
        height: auto;
        max-height: none;
        min-height: calc(52px + env(safe-area-inset-top, 0px));
    }
}

#RAU_title {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    text-align: left;
    font-size: 105%;
    font-weight: bold;
    max-width: 50%;
    overflow: hidden;
    position: relative;
    padding-right: 35px;
}

#RAU_title:after {
    content: '';
    display: block;
    width: 35px;
    height: 100%;
    background-image: linear-gradient(to right, transparent, var(--color-panel-bg, #313131));
    position: absolute;
    right: 0;
    top: 0;
    z-index: 0;
    pointer-events: none;
}

#RAU_descr {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    text-align: left;
    overflow: hidden;
    position: relative;
    margin-left: -25px;
}

#RAU_descr:after {
    content: '';
    display: block;
    width: 50px;
    height: 100%;
    background-image: linear-gradient(to right, transparent, var(--color-panel-bg, #313131));
    position: absolute;
    right: 0;
    top: 0;
    z-index: 0;
    pointer-events: none;
}

#RAU_options {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

#RAU_options > [id^="RAU_option-"] {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    --btn-icon-size: 60%;
    background-size: var(--btn-icon-size);
    cursor: pointer;
    box-sizing: border-box;
    transition: background-size 0.06s ease;
}

#RAU_alerts {
    position: relative;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    z-index: 3;
    display: none !important;
}

#RAU_option-alerts {
    background-image: url('../../ico/bt/notifications.svg');
}

#RAU_option-notes {
    background-image: url('../../ico/bt/notifications.svg');
}

#RAU_option-mentions {
    background-image: url('../../ico/bt/alternate-email.svg');
}

.rau_badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #c45c5c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 2;
}

#RAU_pins_badge.is-all-seen {
    background: #5d5d5d;
}

#RAU_notes,
#RAU_mentions,
#RAU_pins,
#RAU_friend_notes {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

#RAU_alerts #RAU_option-alerts {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    --btn-icon-size: 60%;
    background-size: var(--btn-icon-size);
    cursor: pointer;
    box-sizing: border-box;
    transition: background-size 0.06s ease;
}

#RAU_notes[open="1"],
#RAU_mentions[open="1"],
#RAU_pins[open="1"],
#RAU_friend_notes[open="1"] {
    z-index: 20001;
}

#RAU_pins[hidden] {
    display: none !important;
}

#RAU_notes #RAU_option-notes,
#RAU_mentions #RAU_option-mentions,
#RAU_pins #RAU_option-pin,
#RAU_friend_notes #RAU_option-members {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    --btn-icon-size: 60%;
    background-size: var(--btn-icon-size);
    cursor: pointer;
    box-sizing: border-box;
    transition: background-size 0.06s ease;
}

#RAU_dropdown_panels {
    display: contents;
}

#RAU_alerts_panel {
    display: none;
    position: relative;
    box-sizing: border-box;
    background-color: var(--color-null-element-bg-opacity);
    backdrop-filter: blur(8px);
    border: 1px solid var(--color-null-element-border);
    border-radius: 12px;
    box-shadow: 0 0 30px 2px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    flex-direction: column;
    z-index: 50010;
}

#RAU_notes_panel,
#RAU_mentions_panel,
#RAU_pins_panel,
#RAU_friend_notes_panel {
    display: none;
    position: fixed;
    width: min(320px, 78vw);
    max-height: 360px;
    box-sizing: border-box;
    background-color: var(--color-null-element-bg-opacity);
    backdrop-filter: blur(8px);
    border: 1px solid var(--color-null-element-border);
    border-radius: 12px;
    box-shadow: 0 0px 30px 2px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    flex-direction: column;
    z-index: 50010;
}

#RAU_alerts_panel.is-ported.is-open {
    display: flex;
}

#RAU_notes_panel.is-ported.is-open,
#RAU_mentions_panel.is-ported.is-open,
#RAU_pins_panel.is-ported.is-open,
#RAU_friend_notes_panel.is-ported.is-open {
    display: flex;
}

.rau_alerts_tabs {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--color-null-element-border);
    margin-bottom: 4px;
}

.rau_alerts_tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 8px 6px;
    border: 1px solid var(--color-null-element-border);
    border-radius: 10px;
    background: var(--color-null-element-bg);
    color: var(--color-ui-text);
    font: inherit;
    font-size: 82%;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-sizing: border-box;
}

.rau_alerts_tab.is-active {
    border-color: var(--color-btn-hover-border);
    background: var(--color-btn-bg);
}

.rau_alerts_tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rau_alerts_tab .rau_alerts_tab-badge {
    position: static;
    flex: 0 0 auto;
    top: auto;
    right: auto;
}

.rau_alerts_panes {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

@media (max-width: 500px) {
#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes > #RAU_notes_panel,
#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes > #RAU_mentions_panel,
#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes > #RAU_friend_notes_panel {
    display: none;
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
    max-height: none;
    height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes > #RAU_notes_panel.is-active,
#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes > #RAU_mentions_panel.is-active,
#RAU_alerts_panel.is-ported.is-open .rau_alerts_panes > #RAU_friend_notes_panel.is-active {
    display: flex !important;
}
}

#RAU_notes_list,
#RAU_mentions_list,
#RAU_pins_list,
#RAU_friend_notes_list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 280px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 0;
}

#RAU_notes_footer,
#RAU_mentions_footer,
#RAU_pins_footer,
#RAU_friend_notes_footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid var(--color-null-element-border);
    background: rgba(0, 0, 0, 0.12);
}

.rau_panel-btn {
    flex: 1 1 auto;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--color-null-element-border);
    border-radius: 8px;
    background: var(--color-btn-bg);
    color: var(--color-btn-text);
    font: inherit;
    font-size: 85%;
    cursor: pointer;
}

.rau_panel-btn:hover {
    border-color: var(--color-btn-hover-border);
    background-color: var(--color-btn-hover-bg);
}

.rau_panel-btn:disabled,
.rau_panel-btn[aria-disabled="true"] {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.rau_panel-btn:disabled:hover,
.rau_panel-btn[aria-disabled="true"]:hover {
    border-color: var(--color-null-element-border);
    background: var(--color-btn-bg);
}

.rau_panel-btn--ghost:disabled:hover,
.rau_panel-btn--ghost[aria-disabled="true"]:hover {
    background: transparent;
}

.rau_panel-btn--ghost {
    background: transparent;
    opacity: 0.9;
}

.rau_panel-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.06);
}

.rau_panel-btn--icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    background-image: url('../../ico/bt/settings.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 58%;
    color: transparent;
    font-size: 0;
}

#RAU_notes_list .ifm_note_item,
#RAU_mentions_list .ifm_note_item,
#RAU_friend_notes_list .ifm_note_item,
#RAU_pins_list .ifm_pin_item {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: default;
}

#RAU_pins_list .ifm_pin_item {
    cursor: pointer;
}

#RAU_pins_list .ifm_pin_item:hover {
    background: rgba(255, 255, 255, 0.06);
}

#RAU_notes_list .ifm_note_item,
#RAU_mentions_list .ifm_note_item,
#RAU_friend_notes_list .ifm_note_item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

#RAU_mentions_list .ifm_note_item {
    cursor: pointer;
}

#RAU_mentions_list .ifm_note_item:hover {
    background: rgba(255, 255, 255, 0.06);
}

#RAU_notes_list .ifm_note_item.is-clickable,
#RAU_friend_notes_list .ifm_note_item.is-clickable {
    cursor: pointer;
}

#RAU_notes_list .ifm_note_item.is-clickable:hover,
#RAU_friend_notes_list .ifm_note_item.is-clickable:hover {
    background: rgba(255, 255, 255, 0.06);
}

#RAU_notes_list .ifm_note_main,
#RAU_mentions_list .ifm_note_main,
#RAU_friend_notes_list .ifm_note_main {
    flex: 1 1 auto;
    min-width: 0;
}

#RAU_notes_list .ifm_note_delete,
#RAU_mentions_list .ifm_note_delete,
#RAU_friend_notes_list .ifm_note_delete {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    margin: -2px -4px 0 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background-color: transparent;
    background-image: url('../../ico/bt/delete.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 58%;
    cursor: pointer;
    opacity: 0.55;
}

#RAU_notes_list .ifm_note_delete:hover,
#RAU_mentions_list .ifm_note_delete:hover,
#RAU_friend_notes_list .ifm_note_delete:hover {
    opacity: 1;
    border-color: var(--color-null-element-border);
    background-color: rgba(255, 255, 255, 0.06);
}

#RAU_friend_notes_list .ifm_note_actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

#RAU_friend_notes_list .ifm_note_accept,
#RAU_friend_notes_list .ifm_note_decline {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 0;
    height: 28px;
    margin: 0;
    padding: 0 8px 0 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: 6px center;
    background-size: 14px 14px;
    cursor: pointer;
    opacity: 0.85;
    color: inherit;
    font: inherit;
    font-size: 80%;
    line-height: 1;
    white-space: nowrap;
}

#RAU_friend_notes_list .ifm_note_accept {
    background-image: url('../../ico/bt/check.svg');
    padding-left: 24px;
}

#RAU_friend_notes_list .ifm_note_decline {
    background-image: url('../../ico/bt/close.svg');
    padding-left: 24px;
}

#RAU_friend_notes_list .ifm_note_act-label {
    display: inline-block;
}

#RAU_friend_notes_list .ifm_note_accept:hover,
#RAU_friend_notes_list .ifm_note_decline:hover {
    opacity: 1;
    border-color: var(--color-null-element-border);
    background-color: rgba(255, 255, 255, 0.06);
}

#RAU_notes_list .ifm_note_item.is-deleting,
#RAU_mentions_list .ifm_note_item.is-deleting,
#RAU_friend_notes_list .ifm_note_item.is-deleting {
    opacity: 0.45;
    pointer-events: none;
}

#RAU_notes_list .ifm_note_item.is-unread,
#RAU_mentions_list .ifm_note_item.is-unread,
#RAU_friend_notes_list .ifm_note_item.is-unread,
#RAU_pins_list .ifm_pin_item.is-unread {
    background: rgba(255, 255, 255, 0.04);
}

#RAU_notes_list .ifm_note_item.is-unread .ifm_note_title,
#RAU_mentions_list .ifm_note_item.is-unread .ifm_note_title,
#RAU_friend_notes_list .ifm_note_item.is-unread .ifm_note_title,
#RAU_pins_list .ifm_pin_item.is-unread .ifm_pin_body {
    color: #eee;
    opacity: 1;
    font-weight: 600;
}

#RAU_notes_list .ifm_note_item:last-child,
#RAU_mentions_list .ifm_note_item:last-child,
#RAU_friend_notes_list .ifm_note_item:last-child,
#RAU_pins_list .ifm_pin_item:last-child {
    border-bottom: none;
}

#RAU_notes_list .ifm_note_kind,
#RAU_mentions_list .ifm_note_kind,
#RAU_friend_notes_list .ifm_note_kind {
    font-size: 75%;
    opacity: 0.65;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#RAU_notes_list .ifm_note_item[data-kind="3"] .ifm_note_kind {
    color: #e8a0a0;
    opacity: 0.95;
}

#RAU_notes_list .ifm_note_title,
#RAU_mentions_list .ifm_note_title,
#RAU_friend_notes_list .ifm_note_title {
    font-size: 90%;
    color: #d0d0d0;
    font-weight: 600;
    line-height: 1.3;
}

#RAU_notes_list .ifm_note_body,
#RAU_mentions_list .ifm_note_body,
#RAU_friend_notes_list .ifm_note_body,
#RAU_pins_list .ifm_pin_body {
    margin-top: 4px;
    font-size: 85%;
    line-height: 1.35;
    opacity: 0.85;
    white-space: pre-wrap;
    word-break: break-word;
}

#RAU_notes_list .ifm_note_empty,
#RAU_notes_list .ifm_note_loading,
#RAU_mentions_list .ifm_note_empty,
#RAU_mentions_list .ifm_note_loading,
#RAU_friend_notes_list .ifm_note_empty,
#RAU_friend_notes_list .ifm_note_loading,
#RAU_pins_list .ifm_note_empty,
#RAU_pins_list .ifm_note_loading {
    padding: 16px 14px;
    font-size: 85%;
    opacity: 0.7;
    text-align: center;
}

#IFM_toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    /* Выше IFM_user_settings и прочих модалок (50000). */
    z-index: 60000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: min(310px, calc(100vw - 32px));
    pointer-events: none;
}

#IFM_toasts .ifm_toast {
    position: relative;
    pointer-events: auto;
    width: 100%;
    padding: 12px 34px 12px 14px;
    box-sizing: border-box;
    background: #3a3a3a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    color: #d8d8d8;
    animation: ifm_toast_in 0.22s ease-out;
}

#IFM_toasts .ifm_toast.is-clickable {
    cursor: pointer;
}

#IFM_toasts .ifm_toast-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    background-image: url('../../ico/bt/close.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 70%;
    cursor: pointer;
    opacity: 0.65;
}

#IFM_toasts .ifm_toast-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.08);
}

#IFM_toasts .ifm_toast[data-kind="3"] {
    border-color: rgba(200, 90, 90, 0.55);
    background: #4a2e2e;
}

#IFM_toasts .ifm_toast-kind {
    font-size: 70%;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.7;
    margin-bottom: 4px;
}

#IFM_toasts .ifm_toast[data-kind="3"] .ifm_toast-kind {
    color: #f0b0b0;
    opacity: 1;
}

#IFM_toasts .ifm_toast-title {
    font-size: 90%;
    font-weight: 600;
    line-height: 1.3;
}

#IFM_toasts .ifm_toast-body {
    margin-top: 4px;
    font-size: 85%;
    line-height: 1.35;
    opacity: 0.9;
    white-space: pre-wrap;
    word-break: break-word;
}

#IFM_toasts .ifm_toast.is-leaving {
    animation: ifm_toast_out 0.2s ease-in forwards;
}

@keyframes ifm_toast_in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ifm_toast_out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(6px); }
}

#RAU_option-pin {
    background-image: url('../../ico/bt/push-pin.svg');
}

#RAU_option-members {
    background-image: url('../../ico/bt/people.svg');
}

#RAU_market_favorites {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#RAU_market_favorites #RAU_option-market-favorites {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: transparent;
    background-image: url('../../ico/bt/star-outline.svg');
    background-repeat: no-repeat;
    background-position: center;
    --btn-icon-size: 60%;
    background-size: var(--btn-icon-size);
    cursor: pointer;
    box-sizing: border-box;
    transition: background-size 0.06s ease;
}

#RAU_search {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#RAU_search #RAU_option-search {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: transparent;
    background-image: url('../../ico/bt/search.svg');
    background-repeat: no-repeat;
    background-position: center;
    --btn-icon-size: 60%;
    background-size: var(--btn-icon-size);
    cursor: pointer;
    box-sizing: border-box;
    transition: background-size 0.06s ease;
}

#RAU_nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    max-width: none;
}

#RAU_search_overlay {
    position: fixed;
    inset: 0;
    z-index: 25000;
    pointer-events: none;
}

#RAU_search_overlay[hidden] {
    display: none !important;
}

#RAU_search_overlay.is-open {
    pointer-events: auto;
}

.RAU_search_overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    transition: opacity 0.2s ease;
}

#RAU_search_overlay.is-open .RAU_search_overlay-backdrop {
    opacity: 1;
}

.RAU_search_overlay-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 10px;
    border: 0;
    border-bottom: 1px solid var(--color-null-element-border);
    background: var(--color-panel-bg, #313131);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
    transform: translateY(-110%);
    transition: transform 0.22s ease;
}

#RAU_search_overlay.is-open .RAU_search_overlay-panel {
    transform: translateY(0);
}

#RAU_nav-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--color-null-element-border);
    border-radius: 10px;
    background-color: var(--color-null-element-bg);
    color: var(--color-null-element-text);
    font: inherit;
    font-size: 100%;
    outline: none;
    box-sizing: border-box;
}

#RAU_nav-search-input:focus {
    border-color: var(--color-btn-hover-border);
}

#RAU_nav-search-input::placeholder {
    color: var(--color-null-element-text);
    opacity: 0.28;
}

#RAU_nav-search-input::-webkit-search-decoration,
#RAU_nav-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

#RAU_nav-search-bt,
#RAU_search_overlay-close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    border: 1px solid transparent;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    --btn-icon-size: 55%;
    background-size: var(--btn-icon-size);
    cursor: pointer;
    box-sizing: border-box;
    transition: background-size 0.06s ease;
}

#RAU_nav-search-bt {
    background-image: url(../../ico/bt/search.svg);
}

#RAU_search_overlay-close {
    background-image: url(../../ico/bt/close.svg);
    --btn-icon-size: 48%;
}

#RAU_nav-help {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: transparent;
    background-image: url('../../ico/bt/help.svg');
    background-repeat: no-repeat;
    background-position: center;
    --btn-icon-size: 60%;
    background-size: var(--btn-icon-size);
    cursor: pointer;
    box-sizing: border-box;
    transition: background-size 0.06s ease;
}
