﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg-input);
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
}
button{
    box-sizing: border-box;
}
p, button, h1, h2, h3, h4, h5, h6 {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
i{
    font-style: normal;
}


/* ===================================
   빈 요소 자동 숨김 (empty elements)
   =================================== */
.quick-replies:empty,
.initial-buttons-grid:empty,
.product-url-buttons:empty,
.product-url-inline:empty,
.contract-slider-wrap:empty,
.contract-slider:empty,
.message-card:empty,
.product-meta:empty,
.product-features:empty,
.product-buttons:empty {
    display: none;
}

.online-indicator{
    display: none;
}

.chatbot-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: -webkit-fill-available;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--color-bg-input);
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.action-btn .fa-comments:before {
    content: "\f002";
}

/* Desktop Layout */
@media (min-width: 768px) {
    .chatbot-container {
        max-width: 800px;
        height: 90vh;
        margin: 5vh auto;
        border-radius: 1rem;
        overflow: hidden;
    }
}

@media (min-width: 1024px) {
    .chatbot-container {
        max-width: 1000px;
        height: 85vh;
        margin: 7.5vh auto;
    }
}

/* Header Styles */
.header {
    background: white;
    color: var(--color-text-black);
    padding: 16px;
    z-index: 10;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}


.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
}

.bot-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    overflow: visible;
}

.online-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
}

.bot-details{
    text-align: left;
}

.bot-details h1 {
    font-size: 18px;
    line-height: 1;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--color-text-black);
}

.bot-details p {
    font-size: 12px;
    line-height: 18px;
    color: var(--color-text-gray);
    font-weight: 400;
}

/* Back Button */
.back-btn {
    background: none;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    color: var(--color-icon-default);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    position: absolute;
    left: 0;
}

/* Button Icon (SVG) */
.btn-icon {
    width: 100%;
    height: 100%;
    display: block;
}

/* PC에서 뒤로가기/마이크 버튼 숨김 (URL ?type=pc) */
body.type-pc .back-btn,
body.type-pc .voice-btn {
    display: none !important;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--color-text-gray);
    font-size: 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: absolute;
    right: 0;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    background: var(--gradient-bg);
    background-attachment: fixed; 
}


.message {
    display: flex;
    gap: 0.5rem;
    max-width: 90%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
    overflow: visible;
}

.message-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 1.5rem;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    width: fit-content;
    margin-bottom: 8px;
    font-weight: 400;
}

/* 제품 추천 메시지 내 아이콘 */
.message-bubble .p-icon {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    display: inline-block;
    width: 12px;
    font-size: 11px;
    text-align: center;
    color: var(--color-icon-default);
}

/* 대상 -  */
.message-bubble .p-icon.icon-target::before {
    content: "\f007";  /* 사람 */
}
/* 가격 - 카드 */
.message-bubble .p-icon.icon-price::before {
    content: "\f09d";  /* fa-credit-card */
}

/* 설명 - 체크리스트 */
.message-bubble .p-icon.icon-desc::before {
    content: "\f46d";  /* fa-clipboard-list */
}

.message.user .message-bubble {
    background: var(--color-key-orange);
    color: white;
    border-radius: 20px 20px 0 20px;
    max-width: 320px;
}

.message.bot .message-bubble {
    background: var(--color-bg-white);
    color: var(--color-text-black);
    border: 1px solid var(--color-border);
    border-radius: 0 20px 20px 20px;
    max-width: 380px;
    font-size: 15px;
}

.message-time {
    font-size: 12px;
    color: var(--color-text-gray);
    align-self: flex-start;
    margin-left: 16px;
    font-weight: 300;
}

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
    max-width: 380px;
    margin-bottom: 16px;
    margin-top: 8px;
}


/* Initial Message Button Grid - 7개 버튼 최적화 */
.initial-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    /* flex-direction: column; */
    gap: 8px;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    margin-bottom: 16px;
    margin-top: 8px;
}

/* 7개 버튼을 위한 크기 조정 */

.initial-buttons-grid .initial-action-btn {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 140px;
}


/* Initial Quick Reply Buttons */
.initial-quick-reply-btn {
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text-black);
    padding:12px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: fit-content;
}

/* 초기 메뉴 버튼 공통 ::before */
/*.initial-quick-reply-btn.btn-product-search::before,
.initial-quick-reply-btn.btn-contact::before,
.initial-quick-reply-btn.btn-points::before,
.initial-quick-reply-btn.btn-contract::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    font-size: 12px;
    display: inline-block;
    color:var( --color-icon-default);
}*

/* 각각의 아이콘 */
/*.btn-product-search::before {
    
    color:var(--color-key-orange) !important;
}
.btn-product-search {
    background: 
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, 
            #ff6b00 0%,
            #ffd64e 25%,
            #fffde1 50%,
            #ffd64e 75%,
            #ff6b00 100%
        ) border-box;
    background-size: auto, 300% 300%;
    animation: gradientFlow 3s ease infinite;
    border: 1.5px solid transparent;
    color: var(--color-key-orange);
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%, 0% 50%; }
    50% { background-position: 0% 50%, 100% 50%; }
    100% { background-position: 0% 50%, 0% 50%; }
}*/
/*.initial-quick-reply-btn.btn-contact::before {
    content: "\f2b9";
}

.initial-quick-reply-btn.btn-points::before {
    content: "\f51e";
}

.initial-quick-reply-btn.btn-contract::before {
    content: "\f2c2";
}*/


/* Initial Action Button */
.initial-action-btn {
    background: var(--color-bg-input);
    border: 1px solid var(--color-bg-disabled);
    color: var(--color-text-gray);
    padding: 0.75rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 48px;
    white-space: nowrap;
}

.initial-action-btn:active {
    background: var(--color-border);
    transform: scale(0.98);
}

.quick-reply-btn {
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text-black);
    padding: 0 20px;
    border-radius: 2rem;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 12px 16px;   
}
.btn-retry::before {
    font-family: "Font Awesome 6 Free";       
    font-weight: 900;
    content: "\f021";
    margin-right: 6px;
    font-size: 12px;
    display: inline-block;
    color:var(--color-text-gray);
}

.btn-retry{
    color: var(--color-text-black);
}
.btn-support::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f095";  /* fa-phone */
    margin-right: 6px;
    font-size: 12px;
    display: inline-block;
    color:var(--color-text-gray);
}


/* 공통 스타일 */
.quick-reply-btn.btn-learning::before,
.quick-reply-btn.btn-book::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    font-size: 12px;
    display: inline-block;
    color: var(--color-text-gray);
}

/* 학습 제품 - 태블릿 */
.quick-reply-btn.btn-learning::before {
    content: "\f303";  /* fa-pencil */
}

/* 도서·전집 - 책 */
.quick-reply-btn.btn-book::before {
    content: "\f02d";  /* fa-book */
}
.action-btn {
    
    background:#fff;
    border:1px solid var(--color-border);
    color: var(--color-text-gray);
    padding: 12px 16px;
    border-radius: 2rem;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.action-btn .fa-comments::before{
    font-size: 12px;
}

.btn-auth{
    color: #fff;
    background-color: var(--color-key-orange);
    border: none;
}


/* Product URL Buttons (제품 상세보기) */
.product-url-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom:8px;
    margin-top: 8px;
    margin-bottom: 16px;
}

.product-url-btn {
    background: var(--color-key-orange);
    border: none;
    color: white;
    padding: 0 20px;
    width: 100%;
    border-radius:8px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 40px;
    line-height: 40px;
    white-space: nowrap;
    font-family: 'Pretendard', sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 12px;
    margin-bottom: 12px;
}
.product-url-btn > span{
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-url-btn i {
    font-size: 12px;
}


/* Message Cards */
.message-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--color-bg-gray);
    width: 100%;
    max-width: 320px;
}

.card-title {
    font-weight: 700;
    color: var(--color-text-black);
    margin-bottom: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.progress-card {
    background: white;
    border: 1px solid var(--color-bg-gray);
}

.progress-card .card-title {
    color: var(--color-text-black);
}

.service-card {
    background: linear-gradient(135deg, #fef7ed, #fed7aa);
    border: 1px solid #fdba74;
}

.service-card .card-title {
    color: #c2410c;
}

.delivery-card {
    background: linear-gradient(135deg, #faf5ff, #e9d5ff);
    border: 1px solid #d8b4fe;
}

.delivery-card .card-title {
    color: #7c2d12;
}

.progress-item {
    margin-bottom: 0.75rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.subject-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-black);
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-percent {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text-black);
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

.status-excellent {
    background: #dcfce7;
    color: #166534;
}

.status-good {
    background: #fef3c7;
    color: #92400e;
}

.status-needs-work {
    background: #fee2e2;
    color: #991b1b;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-border);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

.progress-excellent {
    background: #10b981;
}

.progress-good {
    background: #f59e0b;
}

.progress-needs-work {
    background: #ef4444;
}

.service-item, .delivery-info {
    background: white;
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.service-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-black);
}

.service-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-auto {
    background: #fed7aa;
    color: #c2410c;
}

.service-date {
    font-size: 0.75rem;
    color: var(--color-text-gray);
}

.delivery-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.delivery-label {
    color: var(--color-text-gray);
}

.delivery-value {
    color: var(--color-text-black);
    font-weight: 500;
}

.tracking-number {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

.delivery-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: #fed7aa;
    color: #c2410c;
    border-radius: 9999px;
}

.delivery-expected {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #e9d5ff;
    border-radius: 0.75rem;
    text-align: center;
}

.delivery-expected span {
    color: #7c2d12;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 0 20px 20px 20px;
    height: 48px;
    align-items: center;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--color-key-orange);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

/* 유저 로딩 인디케이터 */
.user-typing-dots {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--color-key-orange);
    border-radius: 20px 20px 0 20px;
    height: 48px;
    align-items: center;
}

.user-typing-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.user-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.user-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-2px);
        opacity: 1;
    }
}

/* Input Container */
.input-container {
    background: var(--color-bg-white);
    padding: 0.875rem;
    border-top: 1px solid var(--color-bg-gray);
    position: sticky;
    bottom: 0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#messageInput{
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-input);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    font-family: 'Pretendard', sans-serif;
    height: 48px;
    line-height: 48px;
    font-weight: 400;
}

#messageInput::placeholder {
    color: var(--color-text-gray);
}

#messageInput:focus {
    background: white;
    border:var(--stroke-orange)
}

.send-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: linear-gradient(135deg, var(--color-key-orange), #FF9A3E);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 122, 0, 0.3);
    flex-shrink: 0;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Voice Button */
.voice-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    color: var(--color-icon-default);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    transition: all 0.2s;
    flex-shrink: 0;
}


.voice-btn.recording {
    background: var(--color-key-orange);
    border-color: var(--color-key-orange);
    animation: pulse 1.5s infinite;
}

.voice-btn.recording:hover {
    background: var(--color-key-orange-hover);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 50;
    display: none;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0;
}

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

.menu-content {
    background: var(--color-bg-white);
    width: 280px;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
}

.menu-overlay.active .menu-content {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.menu-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-black);
    margin: 0;
}

.close-menu-btn {
    background: none;
    border: none;
    color: var(--color-text-gray);
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.close-menu-btn:hover {
    background: var(--color-bg-gray);
    color: var(--color-bg-white);
}

.menu-list {
    flex: 1;
}

.menu-list-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-black);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
}

.menu-list-item > i{
    margin-right: 8px;
}


.menu-item-icon {
    display: none;
}

.menu-item-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-black);
}

.menu-item-arrow {
    color: var(--color-icon-default);
    font-size: 0.875rem;
}



/* 제품 카드 스타일 */
.product-card {
    background: linear-gradient(135deg, var(--color-bg-white) 0%, var(--color-bg-input) 100%);
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: var(--color-key-orange);
}

.product-card .card-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-key-orange);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ffe5dc;
}

/* 메타 정보 (연령, 과목) */
.product-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.meta-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #e7f3ff;
    color: #0066cc;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* 한줄 소개 */
.product-description {
    color: #495057;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--color-bg-input);
    border-radius: 8px;
    border-left: 3px solid var(--color-key-orange);
}

/* 학습 방식 */
.product-learning-mode {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--color-bg-white);
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* 주요 강점 */
.product-features {
    background: var(--color-bg-input);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.features-title {
    font-size: 13px;
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
}

.feature-item {
    color: #495057;
    font-size: 13px;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.feature-item:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* 가격 */
.product-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-key-orange);
    margin: 15px 0;
    padding: 12px;
    background: #fff5f0;
    border-radius: 8px;
    text-align: center;
}

/* 버튼 */
.product-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.product-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-btn[data-action="detail"] {
    background: white;
    color: var(--color-key-orange);
    border: 1px solid var(--color-key-orange);
}

.product-btn[data-action="detail"]:hover {
    background: var(--color-key-orange);
    color: white;
}

.product-btn[data-action="consult"] {
    background: var(--color-key-orange);
    color: white;
}

.product-btn[data-action="consult"]:hover {
    background: #ff5520;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}


/* 계약 카드 슬라이더 */
.contract-slider-wrap {
    width: 100%;
    max-width: 420px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 0.75rem;
    padding-bottom: 0.25rem;
}

.contract-slider-wrap::-webkit-scrollbar {
    display: none;
}

.contract-slider {
    display: flex;
    gap: 0.875rem;
    padding: 0.25rem 0.125rem 0.5rem;
    width: max-content;
}

.contract-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    min-width: 180px;
    max-width: 190px;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--color-bg-gray);
    transition: transform 0.2s, box-shadow 0.2s;
}

.contract-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.contract-card-banner {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.contract-card-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.contract-card-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255,255,255,0.3);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    backdrop-filter: blur(4px);
}

.contract-card-body {
    padding: 1rem
}

.contract-card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text-black);
    margin-bottom: 0.625rem;
    line-height: 1.4;
    word-break: keep-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.contract-card-subtitle {
    font-size: 0.6875rem;
    color: var(--color-text-gray);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.contract-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.contract-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.375rem;
}

.contract-label {
    color: var(--color-icon-default);
    flex-shrink: 0;
    font-size: 0.6875rem;
}

.contract-value {
    color: var(--color-text-black);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
    font-size: 0.6875rem;
}

.contract-status {
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
}


/* GPT 응답 내 제품명 헤더 */
.chat-product-title {
    font-weight: 600;
    color: var(--color-text-black);
    margin-top: 20px;
    margin-bottom: 0;
    padding-top: 20px;
    border-top: 1px solid var(--color-bg-gray);
    margin-bottom: 4px;
}

.chat-product-title:first-child {
    margin-top: 0.25rem;
    padding-top: 0;
    border-top: none;
}

/* 음성 인식 상태 */
.voice-status-bar {
    display: none;
    width: 100%;
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.75rem;
    font-family: 'Pretendard', sans-serif;
}

.voice-status-bar.active {
    display: block;
}

.voice-status-bar.listening {
    color: var(--color-key-orange);
}

.voice-status-bar.idle {
    color: var(--color-text-gray);
}

/* 음파 시각화 */
.voice-wave-wrap {
    display: none;
    align-items: center;
    gap: 2px;
    flex: 1;
    height: 48px;
    justify-content: center;
    padding: 0 8px;
}

.voice-wave-wrap.active {
    display: flex;
}

.voice-wave-bar {
    width: 3px;
    background: var(--color-border);
    border-radius: 2px;
    animation: waveIdle 1s infinite ease-in-out;
}

.voice-wave-wrap.listening .voice-wave-bar {
    background: var(--color-key-orange);
    animation: waveListen 0.6s infinite ease-in-out alternate;
}

@keyframes waveIdle {
    0%, 100% { height: 4px; }
    50% { height: 4px; }
}

@keyframes waveListen {
    0% { height: 6px; }
    100% { height: 28px; }
}

.voice-wave-bar:nth-child(odd) { animation-delay: 0.1s; }
.voice-wave-bar:nth-child(3n) { animation-delay: 0.2s; }
.voice-wave-bar:nth-child(5n) { animation-delay: 0.05s; }
.voice-wave-bar:nth-child(7n) { animation-delay: 0.15s; }

/* SMS 인증 모달 — Thinky UI Component Library 기반 */
.sms-auth-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--color-dim); z-index: 100;
    display: none; align-items: center; justify-content: center;
    padding: var(--space-16);
}
.sms-auth-overlay.active { display: flex; }
.sms-auth-modal {
    background: var(--color-bg-white); border-radius: var(--radius-popup); width: 100%; max-width: 360px;
     overflow-y: auto; max-height: 90vh;
    font-family: var(--font-contents-family);
    margin: auto;
}
.sms-auth-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-20) var(--space-20) var(--space-16);
}
.sms-auth-header h3 {
    font-family: var(--font-title-family); font-weight: var(--font-title-weight);
    font-size: var(--font-title-size); line-height: var(--font-title-line);
    color: var(--color-text-black); margin: 0;
}
.sms-auth-close {
    background: none; border: none; cursor: pointer; padding: 6px;
    border-radius: var(--radius-full); width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-icon-default); flex-shrink: 0;
}
.sms-auth-close svg { width: 24px; height: 24px; }
.sms-auth-body { padding: 0 var(--space-20) var(--space-16); }
.sms-field { margin-bottom: var(--space-16); }
.sms-field label {
    display: block; font-size: var(--font-sub-size); font-weight: var(--font-floating-weight);
    color: var(--color-text-gray); margin-bottom: var(--space-4);
    line-height: var(--font-sub-line);
}
.sms-field input {
    width: 100%; padding: var(--padding-input); border: var(--stroke-border);
    border-radius: var(--radius-input); font-size: var(--font-contents-size);
    font-family: var(--font-contents-family); outline: none; transition: all 0.2s;
    height: var(--size-input-height); box-sizing: border-box;
    background: var(--color-bg-input);
}
.sms-field input:focus { border-color: var(--color-key-orange); background: var(--color-bg-white); box-shadow: 0 0 0 2px var(--color-bg-orange-light); }
.sms-phone-row, .sms-code-row { display: flex; gap: var(--space-8); align-items: center; }
.sms-phone-row input, .sms-code-row input { flex: 1; }

/* Full Button (Orange) — 발송 버튼 */
.sms-send-btn {
    padding: var(--padding-btn); background: var(--color-key-orange); color: var(--color-text-white);
    border: none; border-radius: var(--radius-btn); font-size: var(--font-contents-size);
    font-weight: var(--font-contents-bold-weight); cursor: pointer; white-space: nowrap;
    font-family: var(--font-contents-family); height: var(--size-btn-height);
    min-width: 72px; transition: all 0.2s;
}
.sms-send-btn:hover { background: var(--color-key-orange-hover); }
.sms-send-btn:disabled { background: var(--color-bg-disabled); color: var(--color-text-white); cursor: not-allowed; }

.sms-timer {
    font-size: var(--font-contents-size); font-weight: var(--font-contents-bold-weight);
    color: var(--color-key-orange); min-width: 45px; text-align: right;
}
.sms-resend-link {
    background: none; border: none; color: var(--color-text-gray); font-size: var(--font-sub-size);
    cursor: pointer; text-decoration: underline; padding: var(--space-4) 0;
    font-family: var(--font-contents-family);
}
.sms-resend-link:hover { color: var(--color-key-orange); }
.sms-error { color: var(--color-key-orange); font-size: var(--font-sub-size); min-height: 0; margin-top: 0; }
.sms-error:not(:empty) { min-height: 1rem; margin-top: var(--space-4); }

.sms-auth-footer {
    display: flex; gap: var(--space-8); padding: var(--space-16) var(--space-20);
}

/* Line Button (Gray) — 취소 */
.sms-cancel-btn {
    flex: 1; padding: var(--padding-btn); border: var(--stroke-border); background: var(--color-bg-white);
    border-radius: var(--radius-btn); font-size: var(--font-contents-size);
    font-weight: var(--font-contents-bold-weight); cursor: pointer;
    color: var(--color-text-gray); font-family: var(--font-contents-family);
    height: var(--size-btn-height); transition: all 0.2s;
}
.sms-cancel-btn:hover { background: var(--color-bg-gray); border-color: var(--color-icon-default); }

/* Full Button (Orange) — 인증 확인 */
.sms-verify-btn {
    flex: 1; padding: var(--padding-btn); border: none; background: var(--color-key-orange);
    border-radius: var(--radius-btn); font-size: var(--font-contents-size);
    font-weight: var(--font-contents-bold-weight); cursor: pointer;
    color: var(--color-text-white); font-family: var(--font-contents-family);
    height: var(--size-btn-height); transition: all 0.2s;
}
.sms-verify-btn:disabled { background: var(--color-bg-disabled); cursor: not-allowed; }


/* 개인정보 안내 */
.sms-privacy-notice {
    margin-top: var(--space-16); padding: var(--space-10);
    background: var(--color-bg-input); border-radius: var(--radius-card);
    border: var(--stroke-border);
}
.sms-privacy-title { font-size: var(--font-sub-size); font-weight: var(--font-contents-bold-weight); color: var(--color-text-black); margin-bottom: var(--space-4); }
.sms-privacy-notice p { font-size: 11px; color: var(--color-text-gray); line-height: 1.5; margin: 0 0 var(--space-4); }
.sms-privacy-notice ul { margin: 0; padding-left: var(--space-16); }
.sms-privacy-notice li { font-size: 11px; color: var(--color-text-gray); line-height: 1.6; }


/*미디어쿼리*/
/* Tablet Specific */
@media (min-width: 768px) and (max-width: 1023px) {
    .chatbot-container {
        height: 95vh;
        margin: 2.5vh auto;
    }
}


/*769~  pc분기*/
@media (min-width: 769px) {
    
    .contract-slider-wrap {
        max-width: 520px;
    }
    
    .contract-card {
        min-width: 200px;
        max-width: 210px;
    }
    
    .contract-card-banner {
        height: 120px;
    }
    
    .contract-card-icon {
        font-size: 3rem;
    }
    
    .contract-card-title {
        font-size: 0.9375rem;
    }
    
    .contract-label,
    .contract-value {
        font-size: 0.75rem;
    }

    /*hover 효과 pc에서만 적용*/

    .action-btn:hover {
        color:var(--color-key-orange);
        border: 1px solid var(--color-card-accent);
    }
    .initial-action-btn:hover {
    background: var(--color-bg-gray);
    border-color: var(--color-icon-default);
    color: var(--color-text-black);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    }

    .initial-quick-reply-btn:hover,
    .quick-reply-btn:hover,
    .initial-quick-reply-btn.btn-product-search:hover{
        color:var(--color-key-orange);
        border: 1px solid var(--color-key-orange);
    }
    .btn-auth:hover{
        color: #fff;
        border: none;
        background-color: var(--color-key-orange-hover);
    }
    .initial-quick-reply-btn:hover::before,
    .quick-reply-btn:hover::before{
        color:var(--color-key-orange) !important;
    }
    .back-btn:hover {
    color: var(--color-text-black);
    }

    .menu-btn:hover {
    background: var(--color-bg-gray);
    }
    .menu-btn:hover {
        background: rgba(255,255,255,0.3);
    }
    /* Full Button (Orange) — 인증 확인 */
    .sms-verify-btn:hover:not(:disabled) { background: var(--color-key-orange-hover); }
    .sms-auth-close:hover { background: var(--color-bg-gray); color: var(--color-text-black); }

    
    .product-url-btn:hover {
        background: var(--color-key-orange-hover);
    }

    .input-container {
        padding: 1.25rem 1.5rem;
    }

    .menu-content {
        width: 320px;
    }
    
    .menu-header {
        padding: 2rem 1.5rem 1.25rem;
    }
    
    .menu-list-item {
        padding: 1.25rem 1.5rem;
    }
    
    .menu-item-text {
        font-size: 1.125rem;
    }
    
    .menu-list-item:hover {
        background: var(--color-bg-gray);
    }

    .menu-list-item:active {
        background: var(--color-border);
    }
}/*end of min-width 769px*/

/*mo 분기점 768*/
@media (max-width: 768px) {
    .user-typing-dots{
        height: 40px;
    }
    .bot-details h1{
        font-size: 16px;
    }
    .product-card {
        padding: 15px;
    }
    
    .product-card .card-title {
        font-size: 16px;
    }
    
    .product-description {
        font-size: 13px;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    .product-buttons {
        flex-direction: column;
    }
    
    .product-btn {
        width: 100%;
    }

    .initial-quick-reply-btn{
        font-size: 14px;
    }
    .message.user .message-bubble,
    .message.bot .message-bubble,
    .product-url-btn{
        max-width: 280px;
        font-size: 14px;
        
    }
    .message.user .message-bubble,
    .message.bot .message-bubble{
        padding: 12px 16px;
    }
    .quick-reply-btn,
    
    .action-btn{
        font-size: 14px;
    }

    .messages-container{
        background: radial-gradient(160% 80% at 50% 96.45%, #FFD0B0 0%, #FFEEE0 42.79%, #FFFBF9 67.31%, #FAF9F8 100%);
    }
}/*end of max-width 768px*/
@media (max-width: 480px) {
    .menu-content {
        width: 100%;
    }
    .chatbot-container {
        max-width: 100%;
    }
    
    .header {
        padding: 16px 10px;
    }
    
    .messages-container {
        padding: 20px;
    }
    
    .message-bubble {
        font-size: 14px;
    }
    

    .input-container {
        padding: 0.5rem 0.75rem;
    }

    .input-wrapper {
        gap: 0.375rem;
    }

    #messageInput {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .voice-btn,
    .send-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    #messageInput{
        height: 40px;
        line-height: 40px;
    }

}/*end of max-width 480px*/
/* Safe Area for iOS */
@supports (padding: max(0px)) {
    .header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
    
    .input-container {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}
