/* === TRIGGER BUTTON === */
.touc-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #1b5e4b;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: background 0.2s;
}
.touc-trigger:hover { background: #14503d; }
.touc-trigger svg { width: 24px; height: 24px; color: #fff; }
.touc-trigger .touc-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #e74c3c;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* === WIDGET WINDOW === */
.touc-widget {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 400px;
    height: 600px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.touc-widget.active { display: flex; }

/* === HEADER / TABS === */
.touc-header {
    border-bottom: 1px solid #e5e5e5;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    flex-shrink: 0;
}
.touc-tabs {
    display: flex;
    gap: 20px;
}
.touc-tab {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    padding: 16px 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    transition: all 0.2s;
}
.touc-tab.active {
    color: #1b5e4b;
    border-bottom-color: #1b5e4b;
}
.touc-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.touc-close:hover { color: #242429; }

/* === CONTENT AREA === */
.touc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* === MESSAGES === */
.touc-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.touc-message {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.touc-message.user {
    margin-left: auto;
    background: #1b5e4b;
    color: #fff;
    border-radius: 8px 8px 2px 8px;
}
.touc-message.assistant,
.touc-message.incoming {
    margin-right: auto;
    background: #f4f4f4;
    color: #242429;
    border-radius: 8px 8px 8px 2px;
}
.touc-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    display: block;
}
.touc-message.user .touc-message-time { color: rgba(255,255,255,0.7); }

/* === INPUT === */
.touc-input-area {
    border-top: 1px solid #e5e5e5;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
    background: #fff;
}
.touc-input {
    flex: 1;
    border: none;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    max-height: 100px;
    outline: none;
    padding: 4px 0;
    line-height: 1.4;
}
.touc-send {
    background: none;
    border: none;
    cursor: pointer;
    color: #1b5e4b;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.touc-send:disabled { color: #ccc; cursor: not-allowed; }

/* === QUICK ACTIONS === */
.touc-quick-action {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 10px 14px;
    background: #fff;
    color: #1b5e4b;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    width: 100%;
}
.touc-quick-action:hover {
    background: #f8f9fa;
    border-color: #1b5e4b;
}

/* === DM LIST === */
.touc-dm-list {
    display: flex;
    flex-direction: column;
}
.touc-dm-item {
    padding: 12px;
    border-bottom: 1px solid #f4f4f4;
    cursor: pointer;
    transition: background 0.15s;
}
.touc-dm-item:hover { background: #f8f9fa; }
.touc-dm-item.unread {
    border-left: 3px solid #f4a261;
    padding-left: 9px;
}
.touc-dm-item.unread .touc-dm-name { font-weight: 600; color: #242429; }
.touc-dm-name { font-size: 14px; color: #242429; }
.touc-dm-company { font-size: 12px; color: #666; margin-top: 2px; }
.touc-dm-preview { font-size: 13px; color: #666; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.touc-dm-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: #999; }

/* === LOCKED STATE === */
.touc-locked {
    text-align: center;
    padding: 40px 24px;
}
.touc-locked-title {
    font-size: 14px;
    font-weight: 600;
    color: #242429;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.touc-locked-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}
.touc-locked-btn {
    display: inline-block;
    background: #1b5e4b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.touc-locked-btn:hover { background: #14503d; }

/* === FULL PAGE (My Account) === */
.touc-fullpage {
    display: flex;
    height: 600px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.touc-sidebar {
    width: 35%;
    border-right: 1px solid #e5e5e5;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.touc-main {
    width: 65%;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.touc-search-box {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e5e5;
}
.touc-search-box input {
    width: 100%;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
}
.touc-search-box input:focus { border-color: #1b5e4b; }

/* === TYPING INDICATOR === */
.touc-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}
.touc-typing span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: toucPulse 1.4s infinite ease-in-out both;
}
.touc-typing span:nth-child(1) { animation-delay: -0.32s; }
.touc-typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes toucPulse {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* === MOBILE === */
@media (max-width: 768px) {
    .touc-trigger {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }
    .touc-widget {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    .touc-fullpage {
        flex-direction: column;
        height: auto;
    }
    .touc-sidebar {
        width: 100%;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
    .touc-main {
        width: 100%;
        height: 60vh;
    }
}
