#pcsa-root{position:fixed;right:18px;bottom:18px;z-index:999999;font-family:inherit;direction:rtl}#pcsa-toggle{border:0;background:#5b32c9;color:#fff;border-radius:999px;padding:13px 18px;box-shadow:0 8px 28px rgba(0,0,0,.22);cursor:pointer;font-weight:800;font-size:14px;display:flex;align-items:center;gap:8px}#pcsa-toggle span{font-size:20px}#pcsa-window{display:none;position:absolute;right:0;bottom:62px;width:380px;max-width:calc(100vw - 24px);height:600px;max-height:78vh;background:#fff;border-radius:20px;overflow:hidden;box-shadow:0 18px 60px rgba(0,0,0,.25);flex-direction:column}#pcsa-window.open{display:flex}.pcsa-header{background:linear-gradient(135deg,#5b32c9,#7b4de8);color:#fff;padding:15px 16px;display:flex;justify-content:space-between;align-items:center}.pcsa-brand{display:flex;gap:10px;align-items:center}.pcsa-avatar{width:42px;height:42px;border-radius:50%;background:#fff;color:#5b32c9;display:grid;place-items:center;font-size:22px}.pcsa-brand strong,.pcsa-brand span{display:block}.pcsa-brand span{font-size:11px;opacity:.88;margin-top:2px}.pcsa-header-actions{display:flex;gap:7px;align-items:center}.pcsa-header-actions button{background:rgba(255,255,255,.16);border:0;color:#fff;width:32px;height:32px;border-radius:50%;font-size:18px;cursor:pointer;display:grid;place-items:center}.pcsa-header-actions #pcsa-close{font-size:24px}#pcsa-messages{flex:1;overflow:auto;padding:14px;background:#f6f5fa}.pcsa-msg{max-width:90%;padding:11px 13px;margin-bottom:10px;border-radius:15px;font-size:14px;line-height:1.65}.pcsa-msg.bot{background:#fff;color:#24212b;border-bottom-right-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.04)}.pcsa-msg.user{background:#5b32c9;color:#fff;margin-right:auto;border-bottom-left-radius:4px}.pcsa-loading{opacity:.7}.pcsa-quick{display:flex;gap:6px;padding:8px;border-top:1px solid #eee;background:#fff;overflow-x:auto;scrollbar-width:none}.pcsa-quick::-webkit-scrollbar{display:none}.pcsa-quick button{white-space:nowrap;border:1px solid #e3dcf3;background:#fbfaff;color:#5b32c9;border-radius:999px;padding:7px 10px;cursor:pointer;font-size:11px}#pcsa-form{display:flex;gap:7px;padding:10px;border-top:1px solid #eee;background:#fff}#pcsa-input{flex:1;min-width:0;border:1px solid #ddd;border-radius:999px;padding:11px 14px;outline:none;font:inherit}#pcsa-form button{width:43px;height:43px;border:0;border-radius:50%;background:#5b32c9;color:#fff;cursor:pointer}.pcsa-products{display:flex;flex-direction:column;gap:9px;margin-top:10px}.pcsa-product{display:flex;gap:8px;padding:8px;border:1px solid #eee;border-radius:12px;background:#fff}.pcsa-product img{width:64px;height:64px;object-fit:contain}.pcsa-product-body{flex:1;min-width:0}.pcsa-product-body strong{display:block;font-size:13px}.pcsa-price{color:#5b32c9;font-weight:800;margin:3px 0}.pcsa-product-body small{display:block;color:#666;font-size:11px;line-height:1.4}.pcsa-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:7px}.pcsa-actions button{border:0;background:#eee;color:#333;padding:6px 8px;border-radius:7px;cursor:pointer;font-size:11px}.pcsa-actions button:last-child{background:#5b32c9;color:#fff}.pcsa-link-btn{display:inline-block;margin-top:6px;background:#5b32c9;color:#fff!important;text-decoration:none!important;padding:8px 13px;border-radius:9px;font-weight:700;font-size:12px}.pcsa-followup{margin-top:9px;font-weight:700}.pcsa-choice-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.pcsa-choice-row button{border:1px solid #e3dcf3;background:#fbfaff;color:#5b32c9;border-radius:999px;padding:7px 10px;font-size:11px;cursor:pointer}.pcsa-modal{display:none;position:fixed;inset:0;z-index:1000000;align-items:center;justify-content:center}.pcsa-modal.open{display:flex}.pcsa-modal-bg{position:absolute;inset:0;background:rgba(0,0,0,.45)}.pcsa-modal-card{position:relative;z-index:1;width:min(430px,calc(100vw - 26px));max-height:82vh;overflow:auto;background:#fff;border-radius:18px;padding:18px;box-shadow:0 20px 70px rgba(0,0,0,.3)}#pcsa-modal-close{position:absolute;left:10px;top:10px;width:32px;height:32px;border:0;border-radius:50%;background:#eee;font-size:23px;cursor:pointer}.pcsa-modal-card img{display:block;width:100%;height:220px;object-fit:contain}.pcsa-modal-card h3{font-size:18px;margin:8px 0}.pcsa-modal-actions{display:flex;gap:7px;flex-wrap:wrap}.pcsa-modal-actions a,.pcsa-modal-actions button{border:0;border-radius:9px;padding:9px 12px;text-decoration:none;background:#5b32c9;color:#fff;cursor:pointer;font-size:12px}@media(max-width:768px){
  /* Floating assistant: keep it clear of the mobile bottom navigation */
  #pcsa-root{
    left:14px;
    right:auto;
    bottom:calc(82px + env(safe-area-inset-bottom));
    width:auto;
    z-index:999999;
  }

  #pcsa-toggle{
    width:56px;
    height:56px;
    min-width:56px;
    padding:0;
    margin:0;
    justify-content:center;
    border-radius:50%;
    box-shadow:0 10px 30px rgba(53,28,120,.30);
  }
  #pcsa-toggle b{display:none}
  #pcsa-toggle span{font-size:23px;line-height:1}

  /* On phones the chat becomes an app-like panel, not a tiny desktop popup */
  #pcsa-window{
    position:fixed;
    left:10px;
    right:10px;
    bottom:calc(10px + env(safe-area-inset-bottom));
    width:auto;
    max-width:none;
    height:calc(100dvh - 20px - env(safe-area-inset-bottom));
    max-height:none;
    border-radius:20px;
  }

  .pcsa-header{
    padding:14px 15px;
    min-height:66px;
  }
  .pcsa-avatar{width:40px;height:40px;font-size:21px}
  .pcsa-brand strong{font-size:14px}

  #pcsa-messages{
    padding:12px;
    overscroll-behavior:contain;
  }
  .pcsa-msg{
    max-width:92%;
    font-size:13.5px;
    padding:10px 12px;
    line-height:1.7;
  }

  .pcsa-quick{
    padding:8px 10px;
    gap:7px;
    -webkit-overflow-scrolling:touch;
  }
  .pcsa-quick button{
    font-size:11px;
    padding:7px 11px;
  }

  #pcsa-form{
    padding:10px;
    gap:8px;
    padding-bottom:calc(10px + env(safe-area-inset-bottom));
  }
  #pcsa-input{
    min-height:46px;
    font-size:16px; /* prevents iOS auto-zoom */
    padding:10px 14px;
  }
  #pcsa-form button{
    width:46px;
    height:46px;
    min-width:46px;
  }

  /* Product results are easier to scan and tap on a phone */
  .pcsa-products{gap:8px}
  .pcsa-product{
    gap:10px;
    padding:9px;
    border-radius:14px;
  }
  .pcsa-product img{width:62px;height:62px}
  .pcsa-product-body strong{font-size:12.5px;line-height:1.45}
  .pcsa-price{font-size:13px}
  .pcsa-actions button{
    min-height:34px;
    padding:7px 9px;
  }

  .pcsa-modal{
    align-items:flex-end;
  }
  .pcsa-modal-card{
    width:100%;
    max-width:none;
    max-height:88dvh;
    border-radius:22px 22px 0 0;
    padding:18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .pcsa-modal-card img{height:190px}
}

/* Very small phones */
@media(max-width:380px){
  #pcsa-window{left:6px;right:6px;border-radius:16px}
  .pcsa-header{padding:12px}
  .pcsa-msg{max-width:95%}
}
