body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    padding: 10px 10px 0;
    min-height: 100vh;
    align-items: center;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;

    background-size: cover;
    background-attachment: fixed;
    background-position-x: center;
    background-position-y: center;
    background-color: #6d6d6d;
}

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

.chat-container {
    flex: 1;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /*padding-bottom: 150px;*/
}

.chat-window {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* width: 80%; */
    max-width: 600px;
    padding: 20px;
    margin-bottom: 160px;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
}

.chat-window.battle {
    border-color: rgba(215, 84, 84, 0.9);
    box-shadow: 0 0 30px rgba(215, 84, 84, 0.45), 0 4px 30px rgba(0, 0, 0, 0.1);
    background: rgba(255, 237, 237, 0.92);
}

.npc-items-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.npc-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid #3e63c2;
    background: #f3f5ff;
    font-size: 14px;
    cursor: grab;
    user-select: none;
}

.npc-item-icon {
    font-size: 16px;
}

.npc-item-name {
    white-space: nowrap;
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    max-width: 92%;
    font-size: 18px;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
}

.message.error-card {
    align-self: flex-end;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #ffecec, #ffd2d2);
    border: 1px solid rgba(209, 51, 51, 0.5);
    border-radius: 14px;
    padding: 10px 16px;
    color: #4a0000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
}

.error-card__text {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
    color: #4a0000;
}

.error-card__retry {
    border: none;
    border-radius: 999px;
    background: #b13232;
    color: white;
    font-weight: 600;
    padding: 6px 16px;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease;
    font-size: 13px;
    font-family: inherit;
}

.error-card__retry:hover {
    background: #861f1f;
}

.error-card__retry:active {
    transform: translateY(1px);
}

.stream-wrapper {
    display: inline;
    font: inherit;
}

.stream-token {
    display: inline-flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    font: inherit;
}

@keyframes stream-word-fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stream-word {
    display: inline-block;
    opacity: 0;
    animation: stream-word-fade 0.35s ease forwards;
    animation-delay: var(--stream-word-delay, 0s);
    will-change: opacity, transform;
    font: inherit;
    white-space: nowrap;
}

.message.user {
    background-color: #ffffff;
    align-self: flex-end;
    border-radius: 6px;
    text-align: center;
    cursor: default;
}

.message.bot {
    align-self: flex-start;
}

.message.summary {
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
    padding-left: 40px;
    position: relative;
    border-radius: 9px;
}

.message.summary::before {
    content: "❝";
    position: absolute;
    left: 10px;
    top: 10px;
    font-size: 20px;
    color: #ff9800;
    opacity: 0.8;
}

.chat {
    min-height: 10px;
}

.user.chat {
    margin-left: 60px;
    border-radius: 20px 0 20px 20px;
    text-align: left;
}

.bot.chat {
    background-color: #cbceff;
    margin-right: 60px;
    align-self: flex-end;
    border-radius: 20px 20px 20px 0;
}

.input-container {
    background-color: white;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 700px;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 15px 15px 0 0;
    z-index: 100;
}

.input-container.battle {
    box-shadow: 0 -2px 20px rgba(215, 84, 84, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.3);
    background: rgba(255, 231, 231, 0.98);
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-container input {
    flex: 1;
    padding: 10px;
    border: none;
    outline: none;
    background: transparent;
    min-width: 50px;
}

.input.battle {
    background: rgba(255, 231, 231, 0.98);
}

.blue {
    padding: 10px 20px;
    background-color: #0078d7;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.quick-replies {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.quick-replies button {
    padding: 5px 10px;
    background-color: #3e63c2;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    scale: 0.9;
}

.quick-replies .const {
    justify-content: flex-end;
    margin-left: auto;
}

.chat-window ibt {
    display: inline-block;
    padding: 0 8px;
    background-color: #3e63c2;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 0 2px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.chat-window ibt:hover {
    background-color: #2a4a8f;
}

.chat-window ibl {
    display: inline-block;
    padding: 2px 8px;
    background-color: #3e63c2;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 1px 2px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.chat-window ibl:hover {
    background-color: #2a4a8f;
}

.chat-window ibi {
    display: inline-block;
    padding: 2px 8px;
    background-color: #3e63c2;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 1px 2px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.chat-window ibi:hover {
    background-color: #2a4a8f;
}

.with-icon {
    position: relative;
    padding-right: 22px;
}

.with-icon::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: inherit;
}

.header {
    font-size: 30px;
}

.send-button.disabled {
    pointer-events: none;
    background: #474c58;
}

.send-button {
    user-select: none;
}

.tag-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 12px;
    margin-right: 8px;
    cursor: default;
    user-select: none;
}

.tag-container.tag-hand {
    background: #e1d7ff;
    transition: transform 0.4s;
}

.tag-container.tag-hand.draggable {
    cursor: grab;
}

.tag-container.tag-hand.draggable:active {
    cursor: grabbing;
}

.chat-drop-item {
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #8B4513;
    background: #e1d7ff;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    width: auto;
    flex: none;
    max-width: 80%;
    white-space: nowrap;
}

.tag {
    font-size: 14px;
    color: #333;
}

.close-tag {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    color: #999;
}

.close-tag:hover {
    color: #666;
}

.variable {
    display: flex;
}

.variable .blue {
    padding: 10px 10px;
}

.room-list .room {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    margin-bottom: 20px;
}

.trade {
    margin-bottom: 30px;
}

.trade .trade-item-name {
    font-size: 14px;
}

.trade .inner {
    display: flex;
    justify-content: space-between;
}

.right-panel {
    width: 50px;
    height: 100px;
    ;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    bottom: 0;
    border-radius: 10px 0 0 10px;
    background-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 100;
}

.right-panel div {
    height: 50px;
    width: 50px;
    background-repeat: no-repeat;
    background-size: 100% 100% !important;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.menu-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5001;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.tag-container .tag {
    max-width: 17ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-container .items {
    max-height: 145px;
}

.background-div {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: linear-gradient(90deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 10s ease infinite;
}

.background-div .main {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.background-div .main.temp {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.inner-image {
    max-width: 300px;
    max-height: 500px;
    height: 300px;
    border-radius: 10px;
    margin: auto;
}

.inner-image img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
}
/* Tabs Container */
.tabs-container {
    width: 90%;
    max-width: 600px;
    margin: 10px auto 20px;
    position: fixed;
    z-index: 101;
}

.tabs-header {
    display: flex;
    margin-bottom: 15px;
}

.tab-button {
    flex: 1;
    margin-right: 5px;
    min-width: 0; /* allow button to shrink below RPGUI's min-width */
}

.tab-button:last-child {
    margin-right: 0;
}

.tab-button.active,
.tab-button.active:hover {
    background-image: url("assets/img/button-down.png");
}

.tabs-content {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 15px;
    min-height: 200px;
    border: 2px solid #8B4513;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Inventory Tab */
.inventory-tab-content .money-display {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.inventory-sections {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.inventory-section {
    flex: 1;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #8B4513;
    border-radius: 10px;
    padding: 10px;
}

.inventory-section h3 {
    margin-top: 0;
    text-align: center;
    color: #8B4513;
}

.inventory-section.character {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.backpack-items, .character-slots {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 150px;
    max-height: 200px;
    overflow-y: auto;
}

.backpack-items li, .character-slots .slot {
    background: #F5DEB3;
    border: 1px solid #8B4513;
    border-radius: 5px;
    padding: 8px;
    margin-bottom: 5px;
    cursor: move;
    user-select: none;
    touch-action: none;
    transition: background 0.2s;
}

.backpack-items li:hover, .character-slots .slot:hover {
    background: #E6C9A8;
}

.character-items {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.character-items li {
    background: #F5DEB3;
    border: 1px solid #8B4513;
    border-radius: 5px;
    padding: 8px;
    margin-bottom: 5px;
    cursor: move;
    user-select: none;
    touch-action: none;
    transition: background 0.2s;
}

.character-items li:hover {
    background: #E6C9A8;
}

.inventory-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Quests Tab */
.quests-tab-content {
    display: flex;
    gap: 20px;
}

.quest-list {
    flex: 1;
    min-width: 207px;
    max-height: 300px;
    overflow-y: auto;
}

.quest-list li {
    padding: 10px;
    border-bottom: 1px solid #8B4513;
    cursor: pointer;
}

.quest-list li:hover {
    background: #F5DEB3;
}

.quest-list li.active {
    background: #D2B48C;
    font-weight: bold;
}

.quest-details {
    flex: 2;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #8B4513;
    border-radius: 10px;
    padding: 15px;
}
/* Quest status classes */
.quest-list li.current-quest,
.quest-details .current-quest {
    position: relative;
    padding-left: 37px;
}
.quest-list li.current-quest::before,
.quest-details .current-quest::before {
    content: "👑";
    position: absolute;
    left: 8px;
    top: 35%;
    transform: translateY(-50%);
    font-size: 16px;
}

.quest-list li.inactive-quest,
.quest-details .inactive-quest {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    opacity: 0.7;
}

.quest-list li.inactive-quest .quest-title,
.quest-details .inactive-quest .quest-title {
    text-decoration: line-through;
}

/* Character Tab */
.character-tab-content h3 {
    color: #8B4513;
    border-bottom: 2px solid #8B4513;
    padding-bottom: 5px;
}

.rpgui-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.rpgui-table td {
    padding: 8px;
    border: 1px solid #8B4513;
}

.rpgui-table tr:nth-child(even) {
    background: rgba(210, 180, 140, 0.3);
}

.health-bar, .mana-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.health-bar label, .mana-bar label {
    width: 80px;
    font-weight: bold;
}

.health-bar progress, .mana-bar progress {
    flex: 1;
    margin: 0 10px;
}

.skills-list li {
    padding: 8px;
    border-bottom: 1px solid #8B4513;
}
/* Drag and drop visual feedback */
/* New Character Tab Styles */
.character-info {
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #8B4513;
    border-radius: 10px;
}

.character-field {
    margin-bottom: 8px;
    font-size: 16px;
}

.character-field strong {
    color: #8B4513;
    margin-right: 8px;
}

#character-name,
#character-health {
    font-weight: bold;
    color: #333;
}

.spec-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.spec-item {
    flex: 1 1 calc(50% - 10px);
    min-width: 200px;
    background: #F5DEB3;
    border: 1px solid #8B4513;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spec-text {
    font-weight: bold;
    color: #8B4513;
}

.spec-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    background: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #8B4513;
}
.droppable.drag-over {
    background-color: rgba(139, 69, 19, 0.8) !important;
    border-color: #8B4513 !important;
    box-shadow: inset 0 0 10px #8B4513;

    outline: 2px dashed #8B4513;
    outline-offset: 4px;
}

.droppable.drag-over .input {
    background-color: inherit;
}

/* Стили для entities контейнера */
entities {
    display: none;
    flex-direction: column;
    gap: 20px;
    margin: 8px 0;
}

entities.visible {
    display: flex;
}

/* Стили для секций entities */
.entities-section {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* Стили для NPC элементов - аналог ibt */
npc {
    display: inline-block;
    padding: 0 8px;
    background-color: #3e63c2;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 0 2px;
    text-decoration: none;
    transition: background-color 0.2s;
    line-height: 1.5;
}

npc:hover {
    background-color: #2a4a8f;
}

npc.friend {
    background-color: #2d8a2d;
}

npc.friend:hover {
    background-color: #1f5f1f;
}

npc.enemy {
    background-color: #c23e3e;
}

npc.enemy:hover {
    background-color: #8a2a2a;
}

npc.teammember {
    background-color: #2a4a8f;
}

npc.teammember:hover {
    background-color: #1f3a6f;
}

npc.dead {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
    text-decoration: line-through;
}

npc.dead:hover {
    background-color: #999;
}

/* Стили для location элементов - аналог ibl */
location {
    display: inline-block;
    padding: 2px 8px;
    background-color: #3e63c2;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 1px 2px;
    text-decoration: none;
    transition: background-color 0.2s;
    line-height: 1.5;
}

location:hover {
    background-color: #2a4a8f;
}

/* Стили для кнопок */
styledbutton {
    display: inline-block;
    padding: 2px 8px;
    background-color: #3e63c2;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 1px 2px;
    text-decoration: none;
    transition: background-color 0.2s;
    border: none;
    line-height: 1.5;
}

styledbutton:hover {
    background-color: #2a4a8f;
}

styledbutton.link-loc {
    background-color: #3e63c2;
}

styledbutton.link-loc:hover {
    background-color: #2a4a8f;
}

styledbutton.link-npc {
    background-color: #3e63c2;
}

styledbutton.link-npc:hover {
    background-color: #2a4a8f;
}

styledbutton.nop {
    background-color: #999;
}

styledbutton.nop:hover {
    background-color: #666;
}

styledbutton.default {
    background-color: #3e63c2;
}

styledbutton.one {
    background-color: #b8860b;
}

styledbutton.one:hover {
    background-color: #8a6308;
}

/* Стили для контейнера кнопок - одна кнопка на строку, центрирование */
.buttons-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

/* Улучшенный стиль для styledbutton */
styledbutton {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3e63c2, #2a4a8f);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    margin: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 160px;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

styledbutton::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

styledbutton:hover {
    background: linear-gradient(135deg, #2a4a8f, #1a3266);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

styledbutton:hover::before {
    opacity: 1;
}

styledbutton:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Стили для предметов */
item {
    display: inline-block;
    padding: 2px 8px;
    background-color: #3e63c2;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 1px 2px;
    text-decoration: none;
    transition: background-color 0.2s;
    line-height: 1.5;
}

item:hover {
    background-color: #2a4a8f;
}

/* Кнопка закрытия инвентаря в пиксельном стиле */
.inventory-close-button {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    z-index: 102;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.inventory-close-button:hover {
    transform: scale(1.1);
}

.close-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #8B4513;
    border: 4px solid #5D2906;
    box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.close-cross {
    width: 24px;
    height: 24px;
    position: relative;
}

.close-cross::before,
.close-cross::after {
    content: '';
    position: absolute;
    background-color: #FFD700;
    box-shadow: 0 0 0 2px #000;
}

.close-cross::before {
    width: 24px;
    height: 4px;
    top: 10px;
    left: 0;
    transform: rotate(45deg);
}

.close-cross::after {
    width: 24px;
    height: 4px;
    top: 10px;
    left: 0;
    transform: rotate(-45deg);
}

/* Гарантированные стили для скроллбара .rpgui-list-imp */
.rpgui-list-imp {
    overflow-y: scroll;
    box-sizing: border-box;
    padding-right: 18px; /* место для скроллбара */
}

/* Стили скроллбара для .rpgui-list-imp - копируем стили из .rpgui-content */
.rpgui-list-imp::-webkit-scrollbar {
    width: 18px;
}

.rpgui-list-imp::-webkit-scrollbar-track {
    background-image: url("/data/assets/img/scrollbar-track.png");
    background-size: 18px 60px;
    background-repeat: repeat-y;
}

.rpgui-list-imp::-webkit-scrollbar-thumb {
    background-image: url("/data/assets/img/scrollbar-thumb.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.rpgui-list-imp::-webkit-scrollbar-button {
    background-image: url("/data/assets/img/scrollbar-button.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

/* Стили для Firefox */
@-moz-document url-prefix() {
    .rpgui-list-imp {
        scrollbar-width: thin;
        scrollbar-color: #8a6d3b #2c2c2c;
    }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    /* 1. Убираем padding-left у кнопок в tabs-header и центрируем текст */
    .tabs-header .rpgui-button {
        padding-left: 0;
        padding-right: 0;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* 2. Минимальная высота для inventory-section character */
    .inventory-section.character {
        min-height: 120px;
    }
    
    /* 3. Перемещаем quest-details под quest-list */
    .quests-tab-content {
        display: flex;
        flex-direction: column;
    }
    
    .quest-list {
        order: 1;
    }
    
    .quest-details {
        order: 2;
        margin-top: 20px;
    }
    
    /* 4. Включаем скролл внутри rpgui-list-imp */
    .rpgui-list-imp {
        overflow-y: auto;
        max-height: 200px;
    }

    .input-row {
        display: grid;
        grid-template-areas:
            "tags tags"
            "input button";
        grid-template-columns: 1fr auto;
        gap: 8px;
    }
    .tag-container {
        grid-area: tags;
        display: flex;
        gap: 8px;
        justify-content: flex-start;
        margin-bottom: 4px;
        width: fit-content;
        justify-self: start;
    }
    .tag-container.tag-hand,
    .tag-container.tag-action {
        flex: 0 0 auto;
    }
    .tag-container .tag {
        max-width: none;
    }
    .input-container input {
        grid-area: input;
    }
    .send-button {
        grid-area: button;
        position: relative;
        width: 40px;
        padding: 10px;
        text-indent: -9999px;
        overflow: hidden;
    }
    .send-button::after {
        content: "→";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-indent: 0;
        font-size: 20px;
        color: white;
    }

    /* Ограничение высоты блоков вариантов на мобильных устройствах */
    .quick-replies .variable {
        display: flex;
        flex-wrap: nowrap;
        height: 44px;
        overflow-x: hidden;
        gap: 8px;
        align-items: center;
    }
    .quick-replies .variable button {
        box-sizing: border-box;
        height: 44px;
        overflow: hidden;
        flex-shrink: 1;
        min-width: 0;
        padding: 2px 8px;
        font-size: 11px;
        line-height: 20px;
        white-space: normal;
        word-break: break-word;
    }
}

/* Анимация тетромино для кнопки загрузки*/
.tetrominos {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-28px, -24px); 
    width: 24px;
    height: 28px;
    pointer-events: none;
}

.tetromino {
    width: 24px;
    height: 28px;
    position: absolute;
    transition: all ease .3s;
    background: url('data:image/svg+xml;utf-8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 612 684"%3E%3Cpath fill="%23010101" d="M305.7 0L0 170.9v342.3L305.7 684 612 513.2V170.9L305.7 0z"/%3E%3Cpath fill="%23fff" d="M305.7 80.1l-233.6 131 233.6 131 234.2-131-234.2-131"/%3E%3C/svg%3E') no-repeat top center;
    background-size: contain;
}

.box1 {
    animation: tetromino1 1.5s ease-out infinite;
}
.box2 {
    animation: tetromino2 1.5s ease-out infinite;
}
.box3 {
    animation: tetromino3 1.5s ease-out infinite;
    z-index: 2;
}
.box4 {
    animation: tetromino4 1.5s ease-out infinite;
}

@keyframes tetromino1 {
    0%, 40% {
        transform: translate(0,0);
    } 50% {
        transform: translate(12px,-6px);
    } 60%, 100% {
        transform: translate(24px,0);
    }
}

@keyframes tetromino2 {
    0%, 20% {
        transform: translate(24px, 0px);
    } 40%, 100% {
        transform: translate(36px, 6px);
    }
}

@keyframes tetromino3 {
    0% {
        transform: translate(36px, 6px);
    } 20%, 60% {
        transform: translate(24px, 12px);
    } 90%, 100% {
        transform: translate(12px, 6px);
    }
}

@keyframes tetromino4 {
    0%, 60% {
        transform: translate(12px, 6px);
    } 90%, 100% {
        transform: translate(0, 0);
    }
}

/* Стили для кнопки с анимацией */
.send-button.loading {
    position: relative;
    overflow: visible;
}

.send-button.loading::after {
    content: "";
    display: none;
}

.send-button.loading .tetrominos {
    display: block;
}

/* Анимация поверх disabled кнопки */
.send-button.loading.disabled .tetromino {
    opacity: 0.9;
}