.chat-system {
    display: none;
    height: calc(100dvh - var(--nav-height) - 5rem - 1.5rem);
}

.chat-system .chat-nav-action {
    display: flex;
    outline: none;
    text-align: start;
    border: 0;
    font-size: .8rem;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(var(--dark-inverted-color), 0.03);
    border-top: 1px solid rgba(var(--dark-inverted-color), 0.03);
    background: transparent;
    padding: .75rem;
    margin: 0;
    position: relative;
    width: 100%;
}

.chat-system .tab-nav {
    max-width: 300px;
    width: 100%;
}

.chat-system .chat-nav-action:hover,
.chat-system .chat-nav-action.active {
    background-color: rgba(var(--dark-inverted-color), 0.03);
}

.chat-system .chat-nav-action.active {
    border-left-color: rgba(var(--primary-color));
}

.chat-system .tab-content>.active {
    display: flex !important;
    flex-direction: column;
}

.chat-system .chat-message {
    display: flex;
    padding: 1rem;
    height: 100%;
}

.chat-system .chat-message .message-user {
    position: relative;
    display: inline-block;
    height: 1.75rem;
    width: 1.75rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
    margin-right: .5rem;
}

.chat-system .chat-message .message-user img {
    -o-object-fit: cover;
    object-fit: cover;
    width: 100%;
    height: 100%;
    border-radius: 100%;
}

.chat-system .chat-message .message-wrapper {
    width: 100%;
    display: flex;
}

.chat-system .chat-message.sender .message-wrapper {
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

.chat-system .chat-message .message-container {
    width: 100%;
}

.chat-system .chat-message .message-body {
    display: flex;
}

.chat-system .chat-message.sender .message-body {
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.chat-system .chat-message .message-box {
    display: inline-block;
    border-radius: var(--bs-border-radius);
    color: rgba(var(--dark-inverted-color), 100%);
    background-color: rgba(var(--bs-secondary-rgb), 25%);
    font-size: 0.83rem;
    line-height: 1.7;
    padding: .5rem;
    max-width: calc(100% - 5rem);
    white-space: pre-line;
}

.chat-system .chat-message.sender .message-box {
    background-color: rgba(var(--primary-color), 25%);
}

.chat-system .chat-message .message-timestamp {
    display: block;
    margin-top: .25rem;
    color: rgba(var(--dark-inverted-color), 50%);
    font-size: 0.65rem;
    text-align: start;
}

.chat-system .chat-message.sender .message-timestamp {
    text-align: end;
}

.chat-system .chat-messages-wrapper {
    position: relative;
    overflow-y: scroll;
    overflow-x: hidden;
    height: 100%;
}

.chat-system .chat-messages {}

.input-wrap{
    padding: .5rem 0 .5rem .5rem;
    position: relative;
    display: flex;
    max-height: 180px;
    overflow-x: hidden;
    overflow-y: scroll;
    transition: box-shadow var(--transition) ease-in-out;
}

.chat-editor-area:focus-within{
    box-shadow: 0 0 0 2px rgba(88,101,242,.25);
}

textarea{
    flex: 1 1 auto;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    padding: .4rem;
    font-size: 0.833333rem;
}

.chat-system .chat-buttons-sticky {
    position: sticky;
    top: 0;
}

.chat-system .chat-button {
    user-select: none;
    background: none;
    border: 0;
    outline: none;
    padding: .5rem;
    line-height: 1;
    font-size: 1rem;
    scale: 1;
    transition: scale var(--transition) ease-in-out;
}

.chat-system .chat-button.active,
.chat-system .chat-button:not(:disabled):hover {
    scale: 1.2;
}

.chat-button-send-emoji.active {
    pointer-events: none;
}

.chat-system .chat-files {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 1rem .75rem 0 .75rem;
    gap: .75rem;
    overflow-y: hidden;
    overflow-x: scroll;
}

.chat-system .chat-files:empty {
    display: none;
}

.chat-system .chat-file-card {
    max-height: 200px;
    max-width: 200px;
    min-height: 200px;
    min-width: 200px;
    position: relative;
    padding: 8px;
    display: inline-flex;
    flex-direction: column;
    margin: 0;
    border-radius: var(--bs-border-radius);
    background-color: rgba(var(--dark-inverted-color), 0.05);
}

.chat-system .chat-file-card .icon {
    max-height: 150px;
    text-align: center;
    margin: auto;
}

.chat-system .chat-file-card .icon img {
    height: 100%;
    width: 100%;
    object-fit: contain;
}

.chat-system .chat-file-card .text {
    font-size: .7rem;
    padding-top: .5rem;
}

.chat-system .chat-file-card .actions {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: rgba(var(--card-color), 100%);
    border-radius: var(--bs-border-radius);
}

.chat-system .actions-wrapper {
    display: flex;
    background-color: rgba(var(--dark-inverted-color), 0.15);
    border-radius: var(--bs-border-radius);
}

.chat-system .chat-file-action {
    padding: .35rem .5rem;
    background-color: transparent;
    border: 0;
    outline: none;
    line-height: 1;
}

.chat-file-action:hover {
    background-color: rgba(var(--dark-inverted-color), 0.05);
}

.chat-system .chat-file-action.chat-file-delete {
    color: rgba(var(--bs-danger-rgb));
}

.scroll-detector {
    opacity: 0;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    transition: opacity var(--transition) ease-in-out;
}

.scroll-detector[data-scroll="true"] {
    opacity: 1;
}

.scroll-detector .action {
    position: absolute;
    bottom: .5rem;
    display: none;
    align-items: center;
    gap: .5rem;
    border: 1px solid transparent;
    background-color: rgba(var(--dark-inverted-color), 0.05);
    padding: .5rem .75rem;
    line-height: 1;
    border-radius: var(--bs-border-radius);
    transition: border-color var(--transition) ease-in-out;
    cursor: pointer;
}

.scroll-detector[data-scroll="true"] .action {
    display: flex;
}

.scroll-detector .action:hover {
    border-color: rgba(var(--primary-color));
}

.scroll-detector .action .text {}

.scroll-detector .action .icon {
    font-size: 1.3rem;
}

.chat-avatar img {
    outline: 2px solid rgba(var(--bs-danger-rgb), 50%);
    outline-offset: 2px;
    position: relative;
}

[data-online="true"] .chat-avatar img {
    outline-color: rgba(var(--bs-success-rgb), 50%);
}

@media screen and (max-width: 768px) {
    .chat-system .tab-nav {
        max-width: min-content !important;
    }
}