/* Stage 3 / 1.3. Keep the chat input and sticker picker inside the fixed chat card. */
.fox-chat-panel #chat #drop_zone,
.fox-chat-panel #chat #chat_messages {
    height: 100%;
    min-height: 0;
}

.fox-chat-panel #chat #drop_zone.hover #chat_messages,
.fox-chat-panel #chat #drop_zone.error #chat_messages { height: 100%; }

.fox-chat-panel #chat .fox-chat-compose {
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr) 40px auto;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 64px;
    height: auto;
    padding: 9px 10px;
    border-top: 1px solid rgba(var(--fox-rgb-as3l14, 187, 126, 240), .24);
    background: linear-gradient(115deg, rgba(var(--fox-rgb-ts2l2, 23, 13, 41), .93), rgba(var(--fox-rgb-ts2l1, 12, 9, 25), .89));
    box-shadow: inset 0 9px 19px rgba(var(--fox-rgb-gs2l9, 112, 52, 174), clamp(0, calc(.09 * var(--fox-glow-strength, 1)), 1));
}

.fox-chat-panel #chat .smile_input {
    position: relative;
    min-width: 0;
    margin: 0;
}

.fox-chat-panel #chat .fox-chat-compose .form-control {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 8px 38px 8px 12px;
    border: 1px solid rgba(var(--fox-rgb-as3l14, 179, 123, 225), .31);
    border-radius: 10px;
    outline: none;
    background: rgba(var(--fox-rgb-as2l3, 32, 20, 52), .68) !important;
    box-shadow: inset 0 1px 9px rgba(var(--fox-rgb-gs3l13, 166, 101, 221), clamp(0, calc(.13 * var(--fox-glow-strength, 1)), 1));
    color: var(--fox-tone-as4l19, #f5edff) !important;
    font-size: 13px;
    line-height: 20px;
}

.fox-chat-panel #chat .fox-chat-compose .form-control::placeholder {
    color: var(--fox-tone-as1l15, #c0acce);
    opacity: 1;
}

.fox-chat-panel #chat .fox-chat-compose .form-control:focus {
    border-color: rgba(var(--fox-rgb-as4l16, 208, 158, 249), .57);
    box-shadow: inset 0 1px 9px rgba(var(--fox-rgb-gs3l13, 166, 101, 221), clamp(0, calc(.16 * var(--fox-glow-strength, 1)), 1)), 0 0 0 2px rgba(var(--fox-rgb-gs2l12, 149, 83, 212), clamp(0, calc(.13 * var(--fox-glow-strength, 1)), 1));
}

.fox-chat-panel #chat #smile_btn {
    position: absolute;
    top: 50%;
    right: 11px;
    margin: 0;
    transform: translateY(-50%);
}

.fox-chat-panel #chat #smile_btn::after { color: var(--fox-tone-as2l15, #c5a5e4); }

.fox-chat-panel #chat .fox-chat-sticker-toggle {
    display: inline-grid;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(var(--fox-rgb-as3l14, 188, 122, 246), .42);
    border-radius: 10px;
    background: rgba(var(--fox-rgb-as2l8, 106, 53, 161), .17);
    box-shadow: inset 0 1px rgba(var(--fox-rgb-gs4l17, 219, 169, 255), clamp(0, calc(.09 * var(--fox-glow-strength, 1)), 1));
    color: var(--fox-tone-as4l17, #e3bfff);
    font-size: 17px;
    cursor: pointer;
}

.fox-chat-panel #chat .fox-chat-sticker-toggle:hover,
.fox-chat-panel #chat .fox-chat-sticker-toggle[aria-expanded="true"] {
    border-color: rgba(var(--fox-rgb-as4l17, 219, 169, 255), .7);
    background: rgba(var(--fox-rgb-as2l10, 133, 66, 198), .27);
    color: #fff;
}

.fox-chat-panel #chat .fox-chat-sticker-toggle:focus-visible,
.fox-chat-panel #chat .fox-chat-sticker-picker button:focus-visible {
    outline: 2px solid var(--fox-tone-as4l17, #e2b7ff);
    outline-offset: 2px;
}

.fox-chat-panel #chat .fox-chat-compose #send_button {
    box-sizing: border-box;
    display: inline-block !important;
    width: auto;
    min-width: 94px;
    max-width: 100%;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 8px 11px !important;
    border: 1px solid rgba(var(--fox-rgb-as4l16, 202, 144, 255), .7) !important;
    border-radius: 10px !important;
    line-height: 22px !important;
    white-space: nowrap;
}

.fox-chat-panel #chat .fox-chat-sticker-picker[hidden] { display: none !important; }

.fox-chat-panel #chat .fox-chat-sticker-picker {
    box-sizing: border-box;
    grid-column: 1 / -1;
    width: 100%;
    max-height: 168px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 9px;
    border: 1px solid rgba(var(--fox-rgb-as3l14, 188, 122, 246), .36);
    border-radius: 11px;
    background: linear-gradient(130deg, rgba(var(--fox-rgb-ts2l3, 32, 17, 54), .95), rgba(var(--fox-rgb-ts2l2, 14, 10, 30), .96));
    box-shadow: inset 0 1px 12px rgba(var(--fox-rgb-gs3l12, 158, 81, 230), clamp(0, calc(.13 * var(--fox-glow-strength, 1)), 1));
    scrollbar-width: thin;
    scrollbar-color: var(--fox-tone-as2l10, #7e4ba8) transparent;
}

.fox-chat-panel #chat .fox-chat-sticker-status {
    margin: 6px 3px;
    color: var(--fox-tone-as2l17, #dcc8eb);
    font-size: 12px;
    line-height: 1.4;
}

.fox-chat-panel #chat .fox-chat-sticker-group + .fox-chat-sticker-group { margin-top: 10px; }

.fox-chat-panel #chat .fox-chat-sticker-group-title {
    margin: 0 0 6px;
    color: var(--fox-tone-as4l18, #e2c1ff);
    font-size: 11px;
    font-weight: 700;
}

.fox-chat-panel #chat .fox-chat-sticker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 5px;
}

.fox-chat-panel #chat .fox-chat-sticker-item {
    display: grid;
    width: 100%;
    height: 43px;
    place-items: center;
    padding: 3px;
    border: 1px solid rgba(var(--fox-rgb-as3l15, 190, 139, 238), .19);
    border-radius: 8px;
    background: rgba(var(--fox-rgb-as2l13, 171, 104, 219), .08);
    cursor: pointer;
}

.fox-chat-panel #chat .fox-chat-sticker-item:hover {
    border-color: rgba(var(--fox-rgb-as4l16, 211, 163, 255), .6);
    background: rgba(var(--fox-rgb-as3l12, 170, 97, 221), .2);
}

.fox-chat-panel #chat .fox-chat-sticker-item:disabled { opacity: .55; cursor: wait; }

.fox-chat-panel #chat .fox-chat-sticker-item img {
    display: block;
    max-width: 35px;
    max-height: 35px;
    object-fit: contain;
}

.fox-chat-panel #chat .fox-chat-sticker-message { display: inline-block; vertical-align: middle; }
.fox-chat-panel #chat .fox-chat-sticker { display: block; width: auto; max-width: 90px !important; max-height: 90px; object-fit: contain; }
.fox-chat-panel #chat .fox-chat-sticker-missing { color: var(--fox-tone-as1l16, #cbb7d9); font-style: italic; }

.fox-chat-panel #chat .fox-chat-compose--guest { grid-template-columns: minmax(0, 1fr) auto; }
.fox-chat-panel #chat .fox-chat-compose--guest .form-control { padding-right: 10px; }
.fox-chat-panel #chat .fox-chat-compose--guest .fox-chat-login {
    min-height: 40px;
    margin: 0;
    padding: 0 10px;
}

@media (max-width: 520px) {
    .fox-chat-panel #chat .fox-chat-compose { grid-template-columns: minmax(0, 1fr) 38px auto; gap: 6px; padding: 8px; }
    .fox-chat-panel #chat .fox-chat-sticker-toggle { width: 38px; height: 40px; }
    .fox-chat-panel #chat .fox-chat-compose #send_button { min-width: 84px; padding-inline: 8px !important; font-size: 12px !important; }
    .fox-chat-panel #chat .fox-chat-compose .form-control { padding-left: 9px; font-size: 12px; }
    .fox-chat-panel #chat .fox-chat-compose--guest { grid-template-columns: minmax(0, 1fr) auto; }
}
