.nons-chat-row {
    display: flex;
    width: 100%;
}
.nons-chat-row--user {
    justify-content: flex-start;
}
.nons-chat-row--assistant {
    justify-content: flex-end;
}
.nons-chat-bubble {
    max-width: min(92%, 420px);
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}
.nons-chat-meta {
    font-size: 11px;
    opacity: 0.75;
    margin-bottom: 4px;
    padding: 0 4px;
}
.nons-chat-row--user .nons-chat-meta {
    text-align: right;
    color: #7f8c8d;
}
.nons-chat-row--assistant .nons-chat-meta {
    text-align: left;
    color: #95a5a6;
}
.nons-chat-bubble--user {
    background: linear-gradient(135deg, #2ac1da, #48bcb4);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 8px rgba(42, 193, 218, 0.35);
}
.nons-chat-bubble--assistant {
    background: #fff;
    color: #2c3e50;
    border: 1px solid #e4e9ef;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
/* סוכן חכם — ווידג'ט צף (דף השלמת פרופיל) — מחובר ל-body */
.nons-smart-agent {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    inset-inline-end: calc(var(--ph-rail-w, 82px) + 14px);
    inset-inline-start: auto;
    z-index: 10050;
    font-family: inherit;
    direction: rtl;
    pointer-events: none;
}
.nons-smart-agent > * {
    pointer-events: auto;
}
body.ph-drawer-open .nons-smart-agent {
    z-index: 150;
    inset-inline-end: auto;
    inset-inline-start: max(14px, env(safe-area-inset-left, 0px));
}
.nons-smart-agent__fab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 14px 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2ac1da 0%, #1fa8be 55%, #48bcb4 100%);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 8px 28px rgba(42, 193, 218, 0.45), 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: calc(100vw - 32px);
}
.nons-smart-agent__fab-label,
.nons-smart-agent__fab .fa {
    color: #fff !important;
}
.nons-smart-agent__fab:hover,
.nons-smart-agent__fab:focus {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(42, 193, 218, 0.5), 0 4px 12px rgba(0, 0, 0, 0.14);
    outline: none;
    color: #fff;
}
.nons-smart-agent__fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-size: 18px;
}
.nons-smart-agent__badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.45);
}
.nons-smart-agent__panel {
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    width: min(400px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 120px));
    display: none;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(44, 62, 80, 0.22), 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e4e9ef;
    z-index: 2;
}
.nons-smart-agent.is-open .nons-smart-agent__panel {
    display: flex !important;
    bottom: 64px;
    animation: nons-smart-agent-in 0.28s ease;
}
@keyframes nons-smart-agent-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.nons-smart-agent__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 12px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    flex-shrink: 0;
}
.nons-smart-agent__head-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.nons-smart-agent__avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2ac1da, #48bcb4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.nons-smart-agent__title {
    display: block;
    font-size: 15px;
    line-height: 1.35;
    color: #fff;
}
.nons-smart-agent__subtitle {
    display: block;
    font-size: 11px;
    opacity: 0.82;
    margin-top: 2px;
    font-weight: normal;
}
.nons-smart-agent__head-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.nons-smart-agent__icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 34px;
    text-align: center;
    padding: 0;
}
.nons-smart-agent__icon-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}
.nons-smart-agent__log {
    flex: 1 1 auto;
    min-height: 200px;
    max-height: none;
    margin: 0;
    border: none;
    border-radius: 0;
    background: #f4f7f9;
}
.nons-smart-agent .nons-onb-chatlog {
    max-height: 340px;
}
.nons-smart-agent__foot {
    padding: 10px 12px 12px;
    background: #fff;
    border-top: 1px solid #e8ecf1;
    flex-shrink: 0;
}
.nons-smart-agent__gen-content {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 10px 14px;
    border: 1px solid #89d4e8;
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f9fc, #f0fffe);
    color: #0f4c5c;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
}
.nons-smart-agent__gen-content:hover:not(:disabled) {
    filter: brightness(1.03);
    border-color: #2ac1da;
}
.nons-smart-agent__gen-content:disabled {
    opacity: 0.65;
    cursor: wait;
}
.nons-smart-agent__composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.nons-smart-agent__composer textarea.form-control {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    margin: 0;
    border-radius: 12px;
    resize: none;
    font-size: 15px;
    padding: 10px 12px;
}
.nons-smart-agent__send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2ac1da, #48bcb4);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(42, 193, 218, 0.35);
}
.nons-smart-agent__send:hover {
    filter: brightness(1.05);
}
.nons-smart-agent.is-open .nons-smart-agent__composer {
    padding-left: max(72px, calc(58px + env(safe-area-inset-left, 0px)));
}
.nons-smart-agent.is-open .nons-smart-agent__send {
    position: relative;
    z-index: 2;
}
.nons-smart-agent .nons-chat-row--assistant {
    flex-direction: column;
    align-items: flex-end;
}
.nons-smart-agent__choices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.65rem 0 0.25rem;
    padding: 0 0.35rem;
}
.nons-smart-agent__choice-btn {
    display: block;
    width: 100%;
    text-align: right;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 1px solid #c7d2fe;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    color: #312e81;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.nons-smart-agent__choice-btn:hover,
.nons-smart-agent__choice-btn:focus {
    border-color: #6366f1;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.22);
    transform: translateY(-1px);
    outline: none;
}
.nons-smart-agent .nons-chat-row--user {
    flex-direction: column;
    align-items: flex-start;
}

.nons-onb-toast.alert {
    border-radius: 6px;
    border: none;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
    direction: rtl;
    text-align: right;
}
.nons-onb-toast.alert .fa {
    margin-left: 8px;
}

/* פריט תפריט — השלמת פרופיל */
.sidebar-menu > li.nons-nav-onb > a {
    background: rgba(42, 193, 218, 0.08);
    border-radius: 4px;
    margin: 2px 4px;
}
.sidebar-menu > li.nons-nav-onb > a:hover {
    background: rgba(42, 193, 218, 0.16);
}

/* סוכן חכם — מובייל / טאבלט (רייל נפתח מימין ב־RTL) */
@media (max-width: 900px) {
    .nons-smart-agent {
        left: 50%;
        right: auto;
        inset-inline-start: auto;
        inset-inline-end: auto;
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        z-index: 10060;
    }
    body.ph-drawer-open .nons-smart-agent:not(.is-open) {
        visibility: hidden;
        pointer-events: none;
    }
    .nons-smart-agent__fab {
        padding: 12px 18px 12px 14px;
        font-size: 14px;
        min-height: 48px;
    }
    .nons-smart-agent__fab-label {
        display: inline;
        font-size: 14px;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .nons-smart-agent.is-open {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: none;
        inset-inline: 0;
        bottom: 0;
        z-index: 10070;
        pointer-events: auto;
        visibility: visible;
    }
    .nons-smart-agent.is-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 9990;
        pointer-events: auto;
    }
    .nons-smart-agent.is-open .nons-smart-agent__fab {
        opacity: 0;
        pointer-events: none;
    }
    .nons-smart-agent.is-open .nons-smart-agent__panel {
        position: fixed;
        left: 0;
        right: 0;
        inset-inline: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: none;
        max-height: min(88dvh, calc(100dvh - env(safe-area-inset-top, 12px)));
        border-radius: 18px 18px 0 0;
        z-index: 9992;
        animation: nons-smart-agent-sheet-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }
    @keyframes nons-smart-agent-sheet-in {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    .nons-smart-agent .nons-onb-chatlog {
        max-height: none;
        flex: 1 1 auto;
        min-height: 120px;
    }
    .nons-smart-agent__panel {
        display: none;
    }
    .nons-smart-agent.is-open .nons-smart-agent__panel {
        display: flex !important;
        bottom: 0;
    }
    .nons-smart-agent__log {
        min-height: 0;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
    }
    .nons-smart-agent.is-open .nons-smart-agent__foot {
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 767px) {
    .nons-onb-page {
        font-size: 17px;
    }
    .nons-onb-page .form-panel {
        padding: 16px 14px;
    }
    .nons-onb-hero__title {
        font-size: clamp(1.15rem, 4.5vw, 1.35rem);
    }
    .nons-onb-hero__sub {
        font-size: clamp(0.98rem, 3.6vw, 1.05rem);
        line-height: 1.55;
    }
    .nons-onb-missing-list li,
    .nons-onb-chat__head-muted,
    .nons-onb-chat__tip,
    .nons-onb-google-place-cta__explain {
        font-size: 1rem;
    }
}

.nons-smart-agent__composer textarea { flex:1; min-height:44px; max-height:120px; margin:0; border-radius:12px; resize:none; font-size:15px; padding:10px 12px; border:1px solid #d1dae6; width:100%; box-sizing:border-box; font-family:inherit; }
body.nons-smart-agent-open { overflow: hidden; }

/* צ'אט תמיכה ציבורי — ימין פיזי (לא inset-inline-end שב-RTL = שמאל) */
.nons-smart-agent.nons-smart-agent--public {
    inset-inline-end: auto !important;
    inset-inline-start: auto !important;
    right: max(18px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
}
body.ph-drawer-open .nons-smart-agent.nons-smart-agent--public {
    inset-inline-end: auto !important;
    inset-inline-start: auto !important;
    right: max(18px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
}

