.floating-system-wrapper {
    position: fixed;
    bottom: 30px;
    inset-inline-end: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

/* Master FAB */
.master-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #337ab7;
    color: #fff;
    border: none;
    box-shadow: 0 10px 25px rgba(51, 122, 183, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.master-fab:hover { transform: scale(1.1) rotate(5deg); }
.master-fab.active { background: #1e293b; transform: rotate(135deg); }
.master-fab .hidden { display: none; }

/* Options Menu */
.fab-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.fab-options.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.option-item {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    transition: all 0.3s ease;
}

.option-item:hover { transform: scale(1.08); background: #337ab7; color: #fff; }

.option-item.chat-twin { background: #0f172a; color: #337ab7; }
.option-item.chat-twin:hover { color: #fff; }
.option-item.whatsapp { background: #25d366; color: #fff; }

.tooltip {
    position: absolute;
    inset-inline-end: 55px;
    background: #1e293b;
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.option-item:hover .tooltip { opacity: 1; inset-inline-end: 65px; }

/* Digital Twin Window */
.digital-twin-window {
    position: fixed;
    bottom: 110px;
    inset-inline-end: 30px;
    width: 380px;
    height: 550px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: var(--font-sans, system-ui, sans-serif);
}

.digital-twin-window.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chat-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.twin-avatar { position: relative; }
.twin-avatar img { 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    border: 2px solid rgba(255,255,255,0.15); 
    padding: 2px; 
    background: #0f172a; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); 
    object-fit: cover;
}
.online-status {
    position: absolute;
    bottom: 0px;
    inset-inline-end: 0px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #172133;
}

.twin-info h3 { font-size: 17px; margin: 0; font-weight: 700; line-height: 1.2; }
.twin-info p { font-size: 12px; margin: 6px 0 0; color: #94a3b8; }

.close-chat {
    position: absolute;
    top: 20px;
    inset-inline-end: 20px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #f4f7f9;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.chat-social-icons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.chat-social-icons .social-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8fafc;
    color: #337ab7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid #e2e8f0;
}

.chat-social-icons .social-icon-btn:hover {
    background: #337ab7;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(51, 122, 183, 0.3);
    border-color: #337ab7;
}

.msg.system .chat-msg-link {
    color: #337ab7;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.msg.system .chat-msg-link:hover {
    color: #1d5f94;
}

.msg.system .chat-msg-list {
    margin: 8px 0 8px 22px;
    padding: 0;
}

.msg.system .chat-msg-list li {
    margin-bottom: 6px;
}

.msg.system strong {
    color: #337ab7;
    font-weight: 700;
}

.msg {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.msg.system { background: #fff; color: #1e293b; border-end-start-radius: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.03); }
.msg.user { background: linear-gradient(135deg, #337ab7, #2563a8); color: #fff; align-self: flex-end; border-end-end-radius: 4px; box-shadow: 0 4px 15px rgba(51, 122, 183, 0.2); }
.msg.loading { background: #f1f5f9; color: #94a3b8; font-style: italic; }

.chat-input-area {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 16px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    text-align: start;
    transition: all 0.3s ease;
}

[dir="rtl"] .chat-input-area input {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .chat-input-area input::placeholder {
    text-align: right;
}

.chat-input-area input:focus {
    border-color: #337ab7;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(51, 122, 183, 0.1);
}

.chat-input-area button {
    width: 45px;
    height: 45px;
    background: #337ab7;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-input-area button:hover { background: #286090; }

@media (max-width: 480px) {
    .digital-twin-window {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 90px;
    }
}

/* Suggestion Chips */
.suggestion-chips-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    width: 100%;
    align-self: flex-start;
}

.suggestion-chips-label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.suggestion-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: flex-start;
    width: 100%;
}

.suggestion-chips .chip {
    background: #fff;
    color: #337ab7;
    border: 1px solid rgba(51, 122, 183, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    width: fit-content;
}

[dir="rtl"] .suggestion-chips .chip {
    text-align: right;
}

.suggestion-chips .chip:hover {
    background: #337ab7;
    color: #fff;
    border-color: #337ab7;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(51, 122, 183, 0.25);
}
