/* ============================================================================
   FreeTalk - VN 스타일 1:1 대화 오버레이
   ============================================================================
   1:1 대화 시 메신저 대신 사용되는 VN 스타일 UI.
   캐릭터 아바타 + 스크롤 대화창 + 입력창.
   ============================================================================ */

/* ── 풀스크린 오버레이 ── */

.freetalk-overlay {
    --ft-avatar-radius: 14px;
    --ft-panel-radius: 16px;
    --ft-dialogue-pad-x: 16px;
    --ft-dialogue-pad-y: 8px;
    --ft-side-width: clamp(420px, 38vw, 720px);
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    height: var(--app-height, 100dvh);
    z-index: 200;
    overflow: hidden;
    background: linear-gradient(180deg, #f8f3eb 0%, #efe6da 100%);
    flex-direction: column;
}

.freetalk-overlay.active {
    display: flex;
}

/* ── 상단 헤더 ── */

.ft-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px clamp(12px, 2vw, 18px);
    z-index: 10;
    flex-shrink: 0;
    background: rgba(255, 252, 248, 0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(139, 115, 85, 0.14);
    box-shadow: 0 8px 24px rgba(58, 53, 48, 0.06);
    min-height: 52px;
    position: relative;
}

.ft-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.ft-style-toggle {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    height: 30px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(139, 115, 85, 0.08);
    border: 1px solid rgba(139, 115, 85, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font: inherit;
    overflow: hidden;
}

.ft-style-toggle__thumb {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    border-radius: 999px;
    background: linear-gradient(135deg, #8b7355, #7a6548);
    box-shadow: 0 6px 16px rgba(122, 101, 72, 0.22);
    transition: transform 0.22s ease;
    z-index: 0;
    pointer-events: none;
}

.ft-style-toggle[data-ft-current="chatbot"] .ft-style-toggle__thumb {
    transform: translateX(100%);
}

.ft-style-toggle__label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 0 12px;
    color: rgba(58, 53, 48, 0.62);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: color 0.2s ease;
    pointer-events: none;
}

.ft-style-toggle[data-ft-current="vn"] .ft-style-toggle__label[data-mode="vn"],
.ft-style-toggle[data-ft-current="chatbot"] .ft-style-toggle__label[data-mode="chatbot"] {
    color: #fffaf2;
}

.ft-edit-user-btn {
    background: rgba(139, 115, 85, 0.08);
    border: 1px solid rgba(139, 115, 85, 0.18);
    color: #3a3530;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease;
    box-shadow: none;
}
.ft-edit-user-btn:hover {
    background: rgba(139, 115, 85, 0.14);
    border-color: rgba(139, 115, 85, 0.28);
}
.ft-edit-user-btn:active {
    transform: translateY(1px);
}

.ft-back-btn {
    background: none;
    border: none;
    color: #3a3530;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
    margin-right: 4px;
    line-height: 1;
}

.ft-char-name {
    flex: 1;
    min-width: 0;
    color: #3a3530;
    font-size: 1.05rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 캐릭터 아바타 영역 ── */

.ft-avatar-area {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
    padding: 0;
    position: relative;
    box-sizing: border-box;
}

/* 하단 그라데이션 페이드 — 이미지가 채팅 영역으로 자연스럽게 녹아듦 */
.freetalk-overlay.ft-mode-vn .ft-avatar-area::before {
    content: '';
    position: absolute;
    inset: -28px;
    background-image: var(--ft-avatar-bg);
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.9) saturate(1.03);
    opacity: 0.5;
    transform: scale(1.03);
    z-index: 0;
}

.ft-avatar-area::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 110px;
    pointer-events: none;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(248, 243, 235, 0.4) 45%,
        rgba(248, 243, 235, 0.9) 80%,
        rgba(248, 243, 235, 1) 100%);
    z-index: 2;
}

.ft-avatar-area img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    border-radius: var(--ft-avatar-radius);
    border: none;
    box-shadow: 0 8px 24px rgba(58, 53, 48, 0.18);
    transition: opacity 0.3s;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.ft-avatar-area img.thinking {
    opacity: 1;
    filter: saturate(1.04) drop-shadow(0 0 14px rgba(214, 51, 92, 0.22));
    animation: ft-avatar-wait 1.8s ease-in-out infinite;
}

@keyframes ft-avatar-wait {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

/* ── 대사창 ── */

.ft-dialogue {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 var(--ft-dialogue-pad-x) var(--ft-dialogue-pad-y);
    z-index: 2;
    min-height: 0;
    overflow: hidden;
}

.ft-dialogue-box {
    background:
        radial-gradient(circle at 18% 0%, rgba(139, 115, 85, 0.045), transparent 34%),
        linear-gradient(180deg, rgba(255, 252, 248, 0.92), rgba(248, 243, 235, 0.88));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 115, 85, 0.12);
    border-radius: var(--ft-panel-radius);
    padding: clamp(14px, 1.25vw, 22px) clamp(14px, 1.7vw, 30px);
    min-height: 0;
    height: 100%;
    max-height: none;
    overflow-y: auto;
    color: #3a3530;
    font-size: 0.92rem;
    line-height: 1.7;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: clamp(0.72rem, 0.8vw, 0.95rem);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 14px 34px rgba(58, 53, 48, 0.08);
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 115, 85, 0.35) transparent;
}

.ft-speaker {
    display: block;
    font-weight: 700;
    color: #8b7355;
    margin-top: 0.6em;
    margin-bottom: 0.2em;
    font-size: 0.95em;
}

.ft-speaker:first-child {
    margin-top: 0;
}

.ft-advance-indicator {
    display: inline-block;
    animation: ft-blink 1s ease-in-out infinite;
    color: #8b7355;
    font-size: 0.85em;
    margin-left: 4px;
}

@keyframes ft-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* ── 입력 영역 ── */

.ft-input-area {
    padding: 8px 16px 20px;
    padding-bottom: max(20px, calc(12px + env(safe-area-inset-bottom, 0px)));
    z-index: 2;
    flex-shrink: 0;
}

.ft-image-preview {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.ft-image-preview img {
    max-height: 72px;
    border-radius: 8px;
    border: 1px solid rgba(139, 115, 85, 0.3);
}

.ft-remove-img {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

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

.ft-upload-btn {
    background: none;
    border: none;
    color: rgba(58, 53, 48, 0.52);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    transition: color 0.2s;
    line-height: 1;
}

.ft-upload-btn:hover {
    color: #3a3530;
}

/* FreeTalk 타로 버튼 */
.ft-input {
    flex: 1;
    background: rgba(255, 252, 248, 0.95);
    border: 1px solid rgba(139, 115, 85, 0.22);
    border-radius: 24px;
    padding: 10px 16px;
    color: #3a3530;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
    font-family: inherit;
}

.ft-input:focus {
    border-color: rgba(139, 115, 85, 0.5);
}

.ft-input::placeholder {
    color: rgba(58, 53, 48, 0.42);
}

.ft-input:disabled {
    opacity: 0.5;
}

/* 행동 묘사(*) 토글 버튼 */
.ft-action-btn {
    background: transparent;
    border: 1.5px solid rgba(139, 115, 85, 0.3);
    color: rgba(58, 53, 48, 0.6);
    font-size: 1rem;
    font-weight: 700;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ft-action-btn:hover {
    border-color: rgba(139, 115, 85, 0.6);
    color: #3a3530;
    transform: scale(1.05);
}

.ft-action-btn.active {
    background: rgba(139, 115, 85, 0.18);
    border-color: #8b7355;
    color: #7a6548;
    box-shadow: 0 0 8px rgba(139, 115, 85, 0.4);
}

.ft-send-btn {
    background: linear-gradient(135deg, #8b7355, #7a6548);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 6px 14px rgba(122, 101, 72, 0.22);
}

.ft-send-btn:hover {
    background: linear-gradient(135deg, #9b8365, #8a7558);
    transform: scale(1.05);
}

.ft-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.ft-send-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* ── 지문 (액션) 스타일 ── */

.ft-action {
    display: block;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.08), rgba(168, 140, 110, 0.035));
    padding: 0.48rem 0.7rem;
    border-radius: 8px;
    margin: 0.45rem 0;
    font-size: 0.9em;
    color: rgba(82, 74, 66, 0.84);
    line-height: 1.6;
    font-style: italic;
    border-left: 2px solid rgba(139, 115, 85, 0.28);
    white-space: pre-line;
}

.ft-scene {
    display: block;
    background: rgba(139, 115, 85, 0.045);
    padding: 0.48rem 0.7rem;
    border-radius: 8px;
    margin: 0.45rem 0;
    font-size: 0.88em;
    color: rgba(82, 74, 66, 0.72);
    line-height: 1.6;
    font-style: italic;
    border: 1px solid rgba(139, 115, 85, 0.12);
    border-left: 2px solid rgba(168, 140, 110, 0.34);
    white-space: pre-line;
}

.ft-thought {
    display: block;
    background: rgba(255, 255, 255, 0.38);
    padding: 0.44rem 0.68rem;
    border-radius: 8px;
    margin: 0.42rem 0;
    font-size: 0.88em;
    color: rgba(82, 74, 66, 0.7);
    line-height: 1.58;
    font-style: italic;
    border-left: 2px solid rgba(139, 115, 85, 0.2);
    white-space: pre-line;
}

.ft-text {
    display: block;
    margin: 0.45rem 0;
    line-height: 1.75;
    white-space: pre-line;
}

/* ── 대사창 내 이미지 ── */

.ft-chat-image {
    max-width: 120px;
    max-height: 120px;
    border-radius: 6px;
    margin-top: 8px;
    object-fit: contain;
}

/* ═══════════════════════════════════════════════════════════════════════════
   단일 대화창 로그
   ═══════════════════════════════════════════════════════════════════════════ */

.ft-dialogue-box::-webkit-scrollbar {
    width: 4px;
}

.ft-dialogue-box::-webkit-scrollbar-track {
    background: transparent;
}

.ft-dialogue-box::-webkit-scrollbar-thumb {
    background: rgba(139, 115, 85, 0.3);
    border-radius: 4px;
}

.ft-log-msg {
    max-width: min(74%, 680px);
    padding: 0.78rem 0.95rem;
    border-radius: 14px;
    font-size: 0.84rem;
    line-height: 1.58;
    word-break: normal;
    overflow-wrap: anywhere;
}

.freetalk-overlay .ft-log-msg.ft-scene-global.assistant {
    align-self: flex-start;
    display: block;
    width: auto;
    max-width: min(68ch, 74%);
    margin: 0.12rem 0 0.42rem clamp(0px, 0.7vw, 10px);
    padding: 0.12rem 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    color: rgba(82, 74, 66, 0.58);
    justify-content: initial;
}

.ft-scene-global-marker {
    display: none;
    font-size: 0;
    line-height: 1;
}

.freetalk-overlay .ft-log-msg.ft-scene-global .ft-scene-global-content {
    display: block;
    min-width: 0;
    max-width: none;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: inherit;
}

.ft-scene-global-body {
    min-height: 0;
    font-style: italic;
}

.freetalk-overlay .ft-log-msg.ft-scene-global.assistant .ft-scene {
    display: block;
    margin: 0;
    padding: 0;
    max-width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: inherit;
    font-size: 0.84rem;
    line-height: 1.6;
}

.ft-log-avatar {
    display: none;
}

.ft-log-content {
    display: contents;
}

.ft-log-name {
    font-weight: 700;
    font-size: 0.7rem;
    margin-bottom: 3px;
    color: #8b7355;
}

.ft-log-msg.user .ft-log-name {
    text-align: right;
}

.ft-log-msg.user {
    align-self: flex-end;
    max-width: min(52%, 420px);
    margin-right: clamp(0px, 0.8vw, 12px);
    background: linear-gradient(135deg, #8b7355, #6b5b45);
    color: #fff;
    border: 1px solid rgba(122, 101, 72, 0.2);
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 22px rgba(122, 101, 72, 0.16);
}

.ft-log-msg.assistant {
    align-self: flex-start;
    max-width: min(72%, 650px);
    margin-left: clamp(0px, 0.7vw, 10px);
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.94), rgba(250, 247, 242, 0.9));
    border: 1px solid rgba(139, 115, 85, 0.12);
    color: #3a3530;
    border-bottom-left-radius: 4px;
    box-shadow: 0 10px 24px rgba(58, 53, 48, 0.08);
}

.ft-thinking-message {
    min-width: 82px;
    background: rgba(255, 252, 248, 0.95);
    border: 1px solid rgba(139, 115, 85, 0.14);
    box-shadow: 0 4px 14px rgba(58, 53, 48, 0.06);
}

.ft-thinking-body {
    min-height: 18px;
    display: flex;
    align-items: center;
}

.ft-thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.ft-thinking-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(139, 115, 85, 0.82);
    box-shadow: 0 0 10px rgba(139, 115, 85, 0.25);
    animation: ft-thinking-bounce 1.25s infinite ease-in-out both;
}

.ft-thinking-dots span:nth-child(1) { animation-delay: -0.24s; }
.ft-thinking-dots span:nth-child(2) { animation-delay: -0.12s; }
.ft-thinking-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes ft-thinking-bounce {
    0%, 80%, 100% {
        transform: translateY(0) scale(0.72);
        opacity: 0.55;
    }
    40% {
        transform: translateY(-3px) scale(1);
        opacity: 1;
    }
}

.ft-log-body {
    min-height: 1.45em;
    line-height: 1.75;
    white-space: pre-line;
}

.ft-log-msg .ft-msg-time {
    font-size: 0.65rem;
    color: rgba(58, 53, 48, 0.42);
    margin-top: 4px;
}

.ft-empty-message {
    text-align: center;
    color: rgba(58, 53, 48, 0.42);
    margin: auto;
    padding: 18px 10px;
    font-size: 0.86rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   모바일 반응형
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .ft-avatar-area {
        padding: 0;
        flex: 0 0 auto;
        min-height: 0;
        max-height: none;
    }

    .ft-avatar-area img {
        width: 100%;
        height: auto;
        max-height: none;
    }

    .ft-dialogue-box {
        padding: 12px 14px;
        min-height: 0;
    }

}

@media (max-width: 480px) {
    .ft-avatar-area {
        padding: 0;
        flex: 0 0 auto;
        min-height: 0;
        max-height: none;
    }

    .ft-dialogue-box {
        padding: 10px 12px;
        min-height: 0;
        font-size: 0.88rem;
    }

    .ft-input {
        font-size: 0.84rem;
        padding: 9px 14px;
    }

    .ft-header {
        padding: 10px 12px;
        min-height: 46px;
    }

    .ft-edit-user-btn {
        font-size: 0.72rem;
        padding: 5px 10px;
    }

    .ft-input-area {
        padding: 6px 12px 16px;
        padding-bottom: max(16px, calc(8px + env(safe-area-inset-bottom, 0px)));
    }

    .ft-dialogue {
        padding: 0 12px 6px;
    }

}

/* 세로 모드 높이 작을 때 (키보드 올라온 상태 등) */
@media (max-height: 500px) {
    .ft-avatar-area {
        padding: 0;
    }

    .ft-avatar-area img {
        width: 100%;
        height: auto;
        max-height: none;
    }

    .ft-dialogue-box {
        min-height: 46px;
        padding: 8px 12px;
    }
}

/* ==========================================================================
   PC / 태블릿 — 좌우 분할 레이아웃 (min-width: 768px & landscape)
   아바타 좌측, 대사+입력 우측
   ========================================================================== */

/* ── ft-main / ft-right wrapper (모바일: 세로 스택, PC: 좌우 분할) ── */

.ft-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ft-right {
    display: contents;
}

/* ==========================================================================
   PC / 태블릿 — 좌우 분할 (min-width: 768px)
   ========================================================================== */

@media (min-width: 768px) and (min-height: 500px) {
    .ft-main {
        flex-direction: row;
        flex: 1;
        min-height: 0;
    }

    /* 좌측: 아바타 — 전체 높이, 잘리지 않게 최대한 꽉 차게 */
    .ft-avatar-area {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        min-width: 0;
        overflow: hidden;
        position: relative;
    }

    /* 블러 배경 — 좌우 빈 공간을 이미지의 블러 버전으로 채움 */
    .ft-avatar-area::before {
        content: '';
        position: absolute;
        inset: -40px;
        background-image: var(--ft-avatar-bg);
        background-size: cover;
        background-position: center;
        filter: blur(30px) brightness(0.85);
        z-index: 0;
    }

    /* 데스크톱에서는 하단 페이드 비활성화 (좌우 분할 레이아웃) */
    .ft-avatar-area::after {
        display: none;
    }

    .ft-avatar-area img {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: contain;
        border-radius: 0;
        border: none;
        box-shadow: none;
        position: relative;
        z-index: 1;
    }

    /* 우측: 대사 + 입력을 세로 스택 */
    .ft-right {
        display: flex;
        flex-direction: column;
        width: 420px;
        flex-shrink: 0;
        border-left: 1px solid rgba(139, 115, 85, 0.16);
        background: rgba(255, 252, 248, 0.6);
    }

    .ft-dialogue {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        padding: 16px 16px 8px;
    }

    .ft-dialogue-box {
        max-height: 100%;
        height: 100%;
    }

    .ft-input-area {
        flex-shrink: 0;
    }

}

@media (min-width: 1024px) and (min-height: 500px) {
    .ft-right {
        width: 480px;
    }

    .ft-dialogue-box {
        font-size: 0.95rem;
    }
}

@media (min-width: 1440px) and (min-height: 500px) {
    .ft-right {
        width: 540px;
    }

}

/* 가로 모드 (모바일 landscape) — 좌우 분할 컴팩트 */
@media (orientation: landscape) and (max-height: 500px) {
    .ft-main {
        flex-direction: row;
        flex: 1;
        min-height: 0;
    }

    .ft-avatar-area {
        flex: 1;
        padding: 8px 12px;
        align-items: center;
        justify-content: center;
    }

    .ft-avatar-area img {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

    .ft-right {
        display: flex;
        flex-direction: column;
        width: 320px;
        flex-shrink: 0;
        border-left: 1px solid rgba(139, 115, 85, 0.16);
    }

    .ft-dialogue {
        flex: 1;
        min-height: 0;
        padding: 8px 10px 4px;
    }

    .ft-dialogue-box {
        max-height: 100%;
        min-height: 40px;
        font-size: 0.84rem;
    }

    .ft-input-area {
        flex-shrink: 0;
        padding: 4px 10px 8px;
    }
}

/* ==========================================================================
   Chatbot 스타일 — 1:1 대화를 일반 채팅 앱처럼 표시
   ========================================================================== */

/* Harem-style VN layout parity: balanced portrait stage with a right-side chat rail. */
.freetalk-overlay.ft-mode-vn .ft-avatar-area {
    height: min(48svh, 100vw);
    min-height: 190px;
    max-height: min(520px, calc(var(--app-height, 100dvh) - 290px));
    padding: clamp(6px, 2vw, 12px);
    align-items: center;
    justify-content: center;
}

.freetalk-overlay.ft-mode-vn .ft-avatar-area img {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (max-width: 480px) {
    .freetalk-overlay {
        --ft-avatar-radius: 12px;
        --ft-panel-radius: 14px;
        --ft-dialogue-pad-x: 12px;
        --ft-dialogue-pad-y: 6px;
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area {
        height: min(43svh, 100vw);
        min-height: 160px;
        max-height: min(430px, calc(var(--app-height, 100dvh) - 250px));
        padding: 8px;
    }
}

@media (max-width: 380px) {
    .freetalk-overlay.ft-mode-vn .ft-avatar-area {
        min-height: 145px;
        max-height: min(390px, calc(var(--app-height, 100dvh) - 235px));
    }
}

@media (min-width: 768px) and (max-width: 1023px) and (min-height: 500px) {
    .freetalk-overlay.ft-mode-vn .ft-main {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area {
        flex: 0 0 auto;
        height: min(48svh, 100vw);
        min-height: 190px;
        max-height: min(520px, calc(var(--app-height, 100dvh) - 290px));
        padding: clamp(6px, 2vw, 12px);
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area::after {
        display: block;
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area img {
        width: auto;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: var(--ft-avatar-radius);
        box-shadow: 0 8px 24px rgba(58, 53, 48, 0.18);
    }

    .freetalk-overlay.ft-mode-vn .ft-right {
        display: contents;
        width: auto;
        border-left: none;
        background: transparent;
    }
}

@media (min-width: 1024px) and (min-height: 500px) {
    .freetalk-overlay {
        --ft-avatar-radius: 16px;
        --ft-panel-radius: 18px;
        --ft-dialogue-pad-x: clamp(14px, 1.15vw, 22px);
        --ft-dialogue-pad-y: clamp(8px, 1vw, 14px);
    }

    .freetalk-overlay.ft-mode-vn .ft-main {
        display: grid;
        grid-template-columns: minmax(0, min(52vw, calc(var(--app-height, 100dvh) - 66px))) minmax(0, 1fr);
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: clamp(8px, 1vw, 16px);
        min-width: 0;
        min-height: 0;
        height: 100%;
        max-height: none;
        overflow: hidden;
        position: relative;
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area::before {
        inset: -44px;
        filter: blur(32px) brightness(0.88) saturate(1.03);
        opacity: 0.58;
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area::after {
        display: none;
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area img {
        width: auto;
        height: 100%;
        max-width: 100%;
        max-height: none;
        object-fit: contain;
        object-position: right center;
        border-radius: var(--ft-avatar-radius);
        border: none;
        box-shadow: 0 18px 44px rgba(58, 53, 48, 0.18);
        position: relative;
        z-index: 1;
    }

    .freetalk-overlay.ft-mode-vn .ft-right {
        display: flex;
        flex-direction: column;
        width: auto;
        min-width: 0;
        min-height: 0;
        height: 100%;
        overflow: hidden;
        border-left: 1px solid rgba(139, 115, 85, 0.16);
        background: rgba(255, 252, 248, 0.6);
    }

    .freetalk-overlay.ft-mode-vn .ft-dialogue {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        padding: var(--ft-dialogue-pad-y) var(--ft-dialogue-pad-x) calc(var(--ft-dialogue-pad-y) * 0.65);
    }

    .freetalk-overlay.ft-mode-vn .ft-dialogue-box {
        max-height: 100%;
        height: 100%;
        font-size: 0.95rem;
    }

    .freetalk-overlay.ft-mode-vn .ft-input-area {
        flex-shrink: 0;
    }

    .freetalk-overlay.ft-mode-vn .ft-log-msg.assistant {
        margin-left: clamp(4px, 1.2vw, 22px);
    }

    .freetalk-overlay.ft-mode-vn .ft-log-msg.user {
        margin-right: clamp(18px, 2.2vw, 44px);
    }

}

@media (min-width: 1920px) and (min-height: 500px) {
    .freetalk-overlay {
        --ft-avatar-radius: 18px;
        --ft-side-width: clamp(700px, 38vw, 860px);
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .freetalk-overlay.ft-mode-vn .ft-avatar-area {
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 8px clamp(8px, 2vw, 14px);
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 12px;
    }

    .freetalk-overlay.ft-mode-vn .ft-right {
        width: clamp(300px, 42vw, 380px);
        border-left: 1px solid rgba(139, 115, 85, 0.16);
    }
}

/* ── 공통 녹색 팔레트: VN도 채팅 모드와 같은 색감으로 맞춤 ── */

.freetalk-overlay {
    background:
        radial-gradient(circle at 16% 8%, rgba(47, 111, 115, 0.12), transparent 36%),
        radial-gradient(circle at 86% 82%, rgba(201, 138, 104, 0.12), transparent 36%),
        linear-gradient(145deg, #f8faf7 0%, #eef3f1 54%, #e8f0ef 100%);
}

.freetalk-overlay .ft-header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom-color: rgba(47, 111, 115, 0.14);
    box-shadow: 0 8px 24px rgba(32, 82, 87, 0.07);
}

.freetalk-overlay .ft-style-toggle,
.freetalk-overlay .ft-edit-user-btn {
    background: rgba(47, 111, 115, 0.08);
    border-color: rgba(47, 111, 115, 0.18);
}

.freetalk-overlay .ft-style-toggle__thumb,
.freetalk-overlay .ft-send-btn {
    background: linear-gradient(135deg, #2f6f73, #4f8b86);
    box-shadow: 0 6px 16px rgba(32, 82, 87, 0.2);
}

.freetalk-overlay .ft-style-toggle__label,
.freetalk-overlay .ft-edit-user-btn,
.freetalk-overlay .ft-back-btn,
.freetalk-overlay .ft-char-name {
    color: #24313a;
}

.freetalk-overlay .ft-edit-user-btn:hover {
    background: rgba(47, 111, 115, 0.14);
    border-color: rgba(47, 111, 115, 0.28);
}

.freetalk-overlay .ft-avatar-area::after {
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(248, 250, 247, 0.4) 45%,
        rgba(248, 250, 247, 0.9) 80%,
        rgba(248, 250, 247, 1) 100%);
}

.freetalk-overlay .ft-avatar-area img {
    box-shadow: 0 8px 24px rgba(32, 82, 87, 0.16);
}

.freetalk-overlay .ft-dialogue-box {
    background:
        radial-gradient(circle at 18% 0%, rgba(47, 111, 115, 0.045), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 247, 0.88));
    border-color: rgba(47, 111, 115, 0.12);
    color: #24313a;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.62),
        0 14px 34px rgba(32, 82, 87, 0.08);
    scrollbar-color: rgba(47, 111, 115, 0.35) transparent;
}

.freetalk-overlay .ft-dialogue-box::-webkit-scrollbar-thumb {
    background: rgba(47, 111, 115, 0.3);
}

.freetalk-overlay .ft-speaker,
.freetalk-overlay .ft-log-name,
.freetalk-overlay .ft-advance-indicator,
.freetalk-overlay .ft-action-btn.active,
.freetalk-overlay .ft-speaker {
    color: #2f6f73;
}

.freetalk-overlay .ft-input,
.freetalk-overlay .ft-thinking-message {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(47, 111, 115, 0.18);
    color: #24313a;
}

.freetalk-overlay .ft-input:focus {
    border-color: rgba(47, 111, 115, 0.48);
}

.freetalk-overlay .ft-input::placeholder,
.freetalk-overlay .ft-upload-btn,
.freetalk-overlay .ft-log-msg .ft-msg-time,
.freetalk-overlay .ft-empty-message {
    color: rgba(36, 49, 58, 0.42);
}

.freetalk-overlay .ft-image-preview img,
.freetalk-overlay .ft-action-btn {
    border-color: rgba(47, 111, 115, 0.22);
}

.freetalk-overlay .ft-action-btn {
    color: rgba(36, 49, 58, 0.62);
}

.freetalk-overlay .ft-action-btn:hover {
    border-color: rgba(47, 111, 115, 0.52);
    color: #24313a;
}

.freetalk-overlay .ft-action-btn.active {
    background: rgba(47, 111, 115, 0.15);
    border-color: #2f6f73;
    box-shadow: 0 0 8px rgba(47, 111, 115, 0.28);
}

.freetalk-overlay .ft-send-btn:hover {
    background: linear-gradient(135deg, #3c7d80, #5a9993);
}

.freetalk-overlay .ft-action {
    background: linear-gradient(135deg, rgba(47, 111, 115, 0.07), rgba(201, 138, 104, 0.035));
    border-left-color: rgba(47, 111, 115, 0.3);
    color: rgba(45, 65, 70, 0.82);
}

.freetalk-overlay .ft-scene,
.freetalk-overlay .ft-thought {
    background: rgba(47, 111, 115, 0.045);
    border-color: rgba(47, 111, 115, 0.12);
    border-left-color: rgba(201, 138, 104, 0.32);
    color: rgba(45, 65, 70, 0.74);
}

.freetalk-overlay .ft-log-msg.ft-scene-global.assistant {
    color: rgba(45, 65, 70, 0.58);
}

.freetalk-overlay .ft-log-msg.user {
    background: linear-gradient(135deg, #2f6f73, #4f8b86);
    border-color: rgba(47, 111, 115, 0.18);
    box-shadow: 0 10px 22px rgba(32, 82, 87, 0.18);
}

.freetalk-overlay .ft-log-msg.user .ft-log-name,
.freetalk-overlay .ft-log-msg.user .ft-msg-time {
    color: rgba(255, 255, 255, 0.5);
}

.freetalk-overlay .ft-log-msg.user .ft-action,
.freetalk-overlay .ft-log-msg.user .ft-scene,
.freetalk-overlay .ft-log-msg.user .ft-thought {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.14);
    border-left-color: rgba(255, 255, 255, 0.38);
    color: rgba(255, 255, 255, 0.84);
}

.freetalk-overlay .ft-log-msg.assistant {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 247, 0.88));
    border-color: rgba(47, 111, 115, 0.11);
    color: #24313a;
    box-shadow: 0 10px 24px rgba(32, 82, 87, 0.08);
}

.freetalk-overlay .ft-thinking-dots span {
    background: rgba(47, 111, 115, 0.82);
    box-shadow: 0 0 10px rgba(47, 111, 115, 0.22);
}

@media (min-width: 1024px) and (min-height: 500px) {
    .freetalk-overlay.ft-mode-vn .ft-right {
        border-left-color: rgba(47, 111, 115, 0.14);
        background: rgba(255, 255, 255, 0.58);
    }

    .freetalk-overlay.ft-mode-vn .ft-avatar-area img {
        box-shadow: 0 18px 44px rgba(32, 82, 87, 0.16);
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .freetalk-overlay .ft-right {
        border-left-color: rgba(47, 111, 115, 0.14);
    }
}

.freetalk-overlay.ft-mode-chatbot {
    background:
        radial-gradient(circle at 16% 8%, rgba(47, 111, 115, 0.12), transparent 36%),
        radial-gradient(circle at 86% 82%, rgba(201, 138, 104, 0.12), transparent 36%),
        linear-gradient(145deg, #f8faf7 0%, #eef3f1 54%, #e8f0ef 100%);
}

.freetalk-overlay.ft-mode-chatbot .ft-header {
    background: rgba(255, 255, 252, 0.88);
    border-bottom-color: rgba(47, 111, 115, 0.12);
    box-shadow: 0 8px 24px rgba(32, 82, 87, 0.08);
}

.freetalk-overlay.ft-mode-chatbot .ft-back-btn,
.freetalk-overlay.ft-mode-chatbot .ft-char-name {
    color: #24313a;
}

.freetalk-overlay.ft-mode-chatbot .ft-style-toggle {
    background: rgba(47, 111, 115, 0.08);
    border-color: rgba(47, 111, 115, 0.16);
}

.freetalk-overlay.ft-mode-chatbot .ft-style-toggle__thumb {
    background: linear-gradient(135deg, #2f6f73, #4f8b86);
    box-shadow: 0 6px 16px rgba(32, 82, 87, 0.2);
}

.freetalk-overlay.ft-mode-chatbot .ft-style-toggle__label {
    color: rgba(36, 49, 58, 0.62);
}

.freetalk-overlay.ft-mode-chatbot .ft-style-toggle[data-ft-current="vn"] .ft-style-toggle__label[data-mode="vn"],
.freetalk-overlay.ft-mode-chatbot .ft-style-toggle[data-ft-current="chatbot"] .ft-style-toggle__label[data-mode="chatbot"] {
    color: #fffaf2;
}

.freetalk-overlay.ft-mode-chatbot .ft-edit-user-btn {
    background: rgba(47, 111, 115, 0.08);
    border-color: rgba(47, 111, 115, 0.16);
    color: #23575b;
    box-shadow: none;
}

.freetalk-overlay.ft-mode-chatbot .ft-edit-user-btn:hover {
    background: rgba(47, 111, 115, 0.14);
    border-color: rgba(47, 111, 115, 0.28);
}

.freetalk-overlay.ft-mode-chatbot .ft-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
}

.freetalk-overlay.ft-mode-chatbot .ft-avatar-area {
    display: none;
}

.freetalk-overlay.ft-mode-chatbot .ft-right {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    max-width: 960px;
    min-width: 0;
    min-height: 0;
    margin: 0 auto;
    border-left: none;
    background: transparent;
    overflow-x: hidden;
}

.freetalk-overlay.ft-mode-chatbot .ft-dialogue {
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    justify-content: stretch;
    padding: 18px clamp(14px, 2.5vw, 26px) 8px;
    overflow-x: hidden;
}

.freetalk-overlay.ft-mode-chatbot .ft-dialogue-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    max-height: none;
    min-height: 0;
    padding: 4px 2px 16px;
    gap: 0.85rem;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: #24313a;
    font-size: 1rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    cursor: default;
    overflow-x: hidden;
}

.freetalk-overlay.ft-mode-chatbot .ft-dialogue-box::-webkit-scrollbar {
    width: 4px;
}

.freetalk-overlay.ft-mode-chatbot .ft-dialogue-box::-webkit-scrollbar-thumb {
    background: rgba(47, 111, 115, 0.28);
}

.freetalk-overlay.ft-mode-chatbot .ft-log-msg {
    display: flex;
    align-items: flex-end;
    gap: 0.58rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--ft-avatar-radius);
    box-shadow: none;
    color: #24313a;
    line-height: 1.55;
    word-break: normal;
    overflow-wrap: anywhere;
}

.freetalk-overlay.ft-mode-chatbot .ft-log-msg.assistant {
    align-self: stretch;
    justify-content: flex-start;
    background: transparent;
    border: none;
    box-shadow: none;
}

.freetalk-overlay.ft-mode-chatbot .ft-log-msg.user {
    align-self: stretch;
    justify-content: flex-end;
}

.freetalk-overlay.ft-mode-chatbot .ft-log-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(47, 111, 115, 0.11);
    color: #23575b;
    font-size: 1.28rem;
    box-shadow: 0 10px 22px rgba(32, 82, 87, 0.12);
}

.freetalk-overlay.ft-mode-chatbot .ft-log-msg.user .ft-log-avatar {
    display: none;
}

.freetalk-overlay.ft-mode-chatbot .ft-log-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    max-width: min(76%, 660px);
    padding: 0.88rem 1.05rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 249, 247, 0.86));
    border: 1px solid rgba(47, 111, 115, 0.11);
    box-shadow: 0 8px 22px rgba(32, 82, 87, 0.08);
}

.freetalk-overlay.ft-mode-chatbot .ft-log-msg.assistant .ft-log-content {
    border-bottom-left-radius: 4px;
}

.freetalk-overlay.ft-mode-chatbot .ft-log-msg.user .ft-log-content {
    align-items: flex-end;
    text-align: right;
    max-width: min(54%, 430px);
    border-bottom-right-radius: 4px;
    background: linear-gradient(135deg, #2f6f73, #4f8b86);
    border-color: rgba(47, 111, 115, 0.18);
    color: #fff;
    box-shadow: 0 8px 20px rgba(32, 82, 87, 0.18);
}

.freetalk-overlay.ft-mode-chatbot .ft-log-name {
    color: rgba(47, 111, 115, 0.72);
    font-size: 0.78rem;
    margin-bottom: 0;
}

.freetalk-overlay.ft-mode-chatbot .ft-log-msg.user .ft-log-name {
    display: none;
}

.freetalk-overlay.ft-mode-chatbot .ft-log-msg.user .ft-msg-time {
    color: rgba(255, 255, 255, 0.46);
}

.freetalk-overlay.ft-mode-chatbot .ft-log-body {
    min-height: 1.45em;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.freetalk-overlay.ft-mode-chatbot .ft-msg-time {
    color: rgba(36, 49, 58, 0.36);
    font-size: 0.68rem;
    margin-top: 0.1rem;
}

.freetalk-overlay.ft-mode-chatbot .ft-action {
    background: linear-gradient(135deg, rgba(47, 111, 115, 0.07), rgba(201, 138, 104, 0.035));
    border-left-color: rgba(47, 111, 115, 0.3);
    color: rgba(45, 65, 70, 0.82);
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.freetalk-overlay.ft-mode-chatbot .ft-scene,
.freetalk-overlay.ft-mode-chatbot .ft-thought {
    background: rgba(47, 111, 115, 0.045);
    border-color: rgba(47, 111, 115, 0.12);
    border-left-color: rgba(201, 138, 104, 0.32);
    color: rgba(45, 65, 70, 0.74);
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.freetalk-overlay.ft-mode-chatbot .ft-log-msg.user .ft-action {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.34);
    color: rgba(255, 255, 255, 0.78);
}

.freetalk-overlay.ft-mode-chatbot .ft-speaker {
    color: #2f6f73;
}

.freetalk-overlay.ft-mode-chatbot .ft-empty-message {
    color: rgba(36, 49, 58, 0.42);
}

.freetalk-overlay.ft-mode-chatbot .ft-thinking-message {
    min-width: 0;
    border: none;
    box-shadow: none;
}

.freetalk-overlay.ft-mode-chatbot .ft-thinking-body {
    min-width: 44px;
}

.freetalk-overlay.ft-mode-chatbot .ft-thinking-dots span {
    background: rgba(47, 111, 115, 0.82);
    box-shadow: 0 0 10px rgba(47, 111, 115, 0.2);
}

.freetalk-overlay.ft-mode-chatbot .ft-input-area {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 8px 18px 18px;
    padding-bottom: max(18px, calc(10px + env(safe-area-inset-bottom, 0px)));
}

.freetalk-overlay.ft-mode-chatbot .ft-image-preview {
    padding: 0 8px;
}

.freetalk-overlay.ft-mode-chatbot .ft-image-preview img {
    border-color: rgba(47, 111, 115, 0.18);
}

.freetalk-overlay.ft-mode-chatbot .ft-input-row {
    gap: 6px;
    padding: 6px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(47, 111, 115, 0.16);
    box-shadow: 0 16px 42px rgba(32, 82, 87, 0.14);
}

.freetalk-overlay.ft-mode-chatbot .ft-input {
    min-height: 36px;
    padding: 8px 10px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: #24313a;
}

.freetalk-overlay.ft-mode-chatbot .ft-input::placeholder {
    color: rgba(36, 49, 58, 0.38);
}

.freetalk-overlay.ft-mode-chatbot .ft-input:focus {
    border-color: transparent;
}

.freetalk-overlay.ft-mode-chatbot .ft-upload-btn {
    color: rgba(36, 49, 58, 0.52);
    filter: none;
}

.freetalk-overlay.ft-mode-chatbot .ft-action-btn {
    border-color: rgba(47, 111, 115, 0.16);
    color: #23575b;
}

.freetalk-overlay.ft-mode-chatbot .ft-action-btn.active {
    background: rgba(47, 111, 115, 0.12);
    border-color: rgba(47, 111, 115, 0.38);
    color: #23575b;
    box-shadow: none;
}

.freetalk-overlay.ft-mode-chatbot .ft-send-btn {
    background: linear-gradient(135deg, #2f6f73, #4f8b86);
    box-shadow: 0 8px 18px rgba(32, 82, 87, 0.2);
}

@media (max-width: 768px) {
    .freetalk-overlay.ft-mode-chatbot .ft-dialogue {
        padding: 14px 12px 6px;
    }

    .freetalk-overlay.ft-mode-chatbot .ft-dialogue-box {
        padding-bottom: 10px;
        font-size: 0.94rem;
    }

    .freetalk-overlay.ft-mode-chatbot .ft-log-avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        font-size: 1.1rem;
    }

    .freetalk-overlay.ft-mode-chatbot .ft-log-content {
        max-width: 82%;
        padding: 0.78rem 0.92rem;
    }

    .freetalk-overlay.ft-mode-chatbot .ft-input-area {
        padding: 6px 12px 14px;
        padding-bottom: max(14px, calc(8px + env(safe-area-inset-bottom, 0px)));
    }
}

@media (max-width: 560px) {
    .ft-header {
        gap: 6px;
    }

    .ft-header-actions {
        gap: 6px;
    }

    .ft-style-toggle {
        height: 28px;
    }

    .ft-style-toggle__label {
        min-width: 38px;
        padding: 0 8px;
        font-size: 0.7rem;
    }

    .ft-edit-user-btn span:last-child {
        display: none;
    }

    .ft-edit-user-btn {
        width: 32px;
        height: 32px;
        justify-content: center;
        padding: 0;
        border-radius: 50%;
    }
}

@media (max-width: 380px) {
    .ft-char-name {
        font-size: 0.92rem;
    }

    .ft-style-toggle__label {
        min-width: 32px;
        padding: 0 6px;
        font-size: 0.66rem;
    }

    .ft-back-btn {
        padding: 6px;
        margin-right: 0;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .freetalk-overlay.ft-mode-chatbot .ft-main {
        flex-direction: column;
    }

    .freetalk-overlay.ft-mode-chatbot .ft-avatar-area {
        display: none;
    }

    .freetalk-overlay.ft-mode-chatbot .ft-right {
        width: 100%;
        max-width: 920px;
    }

    .freetalk-overlay.ft-mode-chatbot .ft-dialogue {
        padding: 8px 12px 4px;
    }

    .freetalk-overlay.ft-mode-chatbot .ft-dialogue-box {
        min-height: 0;
        font-size: 0.86rem;
    }

    .freetalk-overlay.ft-mode-chatbot .ft-input-area {
        padding: 4px 12px 8px;
    }
}
