/* NekretnineXpert property assistant */
.nx-chat-launcher,.nx-chat-panel{font-family:"DM Sans",Manrope,system-ui,-apple-system,"Segoe UI",sans-serif}
.nx-chat-launcher{position:fixed;right:22px;bottom:22px;z-index:1090;display:flex;align-items:center;gap:10px;border:1px solid rgba(223,185,105,.58);border-radius:999px;background:#111820;color:#fff;padding:11px 17px 11px 12px;box-shadow:0 12px 34px rgba(0,0,0,.25);font-size:14px;font-weight:750;cursor:pointer;transition:transform .2s,box-shadow .2s,background .2s}
.nx-chat-launcher:hover{transform:translateY(-2px);background:#1a222b;box-shadow:0 16px 38px rgba(0,0,0,.3)}
.nx-chat-launcher-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#d7ad58;color:#12161b;font-size:22px;line-height:1}
.nx-chat-launcher-label{white-space:nowrap}
.nx-chat-panel{position:fixed;z-index:1091;right:22px;bottom:82px;width:min(420px,calc(100vw - 28px));height:min(690px,calc(100dvh - 112px));display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(215,173,88,.36);border-radius:22px;background:#fff;color:#1b2229;box-shadow:0 24px 80px rgba(0,0,0,.28)}
.nx-chat-panel[hidden]{display:none!important}
.nx-chat-header{flex:0 0 auto;display:flex;align-items:center;gap:11px;padding:17px 16px;background:#111820;color:#fff;border-bottom:1px solid rgba(255,255,255,.07)}
.nx-chat-avatar{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:#d7ad58;color:#17191c;font-weight:900;font-size:13px;letter-spacing:-.05em}
.nx-chat-header-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.nx-chat-header-copy strong{font-size:15px;font-weight:800}
.nx-chat-header-copy span{font-size:11px;color:#b9c0c6;line-height:1.35}
.nx-chat-close{flex:0 0 auto;width:34px;height:34px;border:0;border-radius:50%;background:rgba(255,255,255,.09);color:#fff;font-size:25px;line-height:1;cursor:pointer}
.nx-chat-messages{flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;padding:17px 14px 12px;display:flex;flex-direction:column;align-items:stretch;gap:12px;background:linear-gradient(180deg,#fff,#faf9f6)}
.nx-chat-message{max-width:94%;border-radius:16px;padding:11px 13px;font-size:13px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.nx-chat-assistant{align-self:flex-start;background:#f0f1f2;border:1px solid #e7e9eb;border-bottom-left-radius:5px;color:#20272e}
.nx-chat-user{align-self:flex-end;background:#18212a;color:#fff;border-bottom-right-radius:5px}
.nx-chat-suggestions{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 2px}
.nx-chat-suggestions button{border:1px solid #e0d3b7;border-radius:999px;background:#fffaf0;color:#4c3b1a;padding:8px 10px;font-size:11px;font-weight:750;cursor:pointer;text-align:left}
.nx-chat-suggestions button:hover{background:#f4ead5}
.nx-chat-status{flex:0 0 auto;padding:0 16px 9px;background:#fff;font-size:11px;color:#80662f}
.nx-chat-form{flex:0 0 auto;display:flex;align-items:flex-end;gap:9px;padding:11px 12px;border-top:1px solid #e9e8e4;background:#fff}
.nx-chat-form textarea{flex:1;min-width:0;max-height:104px;resize:none;border:1px solid #dfe2e4;border-radius:14px;background:#fbfbfa;padding:12px 12px;color:#1d242a;font:inherit;font-size:13px;line-height:1.4;outline:none}
.nx-chat-form textarea:focus{border-color:#b99245;box-shadow:0 0 0 3px rgba(215,173,88,.16)}
.nx-chat-form>button{flex:0 0 auto;width:43px;height:43px;border:0;border-radius:13px;background:#d7ad58;color:#17191c;font-size:25px;font-weight:800;cursor:pointer}
.nx-chat-form>button:disabled{opacity:.55;cursor:wait}
.nx-chat-footer{flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;gap:8px;padding:0 14px 12px;background:#fff;color:#83888c;font-size:10px}
.nx-chat-footer button{border:0;background:transparent;color:#8a6a2c;font-size:11px;font-weight:750;cursor:pointer;padding:3px}
.nx-chat-results-head{padding:2px 0 0;font-size:12px;color:#626b72}
.nx-chat-results{display:flex;flex-direction:column;gap:9px}
.nx-chat-property{display:grid;grid-template-columns:104px minmax(0,1fr);gap:11px;border:1px solid #e8e7e2;border-radius:15px;padding:8px;background:#fff;box-shadow:0 2px 7px rgba(18,25,30,.035)}
.nx-chat-property img{width:104px;height:103px;object-fit:cover;border-radius:10px;background:#e9e7e2}
.nx-chat-property-body{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0;padding:1px 0 2px}
.nx-chat-property-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;line-height:1.35;font-weight:800;color:#252c32;text-decoration:none}
.nx-chat-property-title:hover{color:#8d6825}
.nx-chat-property-location{font-size:10px;color:#7d858a;line-height:1.35}
.nx-chat-property-price{font-size:15px;font-weight:850;color:#8a6627;font-variant-numeric:tabular-nums}
.nx-chat-property-meta{font-size:10px;color:#6d747a}
.nx-chat-property-link{margin-top:auto;display:inline-flex;align-items:center;gap:5px;padding:6px 9px;border-radius:8px;background:#18212a;color:#fff;text-decoration:none;font-size:10px;font-weight:750}
.nx-chat-all-results{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;margin-top:1px;padding:9px 11px;border:1px solid #d7ad58;border-radius:10px;background:#fffaf0;color:#60491e;font-size:11px;font-weight:800;text-decoration:none}
.nx-chat-empty{padding:11px 12px;border:1px dashed #d8d3c8;border-radius:13px;color:#5e6266;font-size:12px;line-height:1.5;background:#fff}
.nx-chat-sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:640px){
 .nx-chat-launcher{right:14px;bottom:calc(14px + env(safe-area-inset-bottom));padding:8px 13px 8px 9px;gap:8px;font-size:12px}
 .nx-chat-launcher-icon{width:34px;height:34px}
 .nx-chat-panel{right:8px;bottom:calc(68px + env(safe-area-inset-bottom));width:calc(100vw - 16px);height:min(76dvh,690px);max-height:calc(100dvh - 90px);border-radius:20px}
 .nx-chat-header{padding:13px 13px}
 .nx-chat-messages{padding:13px 10px 10px}
 .nx-chat-property{grid-template-columns:88px minmax(0,1fr);gap:9px;padding:7px}
 .nx-chat-property img{width:88px;height:96px}
 .nx-chat-property-price{font-size:14px}
 .nx-chat-form{padding:9px}
}
@media(prefers-reduced-motion:reduce){.nx-chat-launcher{transition:none}}


.nx-chat-footer{flex-wrap:wrap;}
.nx-chat-footer [data-xpert-chat-guide-open]{color:#5f4922;text-decoration:underline;text-underline-offset:2px;}
.nx-chat-footer [data-xpert-chat-guide-open]:focus-visible{outline:2px solid #b99245;outline-offset:2px;border-radius:4px;}
@media(max-width:420px){.nx-chat-footer{gap:4px}.nx-chat-footer>span{flex:1 0 100%;}.nx-chat-footer button{font-size:10px;}}


/* Mobile floating actions: keep assistant and phone CTA on opposite sides. */
@media(max-width:640px){
  .nx-chat-launcher{
    left:10px;
    right:auto;
    bottom:calc(12px + env(safe-area-inset-bottom));
    max-width:calc(50vw - 18px);
  }
  .nx-chat-launcher-label{white-space:normal;line-height:1.15;}
  .nx-chat-panel{
    left:8px;
    right:auto;
    bottom:calc(68px + env(safe-area-inset-bottom));
    width:calc(100vw - 16px);
    max-width:440px;
  }
  /* If a compare bar is present, lift both controls together but preserve sides. */
  body:has(.compare-bar) .nx-chat-launcher{bottom:calc(78px + env(safe-area-inset-bottom));}
  body:has(.compare-bar) .nx-chat-panel{bottom:calc(132px + env(safe-area-inset-bottom));}
}


/* NekretnineXpert: consistent icon-only floating actions on every mobile page */
@media (max-width: 900px) {
  .nx-chat-launcher {
    position: fixed !important;
    left: max(14px, env(safe-area-inset-left)) !important;
    right: auto !important;
    bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    place-items: center !important;
    gap: 0 !important;
    border-radius: 50% !important;
    overflow: hidden;
    z-index: 1200 !important;
    box-sizing: border-box !important;
  }
  .nx-chat-launcher-label { display: none !important; }
  .nx-chat-launcher-icon {
    width: 56px !important;
    height: 56px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    background-color: #d7ad58 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23121820' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.4 8.4 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.4 8.4 0 0 1-3.8-.9L3 21l1.9-5.7a8.4 8.4 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.4 8.4 0 0 1 3.8-.9h.5a8.5 8.5 0 0 1 8 8z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 28px 28px !important;
  }
  .mobile-call-fab {
    position: fixed !important;
    right: max(14px, env(safe-area-inset-right)) !important;
    left: auto !important;
    bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    max-width: 56px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    place-items: center !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
    z-index: 1200 !important;
  }
  .mobile-call-fab span { font-size: 25px !important; line-height: 1 !important; }
  .mobile-call-fab b { display: none !important; }
  /* Both icons stay at the same height across all pages, including compare. */
  /* When the compare tray is visible, lift floating actions above it instead of
     letting the tray cover the chat/phone buttons. Keep both buttons aligned. */
  body:has(.compare-bar) .nx-chat-launcher,
  body:has(.compare-bar) .mobile-call-fab {
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
  }
  body:has(.compare-bar) .nx-chat-panel {
    bottom: calc(148px + env(safe-area-inset-bottom)) !important;
    max-height: calc(100dvh - 164px - env(safe-area-inset-bottom)) !important;
  }
  .nx-chat-panel { left: 10px !important; right: 10px !important; bottom: calc(82px + env(safe-area-inset-bottom)) !important; width: auto !important; max-width: none !important; }
}


/* Consolidated mobile floating-action layout: chat left, phone right, back-to-top above phone. */
@media (max-width: 900px) {
  .nx-chat-launcher {
    position: fixed !important; left: max(14px, env(safe-area-inset-left)) !important; right: auto !important;
    bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    width: 56px !important; height: 56px !important; min-width: 56px !important; min-height: 56px !important;
    max-width: 56px !important; padding: 0 !important; margin: 0 !important;
    display: grid !important; place-items: center !important; border-radius: 50% !important;
    z-index: 1200 !important; box-sizing: border-box !important;
  }
  .nx-chat-launcher-label { display: none !important; }
  .nx-chat-launcher-icon { width: 56px !important; height: 56px !important; flex: 0 0 56px !important; }
  .mobile-call-fab {
    position: fixed !important; right: max(14px, env(safe-area-inset-right)) !important; left: auto !important;
    bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    width: 56px !important; height: 56px !important; min-width: 56px !important; min-height: 56px !important;
    max-width: 56px !important; padding: 0 !important; margin: 0 !important;
    display: grid !important; place-items: center !important; grid-template-columns: 1fr !important;
    border-radius: 50% !important; z-index: 1200 !important; box-sizing: border-box !important;
  }
  .mobile-call-fab span { font-size: 25px !important; line-height: 1 !important; }
  .mobile-call-fab b { display: none !important; }
  .back-top { right: max(14px, env(safe-area-inset-right)) !important; bottom: calc(84px + env(safe-area-inset-bottom)) !important; z-index: 1190 !important; }
  .nx-chat-panel { left: 10px !important; right: 10px !important; bottom: calc(82px + env(safe-area-inset-bottom)) !important; width: auto !important; max-width: none !important; }
}
