/* Fallen Kingdom global chat */

.fk-chat-notification {
    position: relative;
}

.fk-chat-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    margin-left: auto;
    padding: 0 5px;
    border: 1px solid rgba(255, 226, 132, .8);
    border-radius: 999px;
    color: #1a1007;
    background: #f6c75c;
    box-shadow: 0 0 14px rgba(246, 199, 92, .8);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

@keyframes fk-chat-blink {
    0%, 100% {
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(246, 199, 92, 0);
    }
    45% {
        filter: brightness(1.7);
        box-shadow: 0 0 20px rgba(246, 199, 92, .85);
    }
    55% {
        filter: brightness(.85);
    }
}

.fk-chat-notification.has-chat-unread {
    animation: fk-chat-blink 1.05s steps(2, end) infinite;
    border-color: rgba(246, 199, 92, .9) !important;
}

.fk-chat-widget {
    position: fixed;
    right: 18px;
    bottom: 20px;
    z-index: 2950;
    pointer-events: none;
}

body.has-mobile-bottom-menu .fk-chat-widget {
    bottom: 86px;
}

.fk-chat-launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 1px solid rgba(235, 185, 83, .7);
    border-radius: 50%;
    color: #fff2cc;
    background: radial-gradient(circle at 30% 24%, #167b82, #0a454b 62%, #082d31);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(255, 255, 255, .05);
    cursor: pointer;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

.fk-chat-launcher-icon {
    font-size: 27px;
    line-height: 1;
}

.fk-chat-launcher .fk-chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    margin: 0;
}

.fk-chat-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: min(390px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid rgba(212, 160, 70, .75);
    border-radius: 16px;
    background: rgba(20, 14, 10, .985);
    box-shadow: 0 20px 56px rgba(0, 0, 0, .72);
    pointer-events: auto;
}

.fk-chat-panel[hidden] {
    display: none !important;
}

.fk-chat-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid rgba(212, 160, 70, .3);
    background: linear-gradient(180deg, rgba(82, 53, 25, .96), rgba(39, 25, 15, .96));
}

.fk-chat-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.fk-chat-panel-title strong {
    color: #f0cf86;
}

.fk-chat-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fk-chat-panel-actions a,
.fk-chat-panel-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid rgba(215, 164, 75, .45);
    border-radius: 8px;
    color: #f3d594;
    background: rgba(0, 0, 0, .25);
    text-decoration: none;
    cursor: pointer;
}

.fk-chat-panel-actions button {
    width: 32px;
    padding: 0;
    font-size: 19px;
}

/* The moderation shortcut belongs to the movable mobile chat panel only. */
.fk-chat-mobile-moderate {
    display: none !important;
}

.fk-chat-surface {
    display: grid;
    gap: 0;
    min-width: 0;
}

.fk-chat-page-card {
    overflow: visible;
}

.fk-chat-page-surface {
    overflow: hidden;
    border: 1px solid rgba(128, 86, 39, .82);
    border-radius: 14px;
    background: rgba(10, 8, 7, .48);
}

.fk-chat-state {
    min-height: 27px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(128, 86, 39, .38);
    color: #bda987;
    background: rgba(0, 0, 0, .18);
    font-size: 12px;
}

.fk-chat-state.is-warning {
    color: #ffd889;
    background: rgba(104, 65, 14, .28);
}

.fk-chat-state.is-error {
    color: #ffabab;
    background: rgba(108, 25, 25, .28);
}

.fk-chat-messages {
    height: 330px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 10px;
    background:
        radial-gradient(circle at 100% 0%, rgba(13, 91, 96, .11), transparent 36%),
        rgba(8, 7, 6, .82);
}

.fk-chat-page-surface .fk-chat-messages {
    height: min(62vh, 650px);
    min-height: 360px;
}

.fk-chat-loading,
.fk-chat-empty {
    display: flex;
    min-height: 100%;
    align-items: center;
    justify-content: center;
    color: #9f9078;
    text-align: center;
}

.fk-chat-message {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 5px 4px;
}

.fk-chat-message + .fk-chat-message {
    margin-top: 1px;
}

.fk-chat-message-avatar-link {
    display: block;
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border-radius: 9px;
    line-height: 0;
    text-decoration: none;
}

.fk-chat-message-avatar-link .fk-chat-message-avatar {
    margin-top: 0;
}

.fk-chat-message-avatar-link:hover .fk-chat-message-avatar,
.fk-chat-message-avatar-link:focus-visible .fk-chat-message-avatar {
    border-color: rgba(240, 207, 134, .88);
    box-shadow: 0 0 0 2px rgba(240, 207, 134, .12), 0 2px 8px rgba(0, 0, 0, .35);
}

.fk-chat-message-avatar {
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border: 1px solid rgba(220, 172, 82, .42);
    border-radius: 9px;
    object-fit: cover;
    background: #17120e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.fk-chat-message-content {
    min-width: 0;
    padding: 7px 9px 8px;
    border: 1px solid rgba(151, 109, 52, .2);
    border-radius: 5px 12px 12px 12px;
    background: rgba(43, 38, 36, .82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.fk-chat-message.is-admin .fk-chat-message-content {
    border-left-color: rgba(255, 91, 91, .62);
}

.fk-chat-message.is-moderator .fk-chat-message-content {
    border-left-color: rgba(255, 164, 45, .65);
}

.fk-chat-message-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    margin-bottom: 3px;
}

.fk-chat-message-user {
    overflow: hidden;
    max-width: 58%;
    color: #ecd08c;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fk-chat-message-user[href] {
    text-decoration: none;
}

.fk-chat-message-user[href]:hover,
.fk-chat-message-user[href]:focus-visible {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fk-chat-message-time {
    margin-left: auto;
    color: #887a67;
    font-size: 10px;
    white-space: nowrap;
}

.fk-chat-role-tag {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 6px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: #f5ead8;
    background: rgba(255, 255, 255, .08);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.fk-chat-message.is-admin .fk-chat-role-tag {
    border-color: rgba(255, 75, 75, .5);
    color: #ffaaaa;
    background: rgba(139, 24, 24, .3);
}

.fk-chat-message.is-moderator .fk-chat-role-tag {
    border-color: rgba(255, 159, 28, .5);
    color: #ffc47d;
    background: rgba(128, 67, 10, .3);
}

.fk-chat-message-body {
    color: #eee2cf;
    line-height: 1.32;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.fk-chat-message-link {
    color: #e8c987;
    text-decoration: underline;
    text-decoration-color: rgba(232, 201, 135, .55);
    text-underline-offset: 2px;
    cursor: pointer;
}

.fk-chat-message-link:hover,
.fk-chat-message-link:focus-visible {
    color: #ffe1a0;
    text-decoration-color: currentColor;
}

.fk-chat-emoji-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    /* Keep the horizontal scrollbar visually separated from the emoji row. */
    padding: 1px 1px 11px;
    scrollbar-width: thin;
}

.fk-chat-emoji {
    flex: 0 0 auto;
    min-width: 30px !important;
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0 !important;
    border: 1px solid transparent;
    border-radius: 7px;
    color: inherit;
    background: transparent;
    box-shadow: none;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.fk-chat-emoji:hover,
.fk-chat-emoji:focus-visible {
    border-color: rgba(235, 185, 83, .45);
    background: rgba(235, 185, 83, .1);
}

.fk-chat-composer {
    display: grid;
    gap: 7px;
    padding: 10px;
    border-top: 1px solid rgba(128, 86, 39, .45);
    background: rgba(31, 21, 13, .96);
}

.fk-chat-composer-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.fk-chat-composer textarea {
    width: 100%;
    min-height: 48px;
    max-height: 110px;
    resize: vertical;
    box-sizing: border-box;
    margin: 0;
}

.fk-chat-composer textarea:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.fk-chat-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.fk-chat-counter {
    color: #958570;
    font-size: 11px;
}

.fk-chat-composer button {
    min-width: 88px;
}

.fk-chat-error {
    padding: 7px 9px;
    border: 1px solid rgba(180, 55, 55, .5);
    border-radius: 8px;
    color: #ffb0b0;
    background: rgba(116, 28, 28, .28);
    font-size: 12px;
}

.fk-chat-admin-link {
    margin: 12px 0 0;
}

.fk-chat-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.fk-chat-admin-form {
    display: grid;
    gap: 12px;
}

.fk-chat-admin-form label:not(.fk-chat-check-row) {
    display: grid;
    gap: 5px;
}

.fk-chat-check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(126, 85, 38, .42);
    border-radius: 10px;
    background: rgba(0, 0, 0, .16);
}

.fk-chat-check-row input {
    width: auto;
    margin-top: 3px;
}

.fk-chat-check-row span {
    display: grid;
    gap: 2px;
}

.fk-chat-check-row small {
    color: #9d8f78;
}

.fk-chat-danger-card {
    border-color: rgba(151, 54, 54, .55) !important;
}

.fk-chat-admin-message-list,
.fk-chat-admin-mutes {
    display: grid;
    gap: 10px;
}

.fk-chat-admin-message,
.fk-chat-admin-mutes article {
    padding: 11px;
    border: 1px solid rgba(126, 85, 38, .45);
    border-radius: 10px;
    background: rgba(0, 0, 0, .18);
}

.fk-chat-admin-message-head,
.fk-chat-admin-mutes article {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.fk-chat-admin-message-head small,
.fk-chat-admin-mutes small {
    display: block;
    margin-top: 3px;
    color: #958570;
}

.fk-chat-admin-message > p,
.fk-chat-admin-mutes p {
    margin: 8px 0;
    overflow-wrap: anywhere;
}

.fk-chat-admin-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.fk-chat-admin-actions form {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.fk-chat-admin-actions input,
.fk-chat-admin-actions select {
    min-width: 0;
    margin: 0;
}

.fk-chat-log-wrap {
    overflow-x: auto;
}

.fk-chat-log-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.fk-chat-log-table th,
.fk-chat-log-table td {
    padding: 8px;
    border: 1px solid rgba(126, 85, 38, .45);
    text-align: left;
    vertical-align: top;
}

.mobile-bottom-menu .fk-chat-unread-badge {
    position: absolute;
    top: 3px;
    right: 8px;
    margin: 0;
}

@media (max-width: 900px) {
    .fk-chat-admin-grid,
    .fk-chat-admin-actions {
        grid-template-columns: 1fr;
    }

    .fk-chat-admin-actions form {
        flex-wrap: wrap;
    }

    .fk-chat-admin-actions input {
        flex: 1 1 180px;
    }
}

@media (max-width: 760px) {
    .fk-chat-widget {
        right: 12px;
        bottom: 74px;
    }

    body.has-mobile-bottom-menu .fk-chat-widget {
        bottom: 78px;
    }

    .fk-chat-launcher {
        width: 54px;
        height: 54px;
    }

    .fk-chat-panel {
        position: fixed;
        left: 7px;
        right: 7px;
        bottom: 7px;
        width: auto;
        max-height: calc(100dvh - 14px);
        border-radius: 14px;
    }

    body.has-mobile-bottom-menu .fk-chat-panel {
        bottom: 72px;
        max-height: calc(100dvh - 79px);
    }

    .fk-chat-mobile-moderate {
        display: inline-flex !important;
    }

    .fk-chat-panel-head {
        gap: 6px;
    }

    .fk-chat-panel-actions {
        gap: 5px;
    }

    .fk-chat-panel-actions a {
        padding-inline: 8px;
        white-space: nowrap;
    }

    .fk-chat-panel .fk-chat-messages {
        height: min(46dvh, 390px);
    }

    .fk-chat-page-surface .fk-chat-messages {
        height: 55dvh;
        min-height: 300px;
    }

    .fk-chat-admin-mutes article {
        display: grid;
    }
}

@media (max-width: 430px) {
    .fk-chat-messages {
        padding: 7px;
    }

    .fk-chat-message {
        grid-template-columns: 31px minmax(0, 1fr);
        gap: 6px;
    }

    .fk-chat-message-avatar {
        width: 31px;
        height: 31px;
        border-radius: 8px;
    }

    .fk-chat-message-content {
        padding: 6px 8px 7px;
    }

    .fk-chat-message-user {
        max-width: 54%;
        font-size: 12px;
    }

    .fk-chat-role-tag {
        padding-inline: 4px;
        font-size: 8px;
    }

    .fk-chat-message-time {
        font-size: 9px;
    }

    .fk-chat-emoji {
        min-width: 28px !important;
        width: 28px;
        height: 28px;
        min-height: 28px;
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fk-chat-notification.has-chat-unread {
        animation: none;
        outline: 2px solid #f6c75c;
        outline-offset: 2px;
    }
}

/* Patch 72.4: visible Forum/Chat Moderator controls */
.fk-chat-moderator-tools {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(320px, 1.2fr);
    gap: 18px;
    align-items: start;
}

.fk-chat-direct-mute-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.fk-chat-direct-mute-form button {
    min-height: 42px;
}

.fk-chat-inline-note {
    margin: 0 0 12px;
}

.fk-chat-admin-actions .fk-chat-action-card {
    display: grid;
    grid-template-columns: minmax(110px, auto) minmax(130px, 1fr) auto;
    gap: 7px;
    align-items: center;
    padding: 9px;
    border: 1px solid rgba(151, 109, 52, .34);
    border-radius: 9px;
    background: rgba(0, 0, 0, .2);
}

.fk-chat-admin-actions .fk-chat-action-card strong {
    color: #e9c778;
    font-size: 12px;
}

.fk-chat-admin-actions .fk-chat-action-card select,
.fk-chat-admin-actions .fk-chat-action-card input {
    width: 100%;
}

.fk-chat-protected {
    margin: 9px 0 0;
    padding: 7px 9px;
    border: 1px solid rgba(151, 109, 52, .25);
    border-radius: 8px;
    color: #9f9078;
    background: rgba(0, 0, 0, .14);
    font-size: 12px;
}

@media (max-width: 900px) {
    .fk-chat-moderator-tools,
    .fk-chat-direct-mute-form {
        grid-template-columns: 1fr;
    }

    .fk-chat-admin-actions .fk-chat-action-card {
        grid-template-columns: 1fr;
    }

    .fk-chat-admin-actions .fk-chat-action-card button {
        width: 100%;
    }
}


/* Chat / Marketplace split feed */
.fk-chat-panel-tabs {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.fk-chat-panel-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid rgba(215, 164, 75, .35);
    border-radius: 9px;
    color: #cbb98f;
    background: rgba(0, 0, 0, .18);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.fk-chat-panel-tab:hover,
.fk-chat-panel-tab:focus-visible {
    color: #ffe2a2;
    border-color: rgba(235, 185, 83, .68);
}

.fk-chat-panel-tab.is-active {
    color: #f5d994;
    border-color: rgba(235, 185, 83, .76);
    background: linear-gradient(180deg, rgba(111, 73, 28, .74), rgba(60, 38, 18, .76));
    box-shadow: inset 0 0 0 1px rgba(255, 225, 158, .06);
}

.fk-chat-panel-tab.has-market-unread,
.fk-chat-panel-tab.has-friend-unread {
    border-color: rgba(246, 199, 92, .82);
}

.fk-chat-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    color: #241609;
    background: #f6c75c;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.fk-chat-tab-badge[hidden] {
    display: none !important;
}

.fk-chat-panel [data-chat-view][hidden] {
    display: none !important;
}

.fk-chat-panel-actions [hidden] {
    display: none !important;
}

.fk-market-feed {
    height: 440px;
    padding: 9px;
    background:
        radial-gradient(circle at 100% 0%, rgba(143, 95, 26, .10), transparent 35%),
        rgba(8, 7, 6, .84);
}

.fk-market-feed-card {
    display: block;
    margin: 0 0 9px;
    padding: 10px;
    border: 1px solid rgba(151, 109, 52, .38);
    border-radius: 10px;
    color: #eee2cf;
    background: rgba(33, 23, 14, .72);
    text-decoration: none;
}

.fk-market-feed-card:last-child {
    margin-bottom: 0;
}

a.fk-market-feed-card:hover,
a.fk-market-feed-card:focus-visible {
    border-color: rgba(235, 185, 83, .78);
    background: rgba(58, 39, 19, .82);
    box-shadow: inset 0 0 0 1px rgba(235, 185, 83, .10);
}

.fk-market-feed-card.is-inactive {
    opacity: .68;
}

.fk-market-feed-head {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.fk-market-feed-user {
    overflow: hidden;
    max-width: 52%;
    color: #d9f47c;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fk-market-feed-number {
    color: #d6b66d;
    font-size: 11px;
    font-weight: 800;
}

.fk-market-feed-time {
    margin-left: auto;
    color: #887a67;
    font-size: 10px;
    white-space: nowrap;
}

.fk-market-feed-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0 8px;
}

.fk-market-feed-badge {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 6px;
    border: 1px solid rgba(215, 164, 75, .36);
    border-radius: 999px;
    color: #ead7ad;
    background: rgba(0, 0, 0, .22);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.fk-market-feed-badge.is-buy {
    color: #a8e9ef;
    border-color: rgba(67, 162, 171, .48);
}

.fk-market-feed-badge.is-sell {
    color: #f1d38b;
    border-color: rgba(201, 151, 64, .52);
}

.fk-market-feed-badge.is-status-completed,
.fk-market-feed-badge.is-status-cancelled {
    color: #aaa092;
    border-color: rgba(150, 138, 120, .34);
}

.fk-market-feed-trade {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.fk-market-feed-side {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    padding: 7px;
    border: 1px solid rgba(151, 109, 52, .22);
    border-radius: 8px;
    background: rgba(0, 0, 0, .17);
}

.fk-market-feed-side-title {
    color: #bca477;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.fk-market-feed-line {
    display: grid;
    gap: 1px;
    min-width: 0;
    padding-top: 4px;
    border-top: 1px solid rgba(151, 109, 52, .13);
}

.fk-market-feed-line:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.fk-market-feed-line small {
    color: #837763;
    font-size: 9px;
    text-transform: uppercase;
}

.fk-market-feed-line strong {
    color: #eadfc9;
    font-size: 11px;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.fk-market-feed-line.is-empty {
    color: #877b68;
    font-size: 11px;
}

.fk-market-feed-card-footer {
    margin-top: 8px;
    color: #c9aa68;
    font-size: 10px;
    font-weight: 800;
    text-align: right;
}

.fk-market-feed-footer {
    display: flex;
    justify-content: flex-end;
    padding: 9px 10px;
    border-top: 1px solid rgba(128, 86, 39, .45);
    background: rgba(31, 21, 13, .96);
}

.fk-market-feed-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(215, 164, 75, .45);
    border-radius: 8px;
    color: #f3d594;
    background: rgba(0, 0, 0, .25);
    text-decoration: none;
}

@media (max-width: 760px) {
    .fk-chat-panel-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .fk-chat-panel-tabs {
        flex: 1 1 auto;
    }

    .fk-chat-panel-tab {
        min-height: 32px;
        padding-inline: 9px;
    }

    .fk-chat-panel-actions {
        margin-left: auto;
    }

    .fk-chat-panel .fk-market-feed {
        height: min(58dvh, 470px);
    }

    .fk-market-feed-trade {
        grid-template-columns: 1fr;
    }
}


/* Friends tab / private chat */
.fk-friend-chat-list-screen,
.fk-friend-chat-thread-screen {
    min-height: 0;
}

.fk-friend-chat-list {
    height: 418px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 7px;
    background: rgba(8, 7, 6, .82);
}

.fk-friend-chat-contact {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding: 7px 8px;
    border: 0;
    border-bottom: 1px solid rgba(151, 109, 52, .18);
    border-radius: 8px;
    color: #e8dbc7;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.fk-friend-chat-contact:hover,
.fk-friend-chat-contact:focus-visible {
    background: rgba(202, 148, 58, .10);
    outline: 1px solid rgba(220, 172, 82, .26);
}

.fk-friend-chat-avatar-wrap {
    position: relative;
    display: block;
    width: 42px;
    height: 42px;
}

.fk-friend-chat-avatar,
.fk-friend-chat-head-avatar {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(220, 172, 82, .42);
    border-radius: 50%;
    object-fit: cover;
    background: #17120e;
}

.fk-friend-chat-online {
    position: absolute;
    right: -1px;
    bottom: 0;
    width: 10px;
    height: 10px;
    border: 2px solid #16110d;
    border-radius: 50%;
    background: #6c655a;
}

.fk-friend-chat-online.is-online {
    background: #39d86d;
    box-shadow: 0 0 6px rgba(57, 216, 109, .62);
}

.fk-friend-chat-contact-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.fk-friend-chat-contact-head {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.fk-friend-chat-contact-head strong {
    overflow: hidden;
    color: #ecc86f;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fk-friend-chat-contact-head small {
    margin-left: auto;
    color: #847866;
    font-size: 9px;
    white-space: nowrap;
}

.fk-friend-chat-preview {
    overflow: hidden;
    color: #a99b87;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fk-friend-chat-contact-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    color: #201506;
    background: #f4bf48;
    font-size: 10px;
    font-weight: 900;
}

.fk-friend-chat-thread-head {
    display: grid;
    grid-template-columns: 34px 38px minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
    min-height: 56px;
    padding: 7px 9px;
    border-bottom: 1px solid rgba(128, 86, 39, .38);
    background: rgba(0, 0, 0, .16);
}

.fk-friend-chat-back,
.fk-friend-chat-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 7px;
    border: 1px solid rgba(215, 164, 75, .36);
    border-radius: 8px;
    color: #e9ca88;
    background: rgba(0, 0, 0, .20);
    text-decoration: none;
    cursor: pointer;
}

.fk-friend-chat-back {
    width: 34px;
    padding: 0;
    font-size: 21px;
}

.fk-friend-chat-head-avatar {
    width: 38px;
    height: 38px;
}

.fk-friend-chat-head-copy {
    display: grid;
    min-width: 0;
}

.fk-friend-chat-head-copy strong {
    overflow: hidden;
    color: #f0ca6e;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fk-friend-chat-head-copy span {
    color: #958775;
    font-size: 10px;
}

.fk-friend-chat-profile {
    font-size: 10px;
}

.fk-chat-messages.fk-friend-chat-messages {
    height: 278px;
    padding: 10px 8px;
}

.fk-friend-chat-message {
    display: flex;
    justify-content: flex-start;
    margin: 5px 0;
}

.fk-friend-chat-message.is-own {
    justify-content: flex-end;
}

.fk-friend-chat-bubble {
    max-width: 82%;
    padding: 7px 9px 5px;
    border: 1px solid rgba(151, 109, 52, .20);
    border-radius: 5px 12px 12px 12px;
    background: rgba(43, 38, 36, .86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.fk-friend-chat-message.is-own .fk-friend-chat-bubble {
    border-color: rgba(211, 160, 71, .32);
    border-radius: 12px 5px 12px 12px;
    background: rgba(94, 62, 26, .60);
}

.fk-friend-chat-body {
    color: #eee2cf;
    line-height: 1.32;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.fk-friend-chat-time {
    display: block;
    margin-top: 3px;
    color: #817565;
    font-size: 9px;
    text-align: right;
}

.fk-friend-chat-composer {
    padding-top: 7px;
}

@media (max-width: 760px) {
    .fk-friend-chat-list {
        height: calc(100dvh - 198px);
        min-height: 250px;
    }

    .fk-chat-messages.fk-friend-chat-messages {
        height: calc(100dvh - 329px);
        min-height: 210px;
    }

    .fk-friend-chat-profile {
        padding-inline: 6px;
    }
}


/* Clickable player profiles in chat */
.fk-friend-chat-head-profile-link {
    display: inline-flex;
    flex: 0 0 auto;
    border-radius: 9px;
    line-height: 0;
    text-decoration: none;
}

.fk-friend-chat-head-profile-link:hover .fk-friend-chat-head-avatar,
.fk-friend-chat-head-profile-link:focus-visible .fk-friend-chat-head-avatar {
    border-color: rgba(240, 207, 134, .88);
}

.fk-friend-chat-head-name {
    color: inherit;
    font-weight: 900;
    text-decoration: none;
}

.fk-friend-chat-head-name:hover,
.fk-friend-chat-head-name:focus-visible {
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* Desktop right-side chat drawer */
@media (min-width: 901px) {
    body.fk-chat-dock-open {
        overflow-x: hidden;
    }

    .fk-chat-widget.is-docked {
        position: fixed;
        inset: 0 0 0 auto;
        width: 0;
        height: 100dvh;
        z-index: 4200;
        pointer-events: none;
    }

    .fk-chat-widget.is-docked .fk-chat-launcher {
        display: none !important;
    }

    .fk-chat-widget.is-docked .fk-chat-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        display: flex;
        flex-direction: column;
        width: min(440px, 42vw);
        max-width: 440px;
        height: 100dvh;
        max-height: none;
        overflow: hidden;
        border-width: 0 0 0 1px;
        border-radius: 0;
        background: rgba(18, 18, 21, .995);
        box-shadow: -18px 0 46px rgba(0, 0, 0, .58);
        pointer-events: auto;
    }

    .fk-chat-widget.is-docked .fk-chat-panel-head {
        flex: 0 0 auto;
        min-height: 54px;
        padding: 10px 11px;
        background: linear-gradient(180deg, #222127, #17171b);
    }

    .fk-chat-widget.is-docked [data-chat-view] {
        flex: 1 1 auto;
        min-height: 0;
    }

    .fk-chat-widget.is-docked [data-chat-view="chat"],
    .fk-chat-widget.is-docked [data-chat-view="market"],
    .fk-chat-widget.is-docked [data-chat-view="friends"] {
        display: flex;
        flex-direction: column;
    }

    .fk-chat-widget.is-docked [data-chat-view][hidden] {
        display: none !important;
    }

    .fk-chat-widget.is-docked .fk-chat-state {
        flex: 0 0 auto;
    }

    .fk-chat-widget.is-docked .fk-chat-messages,
    .fk-chat-widget.is-docked .fk-market-feed,
    .fk-chat-widget.is-docked .fk-friend-chat-messages {
        flex: 1 1 auto;
        height: auto !important;
        min-height: 0;
        max-height: none !important;
        padding: 10px;
    }

    .fk-chat-widget.is-docked .fk-chat-composer,
    .fk-chat-widget.is-docked .fk-friend-chat-composer {
        flex: 0 0 auto;
        border-top: 1px solid rgba(212, 160, 70, .24);
        background: #17171b;
    }

    .fk-chat-widget.is-docked .fk-friend-chat-list-screen,
    .fk-chat-widget.is-docked .fk-friend-chat-thread-screen {
        flex: 1 1 auto;
        min-height: 0;
    }

    .fk-chat-widget.is-docked .fk-friend-chat-thread-screen:not([hidden]) {
        display: flex;
        flex-direction: column;
    }

    .fk-chat-widget.is-docked .fk-friend-chat-list {
        overflow-y: auto;
        min-height: 0;
    }

    .fk-chat-widget.is-docked .fk-chat-message-user,
    .fk-chat-widget.is-docked .fk-chat-message-body {
        font-size: 14px;
    }

    .fk-chat-widget.is-docked .fk-chat-panel-actions a,
    .fk-chat-widget.is-docked .fk-chat-panel-actions button,
    .fk-chat-widget.is-docked .fk-chat-panel-tab {
        min-height: 32px;
    }
}

@media (min-width: 1200px) {
    .fk-chat-widget.is-docked .fk-chat-panel {
        width: 440px;
    }
}
