#smart-mediator-container {
    position: fixed;
    bottom: 17px;
    right: 17px;
    width: 400px;
    max-width: 97vw;
    height: 600px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 10px 38px rgba(67,97,238,0.17);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transform: translateY(170%);
    transition: transform 0.38s cubic-bezier(.42,0,.58,1);
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    border: 1px solid #ededed;
}
#smart-mediator-container.active {
    transform: translateY(0);
}
#mediator-toggle-btn {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 6px 24px rgba(67,97,238,0.18);
}
.mediator-header {
    padding: 20px;
    background: linear-gradient(90deg, #4361ee 40%, #3a0ca3 100%);
    color: white;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mediator-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    font-family: inherit;
    letter-spacing: 1px;
}
.close-mediator {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
}
.mediator-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f9fd;
}
.mediator-footer {
    padding: 13px;
    display: flex;
    border-top: 1px solid #eee;
    background: #f6f8fa;
}
#mediator-message-input {
    flex: 1;
    padding: 13px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    margin-right: 10px;
    font-family: inherit;
    font-size: 16px;
    background: #fff;
}
#mediator-send-btn {
    background: linear-gradient(90deg, #4361ee 60%, #2ec4b6 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 13px 27px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(67,97,238,0.08);
    transition: background 0.2s;
}
#mediator-send-btn:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
}
.role-selection {
    display: flex;
    gap: 15px;
    margin-top: 14px;
    margin-bottom: 14px;
}
.role-card {
    flex: 1;
    min-width: 140px;
    border-radius: 16px;
    padding: 18px 10px 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(67,97,238,0.05);
    background: #f6f8fa;
}
.buyer-card { background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%); color: white; }
.seller-card { background: linear-gradient(135deg, #2ec4b6 0%, #1a936f 100%); color: white; }
.icon-container {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 22px;
}
.select-role {
    background: rgba(255,255,255,0.22);
    border: 1px solid white;
    color: white;
    padding: 7px 14px;
    border-radius: 14px;
    margin-top: 13px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
}
.mediator-form {
    background: #f6f8fa;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(67,97,238,0.09);
    padding: 15px;
    margin-top: 8px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mediator-form h4 {
    margin-top:0;
    margin-bottom:8px;
    font-size: 17px;
    color: #4361ee;
}
.mediator-form input, .mediator-form button {
    width: 100%;
    padding: 9px 13px;
    border-radius: 16px;
    border: 1px solid #bdbdbd;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 4px;
    background: #fff;
}
.mediator-form button {
    background: linear-gradient(90deg, #4361ee 60%, #2ec4b6 100%);
    color: white;
    font-weight: 800;
    border: none;
    font-size: 15px;
    cursor: pointer;
    margin-top: 6px;
}
.ghost-btn {
    background: #bdbdbd;
    color: #fff;
    font-size: 14px;
    border: none;
    cursor: pointer;
    margin-top: 2px;
}
.message {
    padding: 11px 17px;
    margin: 11px 0;
    border-radius: 10px;
    max-width: 85%;
    word-break: break-word;
    font-size: 15px;
    line-height: 1.8;
}
.user-message {
    background: linear-gradient(90deg, #3a0ca3 60%, #4361ee 100%);
    color: white;
    margin-left: auto;
    border-bottom-left-radius: 5px;
    border-top-right-radius: 18px;
}
.ai-message {
    background: #e3e6f7;
    margin-right: auto;
    border-bottom-right-radius: 5px;
    border-top-left-radius: 18px;
}
.welcome-message {
    text-align: center;
    padding: 22px;
    color: #555;
    font-size: 15px;
    animation: fadein 0.9s;
}
.fade-in {
    animation: fadein 0.9s;
}
@keyframes fadein { from{opacity:0;} to{opacity:1;} }
@media (max-width: 600px) {
    #smart-mediator-container {width: 97vw;height: 97vh;bottom: 3vw;right: 3vw;border-radius: 12px;}
    .mediator-header {padding: 11px 6vw 11px 11px;font-size: 16px;}
    .mediator-body {padding: 7px 3vw;}
    .mediator-footer {padding: 8px 3vw;}
    #mediator-message-input {font-size: 14px;}
}