:root {
    --dblue: #001e4b;
    --two: rgb(100 240 255);
    --white: #ffffff;
    --border-color: #ccc;
    --border-light: #818181;
    --border-radius: 4px;
    --box-shadow-light: 0 2px 4px rgba(0, 30, 75, 0.1);
    --box-shadow-dark: 2px 2px 10px rgba(0, 0, 0, 0.2);
    --chat-font-size: 14px;
    --font-family-base: 'Roboto Flex', sans-serif;
    --user-guest-color: #004b37;
    --user-registered-color: #00f;
    --quote-bg: rgba(230, 245, 235, 0.9);
    --quote-border-color: var(--cassiopeia-color-primary, #00d7ff);
    --clouds-opacity: 0.15;
    /* Реакции: день */
    --reaction-bg-day: rgb(0 0 0 / 15%);
    --reaction-border-day: rgb(251 251 251 / 50%);

    /* Реакции: ночь */
    --reaction-bg-night: rgb(255 255 255 / 20%);
    --reaction-border-night: rgba(255 255 255 / 25%);

    /* Активные (меняются JS) */
    --reaction-bg: var(--reaction-bg-day);
    --reaction-border: var(--reaction-border-day);
}

button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

button:focus-visible,
button:focus-visible {
    outline: 2px solid var(--two);
    outline-offset: 2px;
}

@font-face {
    font-family: "Nk-iconos";
    src: url("../fonts/Nk-iconos.woff2") format("woff2"),
        url("../fonts/Nk-iconos.ttf") format("truetype"),
        url("../fonts/Nk-iconos.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: block;
}
@font-palette-values --palette0 {
    font-family: "Nk-iconos";
    base-palette: 0;
}
.icon {
    /* Use !important to prevent extensions from overriding this font. */
    font-family: "Nk-iconos" !important;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;

    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.palette0 {
    font-palette: --palette0;
    color: currentColor;
}

.icon,
[class^="icon-"],
[class*=" icon-"] {
    font-family: "Nk-iconos" !important;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Новые коды — по пересобранному шрифту */
.icon-whatsapp:before { content: "\f000"; }
.icon-wallpaper:before { content: "\f001"; }
.icon-visibility_off:before { content: "\f002"; }
.icon-visibility_no:before { content: "\f003"; }
.icon-visibility_no_new:before { content: "\f004"; }
.icon-visibility_lock:before { content: "\f005"; }
.icon-user:before { content: "\f006"; }
.icon-tg:before { content: "\f007"; }
.icon-telegram:before { content: "\f008"; }
.icon-smile:before { content: "\f009"; }
.icon-send:before { content: "\f00a"; }
.icon-quote:before { content: "\f00b"; }
.icon-pm:before { content: "\f00c"; }
.icon-pm_chat:before { content: "\f00d"; }
.icon-palette:before { content: "\f00e"; }
.icon-notifications:before { content: "\f00f"; }
.icon-notifications_on:before { content: "\f010"; }
.icon-notifications_off:before { content: "\f011"; }
.icon-nk_logo:before { content: "\f012"; }
.icon-more_vert:before { content: "\f013"; }
.icon-max:before { content: "\f014"; }
.icon-logout:before { content: "\f015"; }
.icon-keyboard:before { content: "\f016"; }
.icon-important:before { content: "\f017"; }
.icon-history:before { content: "\f018"; }
.icon-group:before { content: "\f019"; }
.icon-file_open:before { content: "\f01a"; }
.icon-email:before { content: "\f01b"; }
.icon-edit:before { content: "\f01c"; }
.icon-crossed:before { content: "\f01d"; }
.icon-copy:before { content: "\f01e"; }
.icon-attach:before { content: "\f01f"; }
.icon-add:before { content: "\f020"; }
.icon-account_circle:before { content: "\f021"; }

/* В новом шрифте глифа crossed_old нет.
   Если в разметке где-то используется icon-crossed_old —
   скажи, подберём замену (например, visibility_no или crossed). */


/*ресет внутри чата*/
.com-content-article-edit,
.modal-editable,
[data-edit-url],
[data-edit-id] {
    display: none !important;
}

body {
    font-family: var(--font-family-base);
    font-weight: 400;
}

#nk-container ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.nk-chat-disabled-wrap {
    width: 100%;
    height: 663px;
    background-image: url(/components/com_newarkchat/assets/image/pause.webp);
    background-size: 100%;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nk-chat-disabled-message {
    position: relative;
    z-index: 2;
    background: rgb(0 0 0 / 75%);
    color: #f74444;
    font-size: 36px;
    padding: 60px 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 2px rgb(255 255 255 / 50%);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    border: 1px solid rgb(141 141 141 / 30%);
    backdrop-filter: blur(3px);
}

@media (max-width: 768px) {
    .nk-chat-disabled-wrap {
        width: 100%;
        height: 663px;
        background: none;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nk-chat-disabled-message {
        position: relative;
        z-index: 2;
        background: rgb(0 0 0 / 75%);
        color: #b3b3b3;
        font-size: clamp(10px, 4vw, 24px);
        padding: 60px 20px;
        border-radius: 10px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 2px rgb(255 255 255 / 50%);
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
        border: 1px solid rgb(141 141 141 / 30%);
        backdrop-filter: blur(3px);
    }
}

#nk-container strong {
    font-weight: 500;
    line-height: normal;
}

#nk-chat-messages>div>span>div>strong {
    font-style: normal;
    color: #000;
}

/*контейнер*/
#nk-container {
    background-image: url(/components/com_newarkchat/assets/image/bg.png);
    display: flex;
    background-size: 7px;
    flex-wrap: wrap;
    border-radius: var(--border-radius);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: var(--font-family-base);
    font-weight: 400;
}

#nk-wrap-users-msg {
    width: 100%;
    display: flex;
    max-height: 500px;
}

.wrap-nk-chat-messages {
    width: 100%;
    position: relative;
    border-radius: 3px;
    overflow: auto;
}

/*юзерлист*/
#nk-users {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f0f0f0;
    position: relative;
    max-width: min-content;
    border: 1px solid var(--two);
    border-radius: var(--border-radius);
    background-color: white;
    margin-right: 5px;
}

.title_user {
    color: var(--white);
    display: flex;
    width: 100%;
    background-color: var(--dblue);
    line-height: 1;
    font-size: 14px;
    font-weight: 600;
    align-items: center;
    justify-content: center;
    height: 25px;
}

#nk-users-list {
    flex-grow: 1;
    overflow-x: hidden;
    overflow-y: auto;
}

.nk-username {
    cursor: pointer;
}

#nk-users-list>li {
    font-size: var(--chat-font-size);
    background-color: rgb(213, 213, 213);
    border-top: 1px solid #fff;
    border-bottom: 1px solid #868686;
    margin-top: 0px;
    color: var(--user-guest-color);
    font-weight: 400;
    padding: 6px 6px;
    min-height: 15px;
    display: flex;
    transition: .3s;
    line-height: 1;
    flex-direction: column;
}

.nk-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #4e3636;
    font-size: 13px;
    font-style: italic;
}

span.nk-status-icon {
    font-size: calc(var(--chat-font-size) - 3px);
}

.nk-admin,
.nk-registered,
.nk-superadmin,
#nk-users-list>li.nk-admin,
#nk-users-list>li.nk-superadmin,
#nk-users-list>li.nk-registered {
    color: var(--user-registered-color);
}

.nk-guest {
    color: var(--user-guest-color);
}

.font-resize-block {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.font-resize {
    font-size: 18px;
    min-width: 2em;
    color: #000;
    border: 1px solid gray;
    background-color: #d5d5d5;
    padding: 2px 0;
    line-height: normal;
}

/*сообщения*/
#nk-chat-messages {
    position: relative;
    flex: 1;
    border: 1px solid var(--two);
    overflow-y: auto;
    scroll-behavior: smooth;
    border-radius: var(--border-radius);
    height: 500px;
}

#nk-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#nk-chat-messages::-webkit-scrollbar-track {
    border-radius: 4px;
    width: 6px;
}

#nk-chat-messages::-webkit-scrollbar-thumb {
    background: var(--dblue);
    border-radius: 4px;
    width: 6px;
}

#nk-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--two);
}

.nk-message {
    border-bottom: 1px solid #eee;
    z-index: 2;
    margin: 9px 5px;
    padding: 0 3px;
    position: relative;
    background-color: rgb(217, 217, 220);
    width: fit-content;
    border: 1px solid #d3d3d3;
    min-width: 200px !important;
    max-width: 90%;
    transition: width .3s ease-out !important;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 6px rgb(0 0 0 / 32%), 0 0 0 rgba(255, 255, 255, 0.42), inset 0 0 15px rgba(255, 255, 255, 0.97);
}

.nk-message.nk-new {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nk-message.nk-message-own {
    margin-left: auto;
    background-color: rgba(184, 202, 228, 0.95);
    border-color: rgba(0, 30, 75, 0.2);
    box-shadow: 0 2px 6px rgb(0 0 0 / 32%), 0 0 0 rgba(255, 255, 255, 0.42), inset 0 0 15px rgba(255, 255, 255, 0.97);
}

.nk-message-header {
    font-family: var(--font-family-base);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
    min-height: 17px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    line-height: 1;
    box-sizing: border-box;
}

#nk-chat-messages>div>div.nk-message-header>strong>span {
    font-size: 12px;
    margin: 0 3px 0 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.nk-message-actions {
    display: flex;
    padding: 1px 0;
}

.nk-message a {
    text-decoration: none;
    transition: opacity 0.2s;
}

.nk-message a:hover {
    opacity: 1;
}

.nk-mini-icon {
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 15px;
    padding: 0 5px;
    transition: 0.2s;
    cursor: pointer;
    box-sizing: border-box;
}

.nk-pm-messages-area>div>div>strong {
    line-height: 1;
}

.nk-mini-icon.icon-quote {
    padding: 0 5px 0 15px;
    font-size: 13px;
}

.nk-message .nk-mini-icon {
    opacity: 0.3;
    transition: opacity 0.2s ease;
    font-size: 11px;
    line-height: 1;
}

.nk-message:hover .nk-mini-icon {
    opacity: 1;
}

.nk-message-actions:has(.nk-mini-icon:hover) .nk-mini-icon:not(:hover) {
    opacity: 0.3;
}

.nk-message-actions .nk-mini-icon:hover {
    opacity: 1;
}

#nk-chat-messages>div>span {
    font-size: var(--chat-font-size);
    display: block;
    padding: 7px;
    border-radius: var(--border-radius);
    white-space: normal;
    word-break: break-word;
    background-color: var(--white);
    margin: 0 auto;
    line-height: normal;
}

img.nk-message-smile[alt^="stic_"] {
    display: block;
    margin: 5px 0;
}

.nk-shadow-message {
    filter: grayscale(1);
}

.nk-message-penitentiary {
    opacity: 0.85;
    filter: grayscale(0.8) brightness(0.8);
}

.nk-message-penitentiary .nk-username::before {
    content: '🍷';
}

.nk-edited-mark {
    font-size: 0.7em;
    color: #888;
    margin-right: auto;
    line-height: 1;
}

.nk-edit-textarea {
    resize: none;
    border-radius: var(--border-radius);
    border: 2px dotted #00ac1a;
    field-sizing: content;
}

.nk-save-edit,
.nk-cancel-edit {
    font-size: 16px;
    border-radius: var(--border-radius);
    border: 1px solid gray;
    display: inline-block;
    min-width: fit-content;
}

.nk-message-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 5px;
    min-height: 17px;
    gap: 8px;
    line-height: 1;
    box-sizing: border-box;
}

.nk-message-time {
    font-weight: 500;
    font-size: 12px;
}

/*счётчики*/
#nk-chat-counter {
    position: absolute;
    text-align: center;
    right: 5px;
    z-index: 3;
    top: 5px;
    background: rgb(255 0 0 / 75%);
    color: #fff;
    border-radius: 23px;
    padding: 2px 7px 0;
    line-height: 1.2;
    min-width: 20px;
    min-height: 23px;
    opacity: 0;
    transform: scale(0);
    transition: .3s, color .2s ease;
    pointer-events: none;
}

#nk-chat-counter.counter-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    cursor: pointer;
}

#nk-chat-counter.counter-active:hover {
    color: transparent;
}

#nk-chat-counter.counter-active:hover::after {
    opacity: 1;
    transform: translate(-7px, -5px);
}

#nk-chat-counter::after {
    content: '▼';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
}

#nk-last-message-block {
    position: absolute;
    color: #bdbdbd;
    z-index: 3;
    text-align: center;
    background: rgb(0 0 0 / 85%);
    padding: 2px 10px;
    border: 1px solid rgb(115 115 115);
    border-radius: 12px;
    left: 50%;
    transform: translateX(-50%);
    top: 40px;
    opacity: 0;
    transition: .3s;
    box-shadow: 0px 0px 10px #00000061;
}

/*инпут и тулбар*/
#nk-input-area {
    width: 100%;
    background-color: var(--white);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
}

#nk-message-input {
    font-size: var(--chat-font-size);
    flex: 1;
    width: 100%;
    field-sizing: content;
    min-height: 54px;
    max-height: 300px;
    overflow-y: auto;
    background-color: #fff;
    padding: 3px;
    margin: 0;
    transition: all 0.3s ease-in-out;
    box-shadow: none;
    border: none !important;
    resize: none;
    border-radius: 3px 0 0 3px !important;
    line-height: normal;
    will-change: transform;
}

#nk-message-input:focus-visible {
    outline: none;
}

.nk-inline {
    display: flex;
    width: 100%;
    align-items: flex-end;
    overflow: hidden;
}

#nk-send-button,
.nk-attach-img {
    height: 54px;
    width: 50px;
    padding: 0;
    border: none;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, opacity 0.2s ease, margin 0.3s ease;
}

#nk-send-button {
    margin-right: -40px;
}

#nk-send-button.send-visible {
    margin: 0;
}

.icon-add.nk-attach,
.icon-send.nk-send {
    font-size: 24px;
    display: block;
    transition: transform 0.3s ease;
}

.nk-attach-img .icon-add {
    transition: transform 0.3s ease;
}

.nk-attach-img:hover .icon-add {
    transform: scale(1.3);
}

.icon-send.nk-send:hover {
    transform: rotate(-90deg);
}

.icon-send.nk-send.send-fly {
    animation: flyToChat 0.6s ease-in-out forwards;
    transform: rotate(-90deg);
}

@keyframes flyToChat {
    0% {
        transform: rotate(-90deg) translate(-10px, 0);
        opacity: 1;
    }

    100% {
        transform: rotate(-90deg) translate(500px, 0);
        opacity: 0;
    }
}

.nk-toolbar-search {
    display: flex;
    column-gap: 10px;
}

#nk-chat-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background: rgb(255 255 255 / 10%);
    padding: 4px 12px;
    border-radius: var(--border-radius);
    border: 1px solid rgb(255 255 255 / 35%);
    backdrop-filter: blur(1px);
    position: relative;
    z-index: 100;
    user-select: none;
}

#nk-user-info {
    font-weight: bold;
    display: flex;
    gap: 10px;
    align-items: center;
    color: rgb(255 255 255 / 70%);
}

#nk-guest-name {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 4px 8px;
    font-size: 14px;
    background: transparent;
    color: rgb(255 255 255);
}

.nk-toolbar-btn {
    background: none;
    width: 37px;
    font-size: 18px;
    padding: 4px 8px 2px;
    border-radius: var(--border-radius);
    color: rgb(255 255 255 / 75%);
    line-height: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    transition: opacity 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.nk-toolbar-btn span {
    color: rgb(255 255 255 / 75%);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nk-toolbar-btn:hover {
    color: #fff;
}

.nk-toolbar-btn:hover span {
    color: #fff;
    text-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #fff,
        0 0 40px #fff;
}

#nk-toolbar-buttons {
    display: flex;
    gap: 8px;
    margin-left: 15px;
    position: relative;
}

.nk-toolbar-underline {
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 37px;
    height: 2px;
    background: #fff;
    box-shadow: 0px 0px 20px 3px #fff, 0 0px 20px #fff, 0 0 30px #fff, 0 0 50px 0px #fff;
    opacity: 0;
    transition: left 0.5s ease, opacity 0.5s ease;
    pointer-events: none;
    border-radius: 50%;
}

#nk-toolbar-buttons:hover .nk-toolbar-underline {
    opacity: 1;
}

#nk-chat-toolbar>div.nk-border-top,
#nk-chat-toolbar>div.nk-border-bottom {
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgb(255 255 255) 50%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#nk-chat-toolbar:hover>div.nk-border-top,
#nk-chat-toolbar:hover>div.nk-border-bottom {
    opacity: 1;
}

#nk-chat-toolbar>div.nk-border-bottom {
    bottom: 0;
}

#nk-search-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#nk-search-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#nk-search-btn:hover {
    opacity: 1;
}

#nk-search-box {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: var(--border-radius);
    border: 1px solid rgb(255 255 255 / 35%);
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(1px);
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
}

#nk-search-box.nk-search-open {
    transform: scaleX(1);
    opacity: 1;
    pointer-events: auto;
    background: rgb(255 255 255 / 20%);
    padding: 4px;
    border-radius: var(--border-radius);
    border: 1px solid rgb(255 255 255 / 35%);
    backdrop-filter: blur(1px);
}

#nk-search-input {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    width: 180px;
    outline: none;
}

#nk-search-input:focus {
    border-color: #00d7ff;
}

#nk-search-clear {
    background: none;
    border: none;
    font-size: 19px;
    cursor: pointer;
    color: rgb(255 255 255 / 50%);
    padding: 2px 4px;
}

#nk-search-clear:hover {
    color: rgb(255 255 255 / 100%);
}

/*превью цитаты/картинки/аудио*/
#nk-qoute-attach {
    display: flex;
    width: 100%;
    flex-direction: column;
}

.nk-quote-preview {
    background: #e8f6ed;
    border-left: 4px solid #00d7ff;
    font-size: var(--chat-font-size);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid gray;
    border-radius: 5px 7px 0 0;
}

.nk-pm-quote-preview.nk-quote-preview {
    width: 96.5%;
    margin: 5px 6px 0;
}

#nk-pm-window>div.nk-pm-quote-preview.nk-quote-preview>div>strong {
    font-weight: 500;
    margin-left: 10px;
}

.nk-quote-header {
    font-weight: bold;
    white-space: nowrap;
    margin-left: 10px;
}

.nk-quote-text {
    font-style: italic;
    color: rgb(70, 50, 30);
    word-break: break-word;
    flex: 1;
    margin-left: 10px;
}

.nk-audio-preview,
.nk-image-preview {
    display: flex;
    justify-content: space-between;
    width: 100%;
    border-bottom: 1px solid var(--dblue);
    align-items: center;
}

.nk-audio-name {
    margin-left: 10px;
}

.nk-pm-quote-remove,
.nk-audio-preview>button,
.nk-image-preview>button,
.nk-quote-remove {
    background: none;
    border: none;
    padding: 5px 10px 0;
    font-size: 18px;
    color: #980000;
}

.nk-quote-remove:hover {
    color: #000;
}

#nk-qoute-attach>div>img {
    width: 40px;
    padding: 1px 4px;
}

/*форматирование внутри сообщения*/
#nk-pm-window>div.nk-pm-messages-area>div>span>div,
#nk-chat-messages>div>span>div.nk-msg-quote,
noindex>div>table>tbody>tr>td.nk-history-msg>div {
    border-left: 4px solid var(--quote-border-color);
    line-height: 1.2;
    font-style: italic;
    font-size: calc(var(--chat-font-size) - 3px);
    z-index: 0;
    display: inline-block;
    top: -7px;
    color: rgb(130 110 20);
    background: var(--quote-bg);
    border-top: 1px solid rgba(0, 30, 75, 0.1);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 6px 35px 6px 12px;
    margin: 0 -7px;
    position: relative;
    width: calc(100% + 14px);
    box-sizing: border-box;
    cursor: alias;
}

#nk-pm-window>div.nk-pm-messages-area>div>span>div {
    width: calc(100% + 10px);
    margin: 0 -5px;
}

#nk-pm-window>div.nk-pm-messages-area>div>span>div::before,
#nk-chat-messages>div>span>div.nk-msg-quote::before {
    content: "\201C";
    color: var(--quote-border-color);
    font-size: 2rem;
    position: absolute;
    right: 12px;
    top: 0;
    opacity: 0.7;
    pointer-events: none;
}

.nk-msg-quote strong {
    font-size: 15px;
    display: inline-block;
}

img.nk-chat-image {
    max-width: 450px;
    display: block;
}

hr.nk-image-separator {
    margin: 5px 0 3px;
}

.nk-image-expired {
    color: rgb(117, 117, 117);
    font-size: 12px;
    font-style: italic;
    text-align: center;
    padding: 5px;
    background: rgb(245, 245, 245);
    border-radius: 4px;
}

.nk-image-expired::first-letter {
    font-style: normal;
}

.nk-spoiler {
    border-radius: 3px;
    color: transparent !important;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    background: url(/components/com_newarkchat/assets/image/tenor.webp);
    background-size: 16px;
    opacity: 0.5;
}

.nk-spoiler.nk-revealed {
    background: transparent !important;
    color: inherit !important;
    opacity: 1;
}

#nk-chat-messages>div>span.nk-message-ip {
    font-size: 1rem !important;
    text-align: center;
    cursor: copy;
}

/*зум картинки*/
.nk-image-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    cursor: zoom-out;
}

.nk-image-overlay-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

/*контекстное меню*/
#nk-context-menu {
    display: none;
    position: fixed;
    background: rgb(0 0 0 / 80%);
    border: 1px solid rgb(255 255 255 / 50%);
    box-shadow: 0 0 4px 2px var(--reaction-border);
    border-radius: 6px;
    z-index: 1000;
    padding: 0 5px;
    width: 160px;
}

#nk-context-menu .nk-context-menu-header {
    padding: 10px;
    font-weight: 500;
    border-radius: 4px 4px 0 0;
    color: var(--two);
    border-bottom: 1px solid #ccc;
}

#nk-context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#nk-context-menu li {
    padding: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 350;
    border-top: 1px solid #4b4b4b;
    color: #ccc;
    transition: .3s;
}

#nk-context-menu li:hover {
    background: rgb(75 75 75 / 80%);
    color: rgb(255 255 255);
    width: calc(100% + 10px);
    margin: 0 -5px;
}

#nk-context-ip {
    text-align: center;
    padding: 5px;
    color: #9f9f9f;
    border-top: 1px solid #595959;
    cursor: copy;
}

/*палитра*/
.nk-color-wrap {
    background: var(--white);
    border: 1px solid #ccc;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.31);
    padding: 10px;
    border-radius: var(--border-radius);
    max-width: 300px;
    margin: 0 0 0 -8em;
}

.nk-color-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.nk-color-option {
    display: block;
    width: 28px;
    padding-top: 100%;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.nk-color-button {
    display: flex;
    justify-content: space-evenly;
    gap: 10px;
}

.nk-color-action {
    font-size: 16px;
    margin-top: 6px;
    width: stretch;
    padding: 5px;
    border-radius: var(--border-radius);
    border: 1px solid gray;
    display: flex;
    justify-content: center;
    align-items: center;
}

/*смайлы*/
.smiles-modal {
    position: fixed;
    height: 437px;
    width: 424px;
    margin-top: 25px;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999999;
    visibility: hidden;
    display: flex;
    justify-content: center;
    pointer-events: none;
    /* Чтобы не мешала кликам, когда скрыта */
}

.smiles-modal.force-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.smile-overlay {
    background: #ededed;
    width: 92%;
    display: flex;
    border-radius: 5px;
    height: 405px;
    padding: 5px 0 0;
    justify-content: center;
    box-shadow: 0 0 25px 0 rgb(0 0 0 / 44%);
    flex-wrap: wrap;
}

.height {
    height: 350px;
    overflow-y: auto;
}

.height::-webkit-scrollbar {
    width: 6px;
}

.height::-webkit-scrollbar-thumb {
    background: var(--dblue);
    border-radius: 4px;
}

.tabs-header {
    width: 97%;
    height: 12%;
    display: flex;
    justify-content: space-around;
    flex-direction: row;
}

.tab-h {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    filter: brightness(0.9);
    cursor: pointer;
}

.tab-h.actives {
    filter: brightness(1.1);
    cursor: default;
    border-bottom: 4px inset var(--dblue);
    margin: 3px 0 0;
}

.tab-h[data-tab="0"] {
    background: url('/components/com_newarkchat/assets/image/s-1.png') center / 32px 32px no-repeat;
}

.tab-h[data-tab="1"] {
    background: url('/components/com_newarkchat/assets/image/s-2.png') center / 32px 32px no-repeat;
}

.tab-h[data-tab="2"] {
    background: url('/components/com_newarkchat/assets/image/s-3.png') center / 32px 32px no-repeat;
}

.tab-h[data-tab="3"] {
    background: url('/components/com_newarkchat/assets/image/s-4.png') center / 32px 32px no-repeat;
}

.tab-b {
    background: #fff;
    border-radius: 5px;
    margin: 5px;
    padding: 10px;
    overflow: auto;
    box-shadow: 0 0 2px 0 rgb(0 0 0 / 44%);
}

.smile-link {
    display: inline-block;
    margin: 4px;
    padding: 2px;
    border-radius: 6px;
    transition: 0.1s;
}

.smile-link:hover {
    background: #f0f2f5;
    transform: scale(1.05);
}

.chat-smile {
    display: block;
    max-height: 40px;
}

.nk-smile-separator {
    width: 100%;
    height: 1px;
    background: rgb(0 0 0 / 25%);
    margin: 8px 0;
}

/*прелоадер*/
.nk-preloader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
}

.preloader-5 {
    display: block;
    position: relative;
    width: 45px;
    height: 45px;
    margin: 30px auto;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgb(255, 0, 0);
    animation: preloader-5-spin 2s linear infinite;
}

.preloader-5::before,
.preloader-5::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.preloader-5::before {
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-top-color: var(--dblue);
    animation: preloader-5-spin 3s linear infinite;
}

.preloader-5::after {
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border-top-color: var(--two);
    animation: preloader-5-spin 1.5s linear infinite;
}

@keyframes preloader-5-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/*модалки*/
.nk-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}

.nk-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.nk-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.nk-modal-close:hover {
    color: #333;
}

.nk-modal-container,
.nk-ban-modal {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 5px;
    animation: nk-modal-in 0.2s ease-out;
}

.nk-modal-container {
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.nk-ban-modal {
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@keyframes nk-modal-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.nk-modal-header,
.nk-ban-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f5f5;
    border-radius: 5px 5px 0 0;
}

.nk-modal-title {
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

.nk-ban-modal-title {
    font-weight: bold;
    font-size: 18px;
}

.nk-ban-username {
    color: #d32f2f;
}

.nk-modal-content,
.nk-ban-modal-content {
    padding: 20px;
}

.nk-modal-content {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 5px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
}

.nk-modal-content.nk-bg {
    width: 100%;
}

.nk-status-current {
    text-align: center;
    margin-bottom: 15px;
}

.nk-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.nk-status-option {
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    background: #f5f5f5;
    text-align: center;
    min-width: 80px;
    transition: background 0.2s;
}

.nk-status-option:hover {
    background: #e8e8e8;
}

.nk-status-option.active {
    border: 2px solid #ff6b35;
}

.nk-status-icon {
    font-size: 24px;
}

.nk-status-label {
    font-size: 12px;
}

.nk-status-actions {
    text-align: center;
    margin-top: 15px;
}

.nk-status-clear {
    background: none;
    border: 1px solid #ccc;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.nk-modal-footer,
.nk-ban-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafafa;
    border-radius: 0 0 5px 5px;
}

.nk-modal-ok,
.nk-ban-submit,
.nk-ban-cancel {
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.nk-ban-body {
    padding: 20px;
}

.nk-ban-inputs {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nk-ban-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafafa;
    border-radius: 0 0 5px 5px;
}

.nk-ban-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.nk-ban-modal-close:hover {
    color: #333;
}

.nk-modal-ok {
    background: #4a90d9;
}

.nk-modal-ok:hover {
    background: #357abd;
}

.nk-ban-submit {
    background: #d32f2f;
    font-weight: 500;
}

.nk-ban-submit:hover:not(:disabled) {
    background: #b71c1c;
}

.nk-ban-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nk-ban-cancel {
    background: #999;
}

.nk-ban-cancel:hover {
    background: #777;
}

.nk-ban-field {
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.nk-ban-field label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.nk-ban-field input {
    width: 100%;
    padding: 10px 5px;
    text-align: center;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.nk-ban-field input:focus {
    outline: none;
    border-color: #4a90d9;
}

.nk-ban-preview {
    background: #f0f7ff;
    padding: 12px;
    border-radius: 5px;
    text-align: center;
    font-size: 13px;
    color: #555;
}

.nk-ban-preview strong {
    color: #2c7be5;
    font-size: 14px;
}

/*фон чата*/
.nk-bg-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nk-bg-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.nk-bg-option:hover {
    background: #e8f6ed;
    border-color: #4a90d9;
}

.nk-bg-light {
    background: #ffffff;
}

.nk-bg-dark {
    background: #1e1e2f;
}

.nk-bg-texture1 {
    background-image: url('/components/com_newarkchat/assets/image/bg.webp');
    background-size: 1%;
}

.nk-bg-texture2 {
    background-image: url('/components/com_newarkchat/assets/image/dark-honeycomb.webp');
    background-size: 50%;
}

.nk-bg-texture3 {
    background-image: url('/components/com_newarkchat/assets/image/embossed-diamond.png');
    background-size: 10%;
}

.nk-bg-texture4 {
    background-image: url('/components/com_newarkchat/assets/image/white_carbon.webp');
    background-size: 2%;
}

.nk-bg-texture5 {
    background-image: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)), url('/components/com_newarkchat/assets/image/alcoholic.webp');
    background-size: 30%;
    background-blend-mode: overlay;
}

/*доступ/readonly*/
.nk-access-denied,
.nk-readonly-notice {
    text-align: center;
    padding: 20px;
    width: stretch;
    background: #f8f9fa;
    border-radius: 5px;
    margin: 20px;
    display: flex;
}

.nk-access-denied p,
.nk-readonly-notice p {
    margin: 10px 0;
    font-size: 16px;
}

.nk-access-denied a,
.nk-readonly-notice a {
    color: #007bff;
    text-decoration: none;
}

.nk-access-denied a:hover,
.nk-readonly-notice a:hover {
    text-decoration: underline;
}

/*ЛС*/
.nk-toolbar-wrapper {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

#nk-pm-indicator {
    border-radius: 50%;
    opacity: 0;
    width: auto;
    visibility: hidden;
    transition: .3s;
}

#nk-pm-indicator.nk-pm-active {
    background: #fff;
    color: #c8c8c8;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 43px;
    opacity: 1;
    visibility: visible;
    cursor: pointer;
    transition: .3s;
}

#nk-pm-indicator.nk-pm-new {
    animation: nk-pm-pulse 1s infinite;
    width: auto;
    padding: 0 12px;
    border-radius: 20px;
    gap: 6px;
}

#nk-pm-indicator.nk-pm-new::before {
    content: 'Личка!';
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: .3s;
}

@keyframes nk-pm-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 1);
        background: #fff;
    }

    50% {
        box-shadow: 0 0 12px 6px rgba(255, 0, 0, 0.9);
        background: #ff0400;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 1);
        background: #fff;
    }
}

.nk-pm-window {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 350px;
    height: 450px;
    background: #1e1e2f;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    background-image: url(/components/com_newarkchat/assets/image/bg.webp);
    background-size: 7px;
}

.nk-pm-window-header {
    background: var(--dblue);
    color: #d5d5d5;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
}

.nk-pm-icon-settig-title {
    display: flex;
}

#nk-pm-window>div.nk-pm-window-header>div.nk-pm-icon-settig-title>i {
    padding: 3px 15px 3px 3px;
    cursor: pointer;
}

button.nk-pm-window-clear {
    padding: 0 10px 0 0;
    margin: 2px 0 0 0;
}

.nk-pm-window-title {
    font-weight: bold;
    font-size: 14px;
}

.nk-pm-window-buttons {
    display: flex;
    gap: 8px;
}

.nk-pm-window-buttons button {
    background: none;
    border: none;
    color: #ddd;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

.nk-pm-window-buttons button:hover {
    color: #ffaa66;
}

.nk-pm-tabs {
    display: flex;
    background: #2a2a3a;
    gap: 2px;
    overflow-x: auto;
    padding: 5px 5px 0;
}

.nk-pm-tab {
    background: #3a3a4a;
    color: #aaa;
    padding: 3px 5px 3px 10px;
    border: 1px solid #8a8a8a;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    display: flex;
    gap: 8px;
}

.nk-pm-tab.active {
    background: #606060;
    font-weight: bold;
    color: var(--two);
}

.nk-pm-tab.new {
    background: #4a2a2a;
    color: #ffaa66;
}

.nk-pm-tab.unread {
    background: #ff6b35;
    color: #fff;
}

.nk-pm-tab-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 13px;
    margin-bottom: -3px;
}

.nk-pm-messages-area {
    flex: 1;
    overflow-y: auto;
    margin: 0 6px;
    padding: 10px;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(180deg, rgb(105 234 255) 1%, rgb(196 246 255) 100%);
}

.nk-pm-message {
    background-color: rgb(217, 217, 220);
    width: fit-content;
    min-width: 40%;
    border-radius: 4px;
    padding: 0 3px;
    border: 1px solid #cecece;
    box-shadow: 0 0 6px rgb(0 0 0 / 40%), 0 0 0 rgba(255, 255, 255, 0.42), inset 0 0 15px rgba(255, 255, 255, 0.97);
}

.nk-pm-message.pm-own {
    background: rgba(184, 202, 228, 0.95);
    align-self: flex-end;
}

.nk-pm-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nk-pm-messages-area>div>div>strong {
    line-height: 1;
    font-weight: 400;
    font-size: 14px;
}

.nk-pm-quote-btn {
    height: min-content;
    line-height: 1;
}

#nk-pm-window>div.nk-pm-messages-area>div>strong {
    font-size: 13px;
    display: block;
    line-height: normal;
}

div.nk-pm-messages-area>div>span {
    display: block;
    background: #fff;
    border-radius: 3px;
    padding: 3px 5px;
    margin: 0 0 5px;
}

#nk-pm-window>div.nk-pm-messages-area>div>small {
    color: #000;
    display: flex;
    justify-content: flex-end;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    line-height: 0.8;
    font-weight: 600;
    font-size: 0.7em;
}

.nk-pm-input-area {
    display: flex;
    background: #fefefe;
    margin: 5px 6px 10px;
    border-radius: 4px;
}

.nk-pm-smiles-btn {
    display: flex;
    padding: 12px 10px;
    align-items: flex-end;
}

.nk-pm-input {
    flex: 1;
    border: none;
    border-radius: 3px;
    padding: 3px;
    color: #000;
    resize: none;
    field-sizing: content;
    min-height: 45px;
    max-height: 200px;
}

.nk-pm-send {
    display: flex;
    border-radius: 4px;
    padding: 10px 10px;
    z-index: 99999;
    align-items: flex-end;
}

.nk-pm-send:focus,
a:focus {
    outline: none;
    box-shadow: none;
}

.nk-pm-input:focus-visible {
    outline: none;
}

#nk-pm-window>div.nk-pm-input-area>button>img {
    height: 23px;
    width: 25px;
}

/* Прелоадер в окне ЛС */
.nk-pm-preloader {
    position: absolute;
    right: 50%;
    top: 92.5%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Переиспользуем анимацию точек из мобильного чата */
.nk-pm-preloader .nk-preloader-mobile {
    display: flex;
    gap: 5px;
    position: static;
}

.nk-pm-preloader .nk-preloader-mobile span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff0000;
    animation: nk-pm-dot-pulse 1.2s infinite ease-in-out;
}

.nk-pm-preloader .nk-preloader-mobile span:nth-child(2) {
    animation-delay: 0.2s;
}

.nk-pm-preloader .nk-preloader-mobile span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes nk-pm-dot-pulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/*настройки окна ЛС*/
.nk-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10010;
}

.nk-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.nk-settings-panel {
    position: relative;
    background: rgb(0 0 0 / 60%);
    border-radius: 6px;
    border: 2px solid rgb(255 255 255 / 20%);
    backdrop-filter: blur(5px);
    padding: 20px;
    width: 280px;
    color: #ddd;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.nk-settings-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #aaa;
}

.nk-settings-group {
    margin-bottom: 16px;
}

.nk-settings-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--two);
}

.nk-settings-buttons {
    display: flex;
    gap: 8px;
}

.nk-settings-buttons button {
    background: #1e1e2f;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #ddd;
}

.nk-settings-buttons button.active {
    background: #4a90d9;
    color: white;
}

.nk-settings-stepper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nk-settings-stepper button {
    background: #1e1e2f;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    color: #ddd;
}

.nk-settings-stepper span {
    min-width: 40px;
    text-align: center;
    font-size: 16px;
}

.nk-settings-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.nk-settings-actions button {
    background: #4a90d9;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    color: white;
}

/*история*/
.nk-history-container {
    max-width: 1200px;
    margin: 0 auto;
}

.nk-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.nk-history-back {
    background: var(--dblue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
}

#top>div.site-grid>div>main>div>div.nk-history-pagination.bottom>a.nk-history-back {
    margin-top: 20px;
}

.nk-history-pagination {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
}

.nk-history-pagination a {
    background: var(--dblue);
    text-decoration: none;
    color: #ddd;
    min-width: 45px;
    height: 30px;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nk-history-pagination a.active {
    background: var(--two);
    color: var(--dblue);
}

.nk-history-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 5px;
    overflow: hidden;
}

.nk-history-table th,
.nk-history-table td {
    background: #fff;
    padding: 10px;
    text-align: left;
    border: 1px solid #444;
}

.nk-history-table th {
    background: var(--dblue);
    color: #ddd;
}

.nk-history-time {
    white-space: nowrap;
    width: 120px;
}

.nk-history-msg {
    word-break: break-word;
}

/*небо*/
.the-interlayer {
    width: 100%;
    height: 100%;
    position: absolute;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.sky-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
    background-repeat: repeat-x;
    background-size: auto 100%;
    background-position: top center;
}

.sky-layer.night {
    background-image: url('/components/com_newarkchat/assets/image/sky/night.webp');
}

.sky-layer.dawn {
    background-image: url('/components/com_newarkchat/assets/image/sky/dawn.webp');
}

.sky-layer.morning {
    background-image: url('/components/com_newarkchat/assets/image/sky/morning.webp');
}

.sky-layer.day {
    background-image: url('/components/com_newarkchat/assets/image/sky/day.webp');
}

.sky-layer.dusk {
    background-image: url('/components/com_newarkchat/assets/image/sky/dusk.webp');
}

.sky-layer.sunset {
    background-image: url('/components/com_newarkchat/assets/image/sky/sunset.webp');
}

.sky-layer.night_start {
    background-image: url('/components/com_newarkchat/assets/image/sky/night.webp');
}

.sky-layer.active {
    z-index: 1;
}

#sun {
    position: absolute;
    top: 20px;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at center, #fff6bb 0%, #FFD54F 70%, rgba(255, 100, 50, 0) 95%);
    border-radius: 50%;
    box-shadow: 0 0 30px 10px rgba(255, 213, 79, 0.7), 0 0 60px 20px rgba(255, 100, 50, 0.4);
    z-index: 1;
    pointer-events: none;
    transition: background 1.5s ease-in-out, box-shadow 1.5s ease-in-out;
    opacity: 0;
}

#moon {
    position: absolute;
    z-index: 1;
    top: 40px;
    pointer-events: none;
    transform-origin: center center;
    filter: blur(1px) drop-shadow(0 0 5px #fcf1c1) drop-shadow(0 0 15px #fcf1c1) drop-shadow(0 0 25px #fcf1c1);
}

/* Дальние облака (самые медленные и маленькие) */
.sky-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background-image: url('/components/com_newarkchat/assets/image/sky/Clouds-1.webp');
    background-repeat: repeat-x;
    background-size: auto 200px;
    opacity: var(--clouds-opacity, 0.15);
    pointer-events: none;
    z-index: 4;
    animation: cloudsMoveFar 400s linear infinite;
}

/* Средние облака (через отдельный div) */
.clouds-mid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background-image: url('/components/com_newarkchat/assets/image/sky/Clouds-2.webp');
    background-repeat: repeat-x;
    background-size: auto 200px;
    opacity: var(--clouds-opacity, 0.15);
    pointer-events: none;
    z-index: 5;
    animation: cloudsMoveMid 300s linear infinite;
    animation-delay: 0.5s;
}

/* Ближние облака (самые быстрые и большие) */
.sky-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background-image: url('/components/com_newarkchat/assets/image/sky/Clouds-3.webp');
    background-repeat: repeat-x;
    background-size: auto 200px;
    opacity: var(--clouds-opacity, 0.15);
    pointer-events: none;
    z-index: 6;
    animation: cloudsMoveNear 200s linear infinite;
    animation-delay: 1s;
}

@keyframes cloudsMoveFar {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -3840px 0;
    }
}

@keyframes cloudsMoveMid {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -3840px 0;
    }
}

@keyframes cloudsMoveNear {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -3840px 0;
    }
}

@keyframes nkBorderRun {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

#stars-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
    z-index: 1;
}

/*аудио-плеер*/
.nk-audio-shell {
    display: flex;
    width: 20em;
    margin: 5px auto;
    padding: 15px 20px;
    border-radius: 15px;
    /* background: linear-gradient(0deg, rgb(0 206 255) 0%, rgb(0 37 255) 22%, rgb(0 7 50) 55%, rgb(1 198 255) 100%);
    border: 1px solid #33ffff; */
    position: relative;
    box-shadow: 0px 0px 9px #000000ba;
    align-items: center;
    outline: 2px solid #d3ffff;
    outline-offset: -7px;
    z-index: 0;
}

.nk-audio-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 15px;
    background: linear-gradient(0deg, rgb(0 206 255) 0%, rgb(0 37 255) 22%, rgb(0 7 50) 55%, rgb(1 198 255) 100%);
    border: 1px solid #33ffff;
    z-index: 0;
    pointer-events: none;
    outline: 2px solid #d3ffff;
    outline-offset: -7px;
}

.nk-audio-shell.nk-playing::before {
    animation: nkStrobeDouble 3s step-end infinite;
}

@keyframes nkStrobeDouble {
    0% {
        outline-color: #ff0400;
    }

    /* старт */
    5% {
        outline-color: #00ffff;
    }

    /* 1-я вспышка (0.05s) */
    10% {
        outline-color: #ff00ff;
    }

    /* погасла */
    15% {
        outline-color: #ffee00;
    }

    /* 2-я вспышка (0.1s) - сразу за первой */
    20% {
        outline-color: #ffee00;
    }

    /* погасла, пауза до 0.7s */
    70% {
        outline-color: #00ff00;
    }

    /* длинная вспышка */
    75% {
        outline-color: #00ff00;
    }

    85% {
        outline-color: #ffee00;
    }

    100% {
        outline-color: #ffee00;
    }
}

.nk-audio-shell.nk-playing::before {
    animation: nkStrobeDouble 3s step-end infinite;
}

@keyframes nkStrobeDouble {
    0% {
        outline-color: #ff0400;
    }

    /* старт */
    5% {
        outline-color: #00ffff;
    }

    /* 1-я вспышка (0.05s) */
    10% {
        outline-color: #ff00ff;
    }

    /* погасла */
    15% {
        outline-color: #ffee00;
    }

    /* 2-я вспышка (0.1s) - сразу за первой */
    20% {
        outline-color: #ffee00;
    }

    /* погасла, пауза до 0.7s */
    70% {
        outline-color: #00ff00;
    }

    /* длинная вспышка */
    75% {
        outline-color: #00ff00;
    }

    85% {
        outline-color: #ffee00;
    }

    100% {
        outline-color: #ffee00;
    }
}

/* 1. Регистрируем свойство для плавной анимации угла */
@property --nk-border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* 2. Бегущая рамка */
.nk-audio-shell.nk-playing::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 18px;
    padding: 3px;

    /* Крутим именно угол градиента */
    background: conic-gradient(from var(--nk-border-angle), #06ff00, #ff00ff, #ffe600, #f30cff, #06ff00);

    animation: nkBorderSpinAngle 4s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;

    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* 3. Ключевые кадры для угла */
@keyframes nkBorderSpinAngle {
    0% {
        --nk-border-angle: 0deg;
    }

    10% {
        --nk-border-angle: 180deg;
    }

    20% {
        --nk-border-angle: 0deg;
    }

    30% {
        --nk-border-angle: 360deg;
    }

    40% {
        --nk-border-angle: 180deg;
    }

    50% {
        --nk-border-angle: 0deg;
    }

    60% {
        --nk-border-angle: 90deg;
    }

    70% {
        --nk-border-angle: 270deg;
    }

    80% {
        --nk-border-angle: 180deg;
    }

    90% {
        --nk-border-angle: 0deg;
    }

    100% {
        --nk-border-angle: 0deg;
    }
}

.nk-audio-shell>* {
    position: relative;
    z-index: 2;
}

.nk-play-btn {
    width: 60px;
    height: 47px;
    margin: 0 15px 0 5px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 36%, rgb(0 209 255) 100%);
    border: 1px solid #a4fcff;
    color: #00ffff;
    box-shadow: 0 0 10px #d1ffff, 0 0 20px rgba(0, 255, 255, 0.7), inset 0 0 15px rgb(21 131 255), 0 0 9px rgba(0, 0, 0, 0.45);
    text-shadow: 0 0 4px #ffffff, 0 0 10px #00ffff, 0 0 20px #00ffff;
}

.nk-audio-shell.nk-playing .nk-play-btn {
    animation: nkPlayPulse 1.5s ease-in-out infinite;
}

@keyframes nkPlayPulse {

    0%,
    100% {
        box-shadow: 0 0 10px #d1ffff, 0 0 20px rgba(0, 255, 255, 0.7), inset 0 0 15px rgb(21 131 255), 0 0 9px rgba(0, 0, 0, 0.45);
    }

    50% {
        box-shadow: 0 0 20px #d1ffff, 0 0 40px rgba(0, 255, 255, 0.9), inset 0 0 25px rgb(21 131 255), 0 0 15px rgba(0, 0, 0, 0.6);
    }
}

.nk-player-tools {
    width: stretch;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nk-time {
    display: block;
    background: linear-gradient(0deg, rgb(0 0 0) 0%, rgb(3 3 3) 55%, rgb(145 145 145) 100%);
    text-align: center;
    padding: 3px 0 2px;
    color: #ffb800;
    border: 1px solid #95f4ff;
    border-radius: 4px;
    box-shadow: 0px 0px 4px #fff;
    font-weight: 600;
}

.nk-progress {
    appearance: none;
    width: 100%;
    height: 8px;
    overflow: hidden;
    background: #222;
    border: 1px solid #95f4ff;
    border-radius: 4px;
    box-shadow: 0px 0px 4px #fff;
}

.nk-progress::-webkit-progress-bar {
    background: linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(227, 227, 227, 1) 54%, rgba(0, 0, 0, 1) 100%);
    border-radius: 4px;
}

.nk-progress::-webkit-progress-value {
    background: linear-gradient(90deg, #ffb800, #00ffff);
    border-radius: 4px;
}

.nk-progress::-moz-progress-bar {
    background: linear-gradient(90deg, #ffb800, #00ffff);
    border-radius: 4px;
}

.nk-volume {
    appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(227, 227, 227, 1) 54%, rgba(0, 0, 0, 1) 100%);
    border-radius: 2px;
    outline: none;
}

.nk-volume::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ffff;
    cursor: pointer;
    box-shadow: 0 0 6px #00ffff;
}

#nk-chat-paused {
    position: absolute;
    top: 15em;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(0 0 0 / 75%);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 10;
    box-shadow: 0 0 8px var(--reaction-border);
    pointer-events: none;
    white-space: nowrap;
    animation: nkPausedPulse 2s ease-in-out infinite;
}

@keyframes nkPausedPulse {

    0%,
    100% {
        color: #ffffff3d;
    }

    50% {
        color: #fff;
    }
}

/*мобильная история*/
@media (max-width: 768px) {

    .nk-history-table,
    .nk-history-table tbody,
    .nk-history-table tr,
    .nk-history-table td {
        display: block;
        width: 100%;
    }

    .nk-history-table tr {
        margin-bottom: 15px;
        border: 1px solid #444;
        border-radius: 5px;
        overflow: hidden;
    }

    .nk-history-table td {
        border: none;
        border-bottom: 1px solid #eee;
        padding: 8px 12px;
        text-align: left;
        background: #fff;
    }

    .nk-history-table td:last-child {
        border-bottom: none;
    }

    .nk-history-table th {
        display: none;
    }

    .nk-history-time {
        width: auto;
        white-space: normal;
    }
}

/* Поиск на странице истории */
.nk-history-search {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nk-history-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.nk-history-search-input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.nk-history-search-input:focus {
    border-color: var(--two);
}

.nk-history-search-reset {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    display: none;
}

#nk-history-search-reset {
    color: #830202;
    font-size: 20px;
    display: block;
    line-height: normal;
}

.nk-history-search-reset:hover {
    color: #333;
}

/* Тумблер */
.nk-history-search-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    position: relative;
}

.nk-history-search-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nk-toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 22px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.nk-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.nk-history-search-toggle input:checked~.nk-toggle-slider {
    background: var(--two);
}

.nk-history-search-toggle input:checked~.nk-toggle-slider::after {
    transform: translateX(18px);
}

.nk-toggle-label {
    color: #333;
}

/* Кнопка "Найти" */
.nk-history-search-btn {
    padding: 8px 20px;
    background: var(--dblue, #001e4b);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.nk-history-search-btn:hover {
    opacity: 0.85;
}

/* Панель реакций — кружок справа от сообщения */
/* Скрываем панель реакций у своих сообщений */
.nk-message.nk-message-own .nk-reaction-picker {
    display: none;
}

.nk-message.nk-message-own .nk-reaction-overlay {
    display: none;
}

.nk-reaction-overlay {
    position: absolute;
    right: -52px;
    bottom: -10px;
    width: 53px;
    height: 50px;
    z-index: 5;
}

.nk-reaction-overlay:hover {
    height: 190px;
}

.nk-reaction-overlay:hover .nk-reaction-picker {
    height: 170px;
    border-radius: 20px;
    opacity: 1;
    padding: 5px;
}

.nk-reaction-picker {
    position: absolute;
    bottom: 10px;
    right: 12px;
    width: 33px;
    height: 33px;
    padding: 3px;
    border-radius: 30px;
    background: var(--reaction-bg);
    border: 1px solid rgb(0 0 0 / 20%);
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transition: 0.3s ease;
    z-index: 5;
    overflow: auto;
    overscroll-behavior: contain;
    box-shadow: 0 0 2px #fff;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 5px 1px var(--reaction-border-day);
}

.nk-message:hover .nk-reaction-picker { opacity: 1; }

.nk-reaction-picker::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Первая видимая кнопка — круглый триггер (когда панель свёрнута) */
.nk-reaction-picker .nk-reaction-btn:last-child {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Когда панель раскрыта — все кнопки одинаковые, не сжимаются */
.nk-reaction-picker:hover .nk-reaction-btn {
    width: 28px;
    height: 28px;
}

.nk-reaction-btn {
    background: none;
    border: none;
    font-size: 15px;
    line-height: 1;
    padding: 4px;
    transition: transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nk-reaction-btn:hover {
    transform: scale(1.25);
}

.nk-reaction-chip {
    background: rgba(91, 121, 173, 0.85);
    border-radius: 25px;
    border: 1px solid var(--reaction-border);
    padding: 0 7px;
    margin-left: 10px;
    width: 50px;
}

.nk-reaction-chip:hover {
    background: rgba(91, 121, 173, 0.99);
}

/* Твоя реакция — выделена */
.nk-reactions-list {
    margin-bottom: 9px;
}

.nk-reaction-chip.nk-reaction-mine {
    background: rgba(130 130 130 / 30%);
    border: 1px solid rgba(255 255 255 / 50%);
    border-radius: 30px;
    margin-left: 10px;
}

.nk-reaction-chip.nk-reaction-mine:hover {
    background: rgba(0, 215, 255, 0.25);
}

/* Счётчик внутри чипа */
.nk-reaction-count {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    min-width: 12px;
    text-align: center;
}

.nk-reaction-chip.nk-reaction-mine .nk-reaction-count {
    color: #fff;
}

/* Состояние "загрузка" (пока AJAX идёт) */
.nk-reaction-chip.nk-reaction-pending,
.nk-reaction-btn.nk-reaction-pending {
    opacity: 0.5;
    pointer-events: none;
}

.nk-message-own+.nk-reactions-list {
    justify-content: flex-end;
    display: flex;
    padding-right: 5px;
}